Lines 8-16
Link Here
|
8 |
// input blocks must be (four bytes) interleaved. |
8 |
// input blocks must be (four bytes) interleaved. |
9 |
|
9 |
|
10 |
#if defined(__x86_64__) && defined(__APPLE__) |
10 |
#if defined(__x86_64__) && defined(__APPLE__) |
|
|
11 |
#define PRELOAD(x) |
11 |
#define MANGLE(x) x(%rip) |
12 |
#define MANGLE(x) x(%rip) |
|
|
13 |
#define INIT_PIC() |
14 |
#define END_PIC() |
12 |
#else |
15 |
#else |
|
|
16 |
#ifdef __PIC__ |
17 |
|
18 |
#ifdef __x86_64__ |
19 |
#define PRELOAD(x) movq x@GOTPCREL(%rip), %rbx; |
20 |
#define MANGLE(x) (%rbx) |
21 |
#define INIT_PIC() pushq %rbx |
22 |
#define END_PIC() popq %rbx |
23 |
#else |
24 |
#undef __i686 /* gcc builtin define gets in our way */ |
25 |
#define PRELOAD(x) |
26 |
#define MANGLE(x) x ## @GOTOFF(%ebx) |
27 |
#define INIT_PIC() \ |
28 |
call __i686.get_pc_thunk.bx ; \ |
29 |
addl $_GLOBAL_OFFSET_TABLE_, %ebx |
30 |
#define END_PIC() |
31 |
#endif |
32 |
|
33 |
#else |
34 |
|
35 |
#define PRELOAD(x) |
13 |
#define MANGLE(x) x |
36 |
#define MANGLE(x) x |
|
|
37 |
#define INIT_PIC() |
38 |
#define END_PIC() |
39 |
|
40 |
#endif |
14 |
#endif |
41 |
#endif |
15 |
|
42 |
|
16 |
#if defined(__i386__) || defined(__x86_64__) |
43 |
#if defined(__i386__) || defined(__x86_64__) |
Lines 142-153
Link Here
|
142 |
paddd tmp2, e; \ |
169 |
paddd tmp2, e; \ |
143 |
movdqa b, tmp2; \ |
170 |
movdqa b, tmp2; \ |
144 |
pslld $30, b; \ |
171 |
pslld $30, b; \ |
|
|
172 |
PRELOAD(k) \ |
145 |
paddd MANGLE(k), e; \ |
173 |
paddd MANGLE(k), e; \ |
146 |
psrld $2, tmp2; \ |
174 |
psrld $2, tmp2; \ |
147 |
por tmp2, b; \ |
175 |
por tmp2, b; \ |
148 |
movdqa (data*16)(edx_rsi), tmp1; \ |
176 |
movdqa (data*16)(edx_rsi), tmp1; \ |
149 |
movdqa tmp1, tmp2; \ |
177 |
movdqa tmp1, tmp2; \ |
|
|
178 |
PRELOAD(const_ff00) \ |
150 |
pand MANGLE(const_ff00), tmp1; \ |
179 |
pand MANGLE(const_ff00), tmp1; \ |
|
|
180 |
PRELOAD(const_00ff) \ |
151 |
pand MANGLE(const_00ff), tmp2; \ |
181 |
pand MANGLE(const_00ff), tmp2; \ |
152 |
psrld $8, tmp1; \ |
182 |
psrld $8, tmp1; \ |
153 |
pslld $8, tmp2; \ |
183 |
pslld $8, tmp2; \ |
Lines 181-186
Link Here
|
181 |
paddd tmp2, e; \ |
211 |
paddd tmp2, e; \ |
182 |
movdqa b, tmp2; \ |
212 |
movdqa b, tmp2; \ |
183 |
pslld $30, b; \ |
213 |
pslld $30, b; \ |
|
|
214 |
PRELOAD(k) \ |
184 |
paddd MANGLE(k), e; \ |
215 |
paddd MANGLE(k), e; \ |
185 |
psrld $2, tmp2; \ |
216 |
psrld $2, tmp2; \ |
186 |
por tmp2, b; |
217 |
por tmp2, b; |
Lines 192-201
Link Here
|
192 |
shasse2_init: |
223 |
shasse2_init: |
193 |
_shasse2_init: |
224 |
_shasse2_init: |
194 |
|
225 |
|
|
|
226 |
INIT_PIC() |
227 |
PRELOAD(const_init_a) |
195 |
movdqa MANGLE(const_init_a), ctxa |
228 |
movdqa MANGLE(const_init_a), ctxa |
|
|
229 |
PRELOAD(const_init_b) |
196 |
movdqa MANGLE(const_init_b), ctxb |
230 |
movdqa MANGLE(const_init_b), ctxb |
|
|
231 |
PRELOAD(const_init_c) |
197 |
movdqa MANGLE(const_init_c), ctxc |
232 |
movdqa MANGLE(const_init_c), ctxc |
|
|
233 |
PRELOAD(const_init_d) |
198 |
movdqa MANGLE(const_init_d), ctxd |
234 |
movdqa MANGLE(const_init_d), ctxd |
|
|
235 |
PRELOAD(const_init_e) |
199 |
movdqa MANGLE(const_init_e), ctxe |
236 |
movdqa MANGLE(const_init_e), ctxe |
200 |
|
237 |
|
201 |
movdqa ctxa, 0(eax_rdi) |
238 |
movdqa ctxa, 0(eax_rdi) |
Lines 203-208
Link Here
|
203 |
movdqa ctxc, 32(eax_rdi) |
240 |
movdqa ctxc, 32(eax_rdi) |
204 |
movdqa ctxd, 48(eax_rdi) |
241 |
movdqa ctxd, 48(eax_rdi) |
205 |
movdqa ctxe, 64(eax_rdi) |
242 |
movdqa ctxe, 64(eax_rdi) |
|
|
243 |
END_PIC() |
206 |
|
244 |
|
207 |
ret |
245 |
ret |
208 |
|
246 |
|
Lines 212-228
Link Here
|
212 |
shasse2_ends: |
250 |
shasse2_ends: |
213 |
_shasse2_ends: |
251 |
_shasse2_ends: |
214 |
|
252 |
|
215 |
movdqa 0(eax_rdi), ctxa |
253 |
INIT_PIC() |
|
|
254 |
movdqa 0(eax_rdi), ctxa |
216 |
movdqa 16(eax_rdi), ctxb |
255 |
movdqa 16(eax_rdi), ctxb |
217 |
movdqa 32(eax_rdi), ctxc |
256 |
movdqa 32(eax_rdi), ctxc |
218 |
movdqa 48(eax_rdi), ctxd |
257 |
movdqa 48(eax_rdi), ctxd |
219 |
movdqa 64(eax_rdi), ctxe |
258 |
movdqa 64(eax_rdi), ctxe |
220 |
|
259 |
|
|
|
260 |
PRELOAD(const_ff00) |
221 |
movdqa MANGLE(const_ff00), tmp3 |
261 |
movdqa MANGLE(const_ff00), tmp3 |
222 |
movdqa ctxa, tmp1 |
262 |
movdqa ctxa, tmp1 |
223 |
movdqa ctxb, tmp2 |
263 |
movdqa ctxb, tmp2 |
224 |
pand tmp3, ctxa |
264 |
pand tmp3, ctxa |
225 |
pand tmp3, ctxb |
265 |
pand tmp3, ctxb |
|
|
266 |
PRELOAD(const_00ff) |
226 |
movdqa MANGLE(const_00ff), tmp3 |
267 |
movdqa MANGLE(const_00ff), tmp3 |
227 |
pand tmp3, tmp1 |
268 |
pand tmp3, tmp1 |
228 |
pand tmp3, tmp2 |
269 |
pand tmp3, tmp2 |
Lines 243-248
Link Here
|
243 |
movdqa ctxa, 0(edx_rsi) |
284 |
movdqa ctxa, 0(edx_rsi) |
244 |
movdqa ctxb, 16(edx_rsi) |
285 |
movdqa ctxb, 16(edx_rsi) |
245 |
|
286 |
|
|
|
287 |
PRELOAD(const_ff00) |
246 |
movdqa MANGLE(const_ff00), tmp5 |
288 |
movdqa MANGLE(const_ff00), tmp5 |
247 |
movdqa ctxc, tmp1 |
289 |
movdqa ctxc, tmp1 |
248 |
movdqa ctxd, tmp2 |
290 |
movdqa ctxd, tmp2 |
Lines 250-255
Link Here
|
250 |
pand tmp5, ctxc |
292 |
pand tmp5, ctxc |
251 |
pand tmp5, ctxd |
293 |
pand tmp5, ctxd |
252 |
pand tmp5, ctxe |
294 |
pand tmp5, ctxe |
|
|
295 |
PRELOAD(const_00ff) |
253 |
movdqa MANGLE(const_00ff), tmp5 |
296 |
movdqa MANGLE(const_00ff), tmp5 |
254 |
pand tmp5, tmp1 |
297 |
pand tmp5, tmp1 |
255 |
pand tmp5, tmp2 |
298 |
pand tmp5, tmp2 |
Lines 279-284
Link Here
|
279 |
movdqa ctxc, 32(edx_rsi) |
322 |
movdqa ctxc, 32(edx_rsi) |
280 |
movdqa ctxd, 48(edx_rsi) |
323 |
movdqa ctxd, 48(edx_rsi) |
281 |
movdqa ctxe, 64(edx_rsi) |
324 |
movdqa ctxe, 64(edx_rsi) |
|
|
325 |
END_PIC() |
282 |
|
326 |
|
283 |
ret |
327 |
ret |
284 |
|
328 |
|
Lines 289-294
Link Here
|
289 |
shasse2_data: |
333 |
shasse2_data: |
290 |
_shasse2_data: |
334 |
_shasse2_data: |
291 |
|
335 |
|
|
|
336 |
INIT_PIC() |
292 |
movdqa 0(eax_rdi), ctxa |
337 |
movdqa 0(eax_rdi), ctxa |
293 |
movdqa 16(eax_rdi), ctxb |
338 |
movdqa 16(eax_rdi), ctxb |
294 |
movdqa 32(eax_rdi), ctxc |
339 |
movdqa 32(eax_rdi), ctxc |
Lines 400-405
Link Here
|
400 |
movdqa ctxc, 32(eax_rdi) |
445 |
movdqa ctxc, 32(eax_rdi) |
401 |
movdqa ctxd, 48(eax_rdi) |
446 |
movdqa ctxd, 48(eax_rdi) |
402 |
movdqa ctxe, 64(eax_rdi) |
447 |
movdqa ctxe, 64(eax_rdi) |
|
|
448 |
END_PIC() |
403 |
|
449 |
|
404 |
ret |
450 |
ret |
405 |
|
451 |
|
Lines 462-467
Link Here
|
462 |
pop %ebx |
508 |
pop %ebx |
463 |
#endif |
509 |
#endif |
464 |
ret |
510 |
ret |
|
|
511 |
#ifdef __i386__ |
512 |
#ifdef __PIC__ |
513 |
.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits |
514 |
.globl __i686.get_pc_thunk.bx |
515 |
.hidden __i686.get_pc_thunk.bx |
516 |
.type __i686.get_pc_thunk.bx,@function |
517 |
__i686.get_pc_thunk.bx: |
518 |
movl (%esp), %ebx |
519 |
ret |
520 |
#endif |
521 |
#endif |
465 |
#endif |
522 |
#endif |
466 |
|
523 |
|
467 |
|
524 |
|