blob: 0f0a94ece3d19a862e277371b9385fb162cf4592 [file] [log] [blame]
Adam Langleyd9e397b2015-01-22 14:27:53 -08001#if defined(__i386__)
2.file "src/crypto/bn/asm/bn-586.S"
3.text
4.globl _bn_mul_add_words
5.private_extern _bn_mul_add_words
6.align 4
7_bn_mul_add_words:
8L_bn_mul_add_words_begin:
Adam Langleye9ada862015-05-11 17:20:37 -07009 call L000PIC_me_up
10L000PIC_me_up:
11 popl %eax
12 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L000PIC_me_up(%eax),%eax
13 btl $26,(%eax)
14 jnc L001maw_non_sse2
15 movl 4(%esp),%eax
16 movl 8(%esp),%edx
17 movl 12(%esp),%ecx
18 movd 16(%esp),%mm0
19 pxor %mm1,%mm1
20 jmp L002maw_sse2_entry
21.align 4,0x90
22L003maw_sse2_unrolled:
23 movd (%eax),%mm3
24 paddq %mm3,%mm1
25 movd (%edx),%mm2
26 pmuludq %mm0,%mm2
27 movd 4(%edx),%mm4
28 pmuludq %mm0,%mm4
29 movd 8(%edx),%mm6
30 pmuludq %mm0,%mm6
31 movd 12(%edx),%mm7
32 pmuludq %mm0,%mm7
33 paddq %mm2,%mm1
34 movd 4(%eax),%mm3
35 paddq %mm4,%mm3
36 movd 8(%eax),%mm5
37 paddq %mm6,%mm5
38 movd 12(%eax),%mm4
39 paddq %mm4,%mm7
40 movd %mm1,(%eax)
41 movd 16(%edx),%mm2
42 pmuludq %mm0,%mm2
43 psrlq $32,%mm1
44 movd 20(%edx),%mm4
45 pmuludq %mm0,%mm4
46 paddq %mm3,%mm1
47 movd 24(%edx),%mm6
48 pmuludq %mm0,%mm6
49 movd %mm1,4(%eax)
50 psrlq $32,%mm1
51 movd 28(%edx),%mm3
52 addl $32,%edx
53 pmuludq %mm0,%mm3
54 paddq %mm5,%mm1
55 movd 16(%eax),%mm5
56 paddq %mm5,%mm2
57 movd %mm1,8(%eax)
58 psrlq $32,%mm1
59 paddq %mm7,%mm1
60 movd 20(%eax),%mm5
61 paddq %mm5,%mm4
62 movd %mm1,12(%eax)
63 psrlq $32,%mm1
64 paddq %mm2,%mm1
65 movd 24(%eax),%mm5
66 paddq %mm5,%mm6
67 movd %mm1,16(%eax)
68 psrlq $32,%mm1
69 paddq %mm4,%mm1
70 movd 28(%eax),%mm5
71 paddq %mm5,%mm3
72 movd %mm1,20(%eax)
73 psrlq $32,%mm1
74 paddq %mm6,%mm1
75 movd %mm1,24(%eax)
76 psrlq $32,%mm1
77 paddq %mm3,%mm1
78 movd %mm1,28(%eax)
79 leal 32(%eax),%eax
80 psrlq $32,%mm1
81 subl $8,%ecx
82 jz L004maw_sse2_exit
83L002maw_sse2_entry:
84 testl $4294967288,%ecx
85 jnz L003maw_sse2_unrolled
86.align 2,0x90
87L005maw_sse2_loop:
88 movd (%edx),%mm2
89 movd (%eax),%mm3
90 pmuludq %mm0,%mm2
91 leal 4(%edx),%edx
92 paddq %mm3,%mm1
93 paddq %mm2,%mm1
94 movd %mm1,(%eax)
95 subl $1,%ecx
96 psrlq $32,%mm1
97 leal 4(%eax),%eax
98 jnz L005maw_sse2_loop
99L004maw_sse2_exit:
100 movd %mm1,%eax
101 emms
102 ret
103.align 4,0x90
104L001maw_non_sse2:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800105 pushl %ebp
106 pushl %ebx
107 pushl %esi
108 pushl %edi
109
110 xorl %esi,%esi
111 movl 20(%esp),%edi
112 movl 28(%esp),%ecx
113 movl 24(%esp),%ebx
114 andl $4294967288,%ecx
115 movl 32(%esp),%ebp
116 pushl %ecx
Adam Langleye9ada862015-05-11 17:20:37 -0700117 jz L006maw_finish
Adam Langleyd9e397b2015-01-22 14:27:53 -0800118.align 4,0x90
Adam Langleye9ada862015-05-11 17:20:37 -0700119L007maw_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800120 # Round 0
121 movl (%ebx),%eax
122 mull %ebp
123 addl %esi,%eax
124 adcl $0,%edx
125 addl (%edi),%eax
126 adcl $0,%edx
127 movl %eax,(%edi)
128 movl %edx,%esi
129 # Round 4
130 movl 4(%ebx),%eax
131 mull %ebp
132 addl %esi,%eax
133 adcl $0,%edx
134 addl 4(%edi),%eax
135 adcl $0,%edx
136 movl %eax,4(%edi)
137 movl %edx,%esi
138 # Round 8
139 movl 8(%ebx),%eax
140 mull %ebp
141 addl %esi,%eax
142 adcl $0,%edx
143 addl 8(%edi),%eax
144 adcl $0,%edx
145 movl %eax,8(%edi)
146 movl %edx,%esi
147 # Round 12
148 movl 12(%ebx),%eax
149 mull %ebp
150 addl %esi,%eax
151 adcl $0,%edx
152 addl 12(%edi),%eax
153 adcl $0,%edx
154 movl %eax,12(%edi)
155 movl %edx,%esi
156 # Round 16
157 movl 16(%ebx),%eax
158 mull %ebp
159 addl %esi,%eax
160 adcl $0,%edx
161 addl 16(%edi),%eax
162 adcl $0,%edx
163 movl %eax,16(%edi)
164 movl %edx,%esi
165 # Round 20
166 movl 20(%ebx),%eax
167 mull %ebp
168 addl %esi,%eax
169 adcl $0,%edx
170 addl 20(%edi),%eax
171 adcl $0,%edx
172 movl %eax,20(%edi)
173 movl %edx,%esi
174 # Round 24
175 movl 24(%ebx),%eax
176 mull %ebp
177 addl %esi,%eax
178 adcl $0,%edx
179 addl 24(%edi),%eax
180 adcl $0,%edx
181 movl %eax,24(%edi)
182 movl %edx,%esi
183 # Round 28
184 movl 28(%ebx),%eax
185 mull %ebp
186 addl %esi,%eax
187 adcl $0,%edx
188 addl 28(%edi),%eax
189 adcl $0,%edx
190 movl %eax,28(%edi)
191 movl %edx,%esi
192
193 subl $8,%ecx
194 leal 32(%ebx),%ebx
195 leal 32(%edi),%edi
Adam Langleye9ada862015-05-11 17:20:37 -0700196 jnz L007maw_loop
197L006maw_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800198 movl 32(%esp),%ecx
199 andl $7,%ecx
Adam Langleye9ada862015-05-11 17:20:37 -0700200 jnz L008maw_finish2
201 jmp L009maw_end
202L008maw_finish2:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800203 # Tail Round 0
204 movl (%ebx),%eax
205 mull %ebp
206 addl %esi,%eax
207 adcl $0,%edx
208 addl (%edi),%eax
209 adcl $0,%edx
210 decl %ecx
211 movl %eax,(%edi)
212 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700213 jz L009maw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800214 # Tail Round 1
215 movl 4(%ebx),%eax
216 mull %ebp
217 addl %esi,%eax
218 adcl $0,%edx
219 addl 4(%edi),%eax
220 adcl $0,%edx
221 decl %ecx
222 movl %eax,4(%edi)
223 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700224 jz L009maw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800225 # Tail Round 2
226 movl 8(%ebx),%eax
227 mull %ebp
228 addl %esi,%eax
229 adcl $0,%edx
230 addl 8(%edi),%eax
231 adcl $0,%edx
232 decl %ecx
233 movl %eax,8(%edi)
234 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700235 jz L009maw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800236 # Tail Round 3
237 movl 12(%ebx),%eax
238 mull %ebp
239 addl %esi,%eax
240 adcl $0,%edx
241 addl 12(%edi),%eax
242 adcl $0,%edx
243 decl %ecx
244 movl %eax,12(%edi)
245 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700246 jz L009maw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800247 # Tail Round 4
248 movl 16(%ebx),%eax
249 mull %ebp
250 addl %esi,%eax
251 adcl $0,%edx
252 addl 16(%edi),%eax
253 adcl $0,%edx
254 decl %ecx
255 movl %eax,16(%edi)
256 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700257 jz L009maw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800258 # Tail Round 5
259 movl 20(%ebx),%eax
260 mull %ebp
261 addl %esi,%eax
262 adcl $0,%edx
263 addl 20(%edi),%eax
264 adcl $0,%edx
265 decl %ecx
266 movl %eax,20(%edi)
267 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700268 jz L009maw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800269 # Tail Round 6
270 movl 24(%ebx),%eax
271 mull %ebp
272 addl %esi,%eax
273 adcl $0,%edx
274 addl 24(%edi),%eax
275 adcl $0,%edx
276 movl %eax,24(%edi)
277 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700278L009maw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800279 movl %esi,%eax
280 popl %ecx
281 popl %edi
282 popl %esi
283 popl %ebx
284 popl %ebp
285 ret
286.globl _bn_mul_words
287.private_extern _bn_mul_words
288.align 4
289_bn_mul_words:
290L_bn_mul_words_begin:
Adam Langleye9ada862015-05-11 17:20:37 -0700291 call L010PIC_me_up
292L010PIC_me_up:
293 popl %eax
294 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L010PIC_me_up(%eax),%eax
295 btl $26,(%eax)
296 jnc L011mw_non_sse2
297 movl 4(%esp),%eax
298 movl 8(%esp),%edx
299 movl 12(%esp),%ecx
300 movd 16(%esp),%mm0
301 pxor %mm1,%mm1
302.align 4,0x90
303L012mw_sse2_loop:
304 movd (%edx),%mm2
305 pmuludq %mm0,%mm2
306 leal 4(%edx),%edx
307 paddq %mm2,%mm1
308 movd %mm1,(%eax)
309 subl $1,%ecx
310 psrlq $32,%mm1
311 leal 4(%eax),%eax
312 jnz L012mw_sse2_loop
313 movd %mm1,%eax
314 emms
315 ret
316.align 4,0x90
317L011mw_non_sse2:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800318 pushl %ebp
319 pushl %ebx
320 pushl %esi
321 pushl %edi
322
323 xorl %esi,%esi
324 movl 20(%esp),%edi
325 movl 24(%esp),%ebx
326 movl 28(%esp),%ebp
327 movl 32(%esp),%ecx
328 andl $4294967288,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700329 jz L013mw_finish
330L014mw_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800331 # Round 0
332 movl (%ebx),%eax
333 mull %ecx
334 addl %esi,%eax
335 adcl $0,%edx
336 movl %eax,(%edi)
337 movl %edx,%esi
338 # Round 4
339 movl 4(%ebx),%eax
340 mull %ecx
341 addl %esi,%eax
342 adcl $0,%edx
343 movl %eax,4(%edi)
344 movl %edx,%esi
345 # Round 8
346 movl 8(%ebx),%eax
347 mull %ecx
348 addl %esi,%eax
349 adcl $0,%edx
350 movl %eax,8(%edi)
351 movl %edx,%esi
352 # Round 12
353 movl 12(%ebx),%eax
354 mull %ecx
355 addl %esi,%eax
356 adcl $0,%edx
357 movl %eax,12(%edi)
358 movl %edx,%esi
359 # Round 16
360 movl 16(%ebx),%eax
361 mull %ecx
362 addl %esi,%eax
363 adcl $0,%edx
364 movl %eax,16(%edi)
365 movl %edx,%esi
366 # Round 20
367 movl 20(%ebx),%eax
368 mull %ecx
369 addl %esi,%eax
370 adcl $0,%edx
371 movl %eax,20(%edi)
372 movl %edx,%esi
373 # Round 24
374 movl 24(%ebx),%eax
375 mull %ecx
376 addl %esi,%eax
377 adcl $0,%edx
378 movl %eax,24(%edi)
379 movl %edx,%esi
380 # Round 28
381 movl 28(%ebx),%eax
382 mull %ecx
383 addl %esi,%eax
384 adcl $0,%edx
385 movl %eax,28(%edi)
386 movl %edx,%esi
387
388 addl $32,%ebx
389 addl $32,%edi
390 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700391 jz L013mw_finish
392 jmp L014mw_loop
393L013mw_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800394 movl 28(%esp),%ebp
395 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700396 jnz L015mw_finish2
397 jmp L016mw_end
398L015mw_finish2:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800399 # Tail Round 0
400 movl (%ebx),%eax
401 mull %ecx
402 addl %esi,%eax
403 adcl $0,%edx
404 movl %eax,(%edi)
405 movl %edx,%esi
406 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700407 jz L016mw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800408 # Tail Round 1
409 movl 4(%ebx),%eax
410 mull %ecx
411 addl %esi,%eax
412 adcl $0,%edx
413 movl %eax,4(%edi)
414 movl %edx,%esi
415 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700416 jz L016mw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800417 # Tail Round 2
418 movl 8(%ebx),%eax
419 mull %ecx
420 addl %esi,%eax
421 adcl $0,%edx
422 movl %eax,8(%edi)
423 movl %edx,%esi
424 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700425 jz L016mw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800426 # Tail Round 3
427 movl 12(%ebx),%eax
428 mull %ecx
429 addl %esi,%eax
430 adcl $0,%edx
431 movl %eax,12(%edi)
432 movl %edx,%esi
433 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700434 jz L016mw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800435 # Tail Round 4
436 movl 16(%ebx),%eax
437 mull %ecx
438 addl %esi,%eax
439 adcl $0,%edx
440 movl %eax,16(%edi)
441 movl %edx,%esi
442 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700443 jz L016mw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800444 # Tail Round 5
445 movl 20(%ebx),%eax
446 mull %ecx
447 addl %esi,%eax
448 adcl $0,%edx
449 movl %eax,20(%edi)
450 movl %edx,%esi
451 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700452 jz L016mw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800453 # Tail Round 6
454 movl 24(%ebx),%eax
455 mull %ecx
456 addl %esi,%eax
457 adcl $0,%edx
458 movl %eax,24(%edi)
459 movl %edx,%esi
Adam Langleye9ada862015-05-11 17:20:37 -0700460L016mw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800461 movl %esi,%eax
462 popl %edi
463 popl %esi
464 popl %ebx
465 popl %ebp
466 ret
467.globl _bn_sqr_words
468.private_extern _bn_sqr_words
469.align 4
470_bn_sqr_words:
471L_bn_sqr_words_begin:
Adam Langleye9ada862015-05-11 17:20:37 -0700472 call L017PIC_me_up
473L017PIC_me_up:
474 popl %eax
475 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L017PIC_me_up(%eax),%eax
476 btl $26,(%eax)
477 jnc L018sqr_non_sse2
478 movl 4(%esp),%eax
479 movl 8(%esp),%edx
480 movl 12(%esp),%ecx
481.align 4,0x90
482L019sqr_sse2_loop:
483 movd (%edx),%mm0
484 pmuludq %mm0,%mm0
485 leal 4(%edx),%edx
486 movq %mm0,(%eax)
487 subl $1,%ecx
488 leal 8(%eax),%eax
489 jnz L019sqr_sse2_loop
490 emms
491 ret
492.align 4,0x90
493L018sqr_non_sse2:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800494 pushl %ebp
495 pushl %ebx
496 pushl %esi
497 pushl %edi
498
499 movl 20(%esp),%esi
500 movl 24(%esp),%edi
501 movl 28(%esp),%ebx
502 andl $4294967288,%ebx
Adam Langleye9ada862015-05-11 17:20:37 -0700503 jz L020sw_finish
504L021sw_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800505 # Round 0
506 movl (%edi),%eax
507 mull %eax
508 movl %eax,(%esi)
509 movl %edx,4(%esi)
510 # Round 4
511 movl 4(%edi),%eax
512 mull %eax
513 movl %eax,8(%esi)
514 movl %edx,12(%esi)
515 # Round 8
516 movl 8(%edi),%eax
517 mull %eax
518 movl %eax,16(%esi)
519 movl %edx,20(%esi)
520 # Round 12
521 movl 12(%edi),%eax
522 mull %eax
523 movl %eax,24(%esi)
524 movl %edx,28(%esi)
525 # Round 16
526 movl 16(%edi),%eax
527 mull %eax
528 movl %eax,32(%esi)
529 movl %edx,36(%esi)
530 # Round 20
531 movl 20(%edi),%eax
532 mull %eax
533 movl %eax,40(%esi)
534 movl %edx,44(%esi)
535 # Round 24
536 movl 24(%edi),%eax
537 mull %eax
538 movl %eax,48(%esi)
539 movl %edx,52(%esi)
540 # Round 28
541 movl 28(%edi),%eax
542 mull %eax
543 movl %eax,56(%esi)
544 movl %edx,60(%esi)
545
546 addl $32,%edi
547 addl $64,%esi
548 subl $8,%ebx
Adam Langleye9ada862015-05-11 17:20:37 -0700549 jnz L021sw_loop
550L020sw_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800551 movl 28(%esp),%ebx
552 andl $7,%ebx
Adam Langleye9ada862015-05-11 17:20:37 -0700553 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800554 # Tail Round 0
555 movl (%edi),%eax
556 mull %eax
557 movl %eax,(%esi)
558 decl %ebx
559 movl %edx,4(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700560 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800561 # Tail Round 1
562 movl 4(%edi),%eax
563 mull %eax
564 movl %eax,8(%esi)
565 decl %ebx
566 movl %edx,12(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700567 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800568 # Tail Round 2
569 movl 8(%edi),%eax
570 mull %eax
571 movl %eax,16(%esi)
572 decl %ebx
573 movl %edx,20(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700574 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800575 # Tail Round 3
576 movl 12(%edi),%eax
577 mull %eax
578 movl %eax,24(%esi)
579 decl %ebx
580 movl %edx,28(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700581 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800582 # Tail Round 4
583 movl 16(%edi),%eax
584 mull %eax
585 movl %eax,32(%esi)
586 decl %ebx
587 movl %edx,36(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700588 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800589 # Tail Round 5
590 movl 20(%edi),%eax
591 mull %eax
592 movl %eax,40(%esi)
593 decl %ebx
594 movl %edx,44(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700595 jz L022sw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800596 # Tail Round 6
597 movl 24(%edi),%eax
598 mull %eax
599 movl %eax,48(%esi)
600 movl %edx,52(%esi)
Adam Langleye9ada862015-05-11 17:20:37 -0700601L022sw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800602 popl %edi
603 popl %esi
604 popl %ebx
605 popl %ebp
606 ret
607.globl _bn_div_words
608.private_extern _bn_div_words
609.align 4
610_bn_div_words:
611L_bn_div_words_begin:
612 movl 4(%esp),%edx
613 movl 8(%esp),%eax
614 movl 12(%esp),%ecx
615 divl %ecx
616 ret
617.globl _bn_add_words
618.private_extern _bn_add_words
619.align 4
620_bn_add_words:
621L_bn_add_words_begin:
622 pushl %ebp
623 pushl %ebx
624 pushl %esi
625 pushl %edi
626
627 movl 20(%esp),%ebx
628 movl 24(%esp),%esi
629 movl 28(%esp),%edi
630 movl 32(%esp),%ebp
631 xorl %eax,%eax
632 andl $4294967288,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700633 jz L023aw_finish
634L024aw_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800635 # Round 0
636 movl (%esi),%ecx
637 movl (%edi),%edx
638 addl %eax,%ecx
639 movl $0,%eax
640 adcl %eax,%eax
641 addl %edx,%ecx
642 adcl $0,%eax
643 movl %ecx,(%ebx)
644 # Round 1
645 movl 4(%esi),%ecx
646 movl 4(%edi),%edx
647 addl %eax,%ecx
648 movl $0,%eax
649 adcl %eax,%eax
650 addl %edx,%ecx
651 adcl $0,%eax
652 movl %ecx,4(%ebx)
653 # Round 2
654 movl 8(%esi),%ecx
655 movl 8(%edi),%edx
656 addl %eax,%ecx
657 movl $0,%eax
658 adcl %eax,%eax
659 addl %edx,%ecx
660 adcl $0,%eax
661 movl %ecx,8(%ebx)
662 # Round 3
663 movl 12(%esi),%ecx
664 movl 12(%edi),%edx
665 addl %eax,%ecx
666 movl $0,%eax
667 adcl %eax,%eax
668 addl %edx,%ecx
669 adcl $0,%eax
670 movl %ecx,12(%ebx)
671 # Round 4
672 movl 16(%esi),%ecx
673 movl 16(%edi),%edx
674 addl %eax,%ecx
675 movl $0,%eax
676 adcl %eax,%eax
677 addl %edx,%ecx
678 adcl $0,%eax
679 movl %ecx,16(%ebx)
680 # Round 5
681 movl 20(%esi),%ecx
682 movl 20(%edi),%edx
683 addl %eax,%ecx
684 movl $0,%eax
685 adcl %eax,%eax
686 addl %edx,%ecx
687 adcl $0,%eax
688 movl %ecx,20(%ebx)
689 # Round 6
690 movl 24(%esi),%ecx
691 movl 24(%edi),%edx
692 addl %eax,%ecx
693 movl $0,%eax
694 adcl %eax,%eax
695 addl %edx,%ecx
696 adcl $0,%eax
697 movl %ecx,24(%ebx)
698 # Round 7
699 movl 28(%esi),%ecx
700 movl 28(%edi),%edx
701 addl %eax,%ecx
702 movl $0,%eax
703 adcl %eax,%eax
704 addl %edx,%ecx
705 adcl $0,%eax
706 movl %ecx,28(%ebx)
707
708 addl $32,%esi
709 addl $32,%edi
710 addl $32,%ebx
711 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700712 jnz L024aw_loop
713L023aw_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800714 movl 32(%esp),%ebp
715 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700716 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800717 # Tail Round 0
718 movl (%esi),%ecx
719 movl (%edi),%edx
720 addl %eax,%ecx
721 movl $0,%eax
722 adcl %eax,%eax
723 addl %edx,%ecx
724 adcl $0,%eax
725 decl %ebp
726 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700727 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800728 # Tail Round 1
729 movl 4(%esi),%ecx
730 movl 4(%edi),%edx
731 addl %eax,%ecx
732 movl $0,%eax
733 adcl %eax,%eax
734 addl %edx,%ecx
735 adcl $0,%eax
736 decl %ebp
737 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700738 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800739 # Tail Round 2
740 movl 8(%esi),%ecx
741 movl 8(%edi),%edx
742 addl %eax,%ecx
743 movl $0,%eax
744 adcl %eax,%eax
745 addl %edx,%ecx
746 adcl $0,%eax
747 decl %ebp
748 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700749 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800750 # Tail Round 3
751 movl 12(%esi),%ecx
752 movl 12(%edi),%edx
753 addl %eax,%ecx
754 movl $0,%eax
755 adcl %eax,%eax
756 addl %edx,%ecx
757 adcl $0,%eax
758 decl %ebp
759 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700760 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800761 # Tail Round 4
762 movl 16(%esi),%ecx
763 movl 16(%edi),%edx
764 addl %eax,%ecx
765 movl $0,%eax
766 adcl %eax,%eax
767 addl %edx,%ecx
768 adcl $0,%eax
769 decl %ebp
770 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700771 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800772 # Tail Round 5
773 movl 20(%esi),%ecx
774 movl 20(%edi),%edx
775 addl %eax,%ecx
776 movl $0,%eax
777 adcl %eax,%eax
778 addl %edx,%ecx
779 adcl $0,%eax
780 decl %ebp
781 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700782 jz L025aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800783 # Tail Round 6
784 movl 24(%esi),%ecx
785 movl 24(%edi),%edx
786 addl %eax,%ecx
787 movl $0,%eax
788 adcl %eax,%eax
789 addl %edx,%ecx
790 adcl $0,%eax
791 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700792L025aw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800793 popl %edi
794 popl %esi
795 popl %ebx
796 popl %ebp
797 ret
798.globl _bn_sub_words
799.private_extern _bn_sub_words
800.align 4
801_bn_sub_words:
802L_bn_sub_words_begin:
803 pushl %ebp
804 pushl %ebx
805 pushl %esi
806 pushl %edi
807
808 movl 20(%esp),%ebx
809 movl 24(%esp),%esi
810 movl 28(%esp),%edi
811 movl 32(%esp),%ebp
812 xorl %eax,%eax
813 andl $4294967288,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700814 jz L026aw_finish
815L027aw_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800816 # Round 0
817 movl (%esi),%ecx
818 movl (%edi),%edx
819 subl %eax,%ecx
820 movl $0,%eax
821 adcl %eax,%eax
822 subl %edx,%ecx
823 adcl $0,%eax
824 movl %ecx,(%ebx)
825 # Round 1
826 movl 4(%esi),%ecx
827 movl 4(%edi),%edx
828 subl %eax,%ecx
829 movl $0,%eax
830 adcl %eax,%eax
831 subl %edx,%ecx
832 adcl $0,%eax
833 movl %ecx,4(%ebx)
834 # Round 2
835 movl 8(%esi),%ecx
836 movl 8(%edi),%edx
837 subl %eax,%ecx
838 movl $0,%eax
839 adcl %eax,%eax
840 subl %edx,%ecx
841 adcl $0,%eax
842 movl %ecx,8(%ebx)
843 # Round 3
844 movl 12(%esi),%ecx
845 movl 12(%edi),%edx
846 subl %eax,%ecx
847 movl $0,%eax
848 adcl %eax,%eax
849 subl %edx,%ecx
850 adcl $0,%eax
851 movl %ecx,12(%ebx)
852 # Round 4
853 movl 16(%esi),%ecx
854 movl 16(%edi),%edx
855 subl %eax,%ecx
856 movl $0,%eax
857 adcl %eax,%eax
858 subl %edx,%ecx
859 adcl $0,%eax
860 movl %ecx,16(%ebx)
861 # Round 5
862 movl 20(%esi),%ecx
863 movl 20(%edi),%edx
864 subl %eax,%ecx
865 movl $0,%eax
866 adcl %eax,%eax
867 subl %edx,%ecx
868 adcl $0,%eax
869 movl %ecx,20(%ebx)
870 # Round 6
871 movl 24(%esi),%ecx
872 movl 24(%edi),%edx
873 subl %eax,%ecx
874 movl $0,%eax
875 adcl %eax,%eax
876 subl %edx,%ecx
877 adcl $0,%eax
878 movl %ecx,24(%ebx)
879 # Round 7
880 movl 28(%esi),%ecx
881 movl 28(%edi),%edx
882 subl %eax,%ecx
883 movl $0,%eax
884 adcl %eax,%eax
885 subl %edx,%ecx
886 adcl $0,%eax
887 movl %ecx,28(%ebx)
888
889 addl $32,%esi
890 addl $32,%edi
891 addl $32,%ebx
892 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700893 jnz L027aw_loop
894L026aw_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800895 movl 32(%esp),%ebp
896 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700897 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800898 # Tail Round 0
899 movl (%esi),%ecx
900 movl (%edi),%edx
901 subl %eax,%ecx
902 movl $0,%eax
903 adcl %eax,%eax
904 subl %edx,%ecx
905 adcl $0,%eax
906 decl %ebp
907 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700908 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800909 # Tail Round 1
910 movl 4(%esi),%ecx
911 movl 4(%edi),%edx
912 subl %eax,%ecx
913 movl $0,%eax
914 adcl %eax,%eax
915 subl %edx,%ecx
916 adcl $0,%eax
917 decl %ebp
918 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700919 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800920 # Tail Round 2
921 movl 8(%esi),%ecx
922 movl 8(%edi),%edx
923 subl %eax,%ecx
924 movl $0,%eax
925 adcl %eax,%eax
926 subl %edx,%ecx
927 adcl $0,%eax
928 decl %ebp
929 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700930 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800931 # Tail Round 3
932 movl 12(%esi),%ecx
933 movl 12(%edi),%edx
934 subl %eax,%ecx
935 movl $0,%eax
936 adcl %eax,%eax
937 subl %edx,%ecx
938 adcl $0,%eax
939 decl %ebp
940 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700941 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800942 # Tail Round 4
943 movl 16(%esi),%ecx
944 movl 16(%edi),%edx
945 subl %eax,%ecx
946 movl $0,%eax
947 adcl %eax,%eax
948 subl %edx,%ecx
949 adcl $0,%eax
950 decl %ebp
951 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700952 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800953 # Tail Round 5
954 movl 20(%esi),%ecx
955 movl 20(%edi),%edx
956 subl %eax,%ecx
957 movl $0,%eax
958 adcl %eax,%eax
959 subl %edx,%ecx
960 adcl $0,%eax
961 decl %ebp
962 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700963 jz L028aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -0800964 # Tail Round 6
965 movl 24(%esi),%ecx
966 movl 24(%edi),%edx
967 subl %eax,%ecx
968 movl $0,%eax
969 adcl %eax,%eax
970 subl %edx,%ecx
971 adcl $0,%eax
972 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -0700973L028aw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800974 popl %edi
975 popl %esi
976 popl %ebx
977 popl %ebp
978 ret
979.globl _bn_sub_part_words
980.private_extern _bn_sub_part_words
981.align 4
982_bn_sub_part_words:
983L_bn_sub_part_words_begin:
984 pushl %ebp
985 pushl %ebx
986 pushl %esi
987 pushl %edi
988
989 movl 20(%esp),%ebx
990 movl 24(%esp),%esi
991 movl 28(%esp),%edi
992 movl 32(%esp),%ebp
993 xorl %eax,%eax
994 andl $4294967288,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -0700995 jz L029aw_finish
996L030aw_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -0800997 # Round 0
998 movl (%esi),%ecx
999 movl (%edi),%edx
1000 subl %eax,%ecx
1001 movl $0,%eax
1002 adcl %eax,%eax
1003 subl %edx,%ecx
1004 adcl $0,%eax
1005 movl %ecx,(%ebx)
1006 # Round 1
1007 movl 4(%esi),%ecx
1008 movl 4(%edi),%edx
1009 subl %eax,%ecx
1010 movl $0,%eax
1011 adcl %eax,%eax
1012 subl %edx,%ecx
1013 adcl $0,%eax
1014 movl %ecx,4(%ebx)
1015 # Round 2
1016 movl 8(%esi),%ecx
1017 movl 8(%edi),%edx
1018 subl %eax,%ecx
1019 movl $0,%eax
1020 adcl %eax,%eax
1021 subl %edx,%ecx
1022 adcl $0,%eax
1023 movl %ecx,8(%ebx)
1024 # Round 3
1025 movl 12(%esi),%ecx
1026 movl 12(%edi),%edx
1027 subl %eax,%ecx
1028 movl $0,%eax
1029 adcl %eax,%eax
1030 subl %edx,%ecx
1031 adcl $0,%eax
1032 movl %ecx,12(%ebx)
1033 # Round 4
1034 movl 16(%esi),%ecx
1035 movl 16(%edi),%edx
1036 subl %eax,%ecx
1037 movl $0,%eax
1038 adcl %eax,%eax
1039 subl %edx,%ecx
1040 adcl $0,%eax
1041 movl %ecx,16(%ebx)
1042 # Round 5
1043 movl 20(%esi),%ecx
1044 movl 20(%edi),%edx
1045 subl %eax,%ecx
1046 movl $0,%eax
1047 adcl %eax,%eax
1048 subl %edx,%ecx
1049 adcl $0,%eax
1050 movl %ecx,20(%ebx)
1051 # Round 6
1052 movl 24(%esi),%ecx
1053 movl 24(%edi),%edx
1054 subl %eax,%ecx
1055 movl $0,%eax
1056 adcl %eax,%eax
1057 subl %edx,%ecx
1058 adcl $0,%eax
1059 movl %ecx,24(%ebx)
1060 # Round 7
1061 movl 28(%esi),%ecx
1062 movl 28(%edi),%edx
1063 subl %eax,%ecx
1064 movl $0,%eax
1065 adcl %eax,%eax
1066 subl %edx,%ecx
1067 adcl $0,%eax
1068 movl %ecx,28(%ebx)
1069
1070 addl $32,%esi
1071 addl $32,%edi
1072 addl $32,%ebx
1073 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001074 jnz L030aw_loop
1075L029aw_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001076 movl 32(%esp),%ebp
1077 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001078 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001079 # Tail Round 0
1080 movl (%esi),%ecx
1081 movl (%edi),%edx
1082 subl %eax,%ecx
1083 movl $0,%eax
1084 adcl %eax,%eax
1085 subl %edx,%ecx
1086 adcl $0,%eax
1087 movl %ecx,(%ebx)
1088 addl $4,%esi
1089 addl $4,%edi
1090 addl $4,%ebx
1091 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001092 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001093 # Tail Round 1
1094 movl (%esi),%ecx
1095 movl (%edi),%edx
1096 subl %eax,%ecx
1097 movl $0,%eax
1098 adcl %eax,%eax
1099 subl %edx,%ecx
1100 adcl $0,%eax
1101 movl %ecx,(%ebx)
1102 addl $4,%esi
1103 addl $4,%edi
1104 addl $4,%ebx
1105 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001106 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001107 # Tail Round 2
1108 movl (%esi),%ecx
1109 movl (%edi),%edx
1110 subl %eax,%ecx
1111 movl $0,%eax
1112 adcl %eax,%eax
1113 subl %edx,%ecx
1114 adcl $0,%eax
1115 movl %ecx,(%ebx)
1116 addl $4,%esi
1117 addl $4,%edi
1118 addl $4,%ebx
1119 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001120 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001121 # Tail Round 3
1122 movl (%esi),%ecx
1123 movl (%edi),%edx
1124 subl %eax,%ecx
1125 movl $0,%eax
1126 adcl %eax,%eax
1127 subl %edx,%ecx
1128 adcl $0,%eax
1129 movl %ecx,(%ebx)
1130 addl $4,%esi
1131 addl $4,%edi
1132 addl $4,%ebx
1133 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001134 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001135 # Tail Round 4
1136 movl (%esi),%ecx
1137 movl (%edi),%edx
1138 subl %eax,%ecx
1139 movl $0,%eax
1140 adcl %eax,%eax
1141 subl %edx,%ecx
1142 adcl $0,%eax
1143 movl %ecx,(%ebx)
1144 addl $4,%esi
1145 addl $4,%edi
1146 addl $4,%ebx
1147 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001148 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001149 # Tail Round 5
1150 movl (%esi),%ecx
1151 movl (%edi),%edx
1152 subl %eax,%ecx
1153 movl $0,%eax
1154 adcl %eax,%eax
1155 subl %edx,%ecx
1156 adcl $0,%eax
1157 movl %ecx,(%ebx)
1158 addl $4,%esi
1159 addl $4,%edi
1160 addl $4,%ebx
1161 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001162 jz L031aw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001163 # Tail Round 6
1164 movl (%esi),%ecx
1165 movl (%edi),%edx
1166 subl %eax,%ecx
1167 movl $0,%eax
1168 adcl %eax,%eax
1169 subl %edx,%ecx
1170 adcl $0,%eax
1171 movl %ecx,(%ebx)
1172 addl $4,%esi
1173 addl $4,%edi
1174 addl $4,%ebx
Adam Langleye9ada862015-05-11 17:20:37 -07001175L031aw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001176 cmpl $0,36(%esp)
Adam Langleye9ada862015-05-11 17:20:37 -07001177 je L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001178 movl 36(%esp),%ebp
1179 cmpl $0,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001180 je L032pw_end
1181 jge L033pw_pos
Adam Langleyd9e397b2015-01-22 14:27:53 -08001182 # pw_neg
1183 movl $0,%edx
1184 subl %ebp,%edx
1185 movl %edx,%ebp
1186 andl $4294967288,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001187 jz L034pw_neg_finish
1188L035pw_neg_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001189 # dl<0 Round 0
1190 movl $0,%ecx
1191 movl (%edi),%edx
1192 subl %eax,%ecx
1193 movl $0,%eax
1194 adcl %eax,%eax
1195 subl %edx,%ecx
1196 adcl $0,%eax
1197 movl %ecx,(%ebx)
1198 # dl<0 Round 1
1199 movl $0,%ecx
1200 movl 4(%edi),%edx
1201 subl %eax,%ecx
1202 movl $0,%eax
1203 adcl %eax,%eax
1204 subl %edx,%ecx
1205 adcl $0,%eax
1206 movl %ecx,4(%ebx)
1207 # dl<0 Round 2
1208 movl $0,%ecx
1209 movl 8(%edi),%edx
1210 subl %eax,%ecx
1211 movl $0,%eax
1212 adcl %eax,%eax
1213 subl %edx,%ecx
1214 adcl $0,%eax
1215 movl %ecx,8(%ebx)
1216 # dl<0 Round 3
1217 movl $0,%ecx
1218 movl 12(%edi),%edx
1219 subl %eax,%ecx
1220 movl $0,%eax
1221 adcl %eax,%eax
1222 subl %edx,%ecx
1223 adcl $0,%eax
1224 movl %ecx,12(%ebx)
1225 # dl<0 Round 4
1226 movl $0,%ecx
1227 movl 16(%edi),%edx
1228 subl %eax,%ecx
1229 movl $0,%eax
1230 adcl %eax,%eax
1231 subl %edx,%ecx
1232 adcl $0,%eax
1233 movl %ecx,16(%ebx)
1234 # dl<0 Round 5
1235 movl $0,%ecx
1236 movl 20(%edi),%edx
1237 subl %eax,%ecx
1238 movl $0,%eax
1239 adcl %eax,%eax
1240 subl %edx,%ecx
1241 adcl $0,%eax
1242 movl %ecx,20(%ebx)
1243 # dl<0 Round 6
1244 movl $0,%ecx
1245 movl 24(%edi),%edx
1246 subl %eax,%ecx
1247 movl $0,%eax
1248 adcl %eax,%eax
1249 subl %edx,%ecx
1250 adcl $0,%eax
1251 movl %ecx,24(%ebx)
1252 # dl<0 Round 7
1253 movl $0,%ecx
1254 movl 28(%edi),%edx
1255 subl %eax,%ecx
1256 movl $0,%eax
1257 adcl %eax,%eax
1258 subl %edx,%ecx
1259 adcl $0,%eax
1260 movl %ecx,28(%ebx)
1261
1262 addl $32,%edi
1263 addl $32,%ebx
1264 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001265 jnz L035pw_neg_loop
1266L034pw_neg_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001267 movl 36(%esp),%edx
1268 movl $0,%ebp
1269 subl %edx,%ebp
1270 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001271 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001272 # dl<0 Tail Round 0
1273 movl $0,%ecx
1274 movl (%edi),%edx
1275 subl %eax,%ecx
1276 movl $0,%eax
1277 adcl %eax,%eax
1278 subl %edx,%ecx
1279 adcl $0,%eax
1280 decl %ebp
1281 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001282 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001283 # dl<0 Tail Round 1
1284 movl $0,%ecx
1285 movl 4(%edi),%edx
1286 subl %eax,%ecx
1287 movl $0,%eax
1288 adcl %eax,%eax
1289 subl %edx,%ecx
1290 adcl $0,%eax
1291 decl %ebp
1292 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001293 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001294 # dl<0 Tail Round 2
1295 movl $0,%ecx
1296 movl 8(%edi),%edx
1297 subl %eax,%ecx
1298 movl $0,%eax
1299 adcl %eax,%eax
1300 subl %edx,%ecx
1301 adcl $0,%eax
1302 decl %ebp
1303 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001304 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001305 # dl<0 Tail Round 3
1306 movl $0,%ecx
1307 movl 12(%edi),%edx
1308 subl %eax,%ecx
1309 movl $0,%eax
1310 adcl %eax,%eax
1311 subl %edx,%ecx
1312 adcl $0,%eax
1313 decl %ebp
1314 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001315 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001316 # dl<0 Tail Round 4
1317 movl $0,%ecx
1318 movl 16(%edi),%edx
1319 subl %eax,%ecx
1320 movl $0,%eax
1321 adcl %eax,%eax
1322 subl %edx,%ecx
1323 adcl $0,%eax
1324 decl %ebp
1325 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001326 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001327 # dl<0 Tail Round 5
1328 movl $0,%ecx
1329 movl 20(%edi),%edx
1330 subl %eax,%ecx
1331 movl $0,%eax
1332 adcl %eax,%eax
1333 subl %edx,%ecx
1334 adcl $0,%eax
1335 decl %ebp
1336 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001337 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001338 # dl<0 Tail Round 6
1339 movl $0,%ecx
1340 movl 24(%edi),%edx
1341 subl %eax,%ecx
1342 movl $0,%eax
1343 adcl %eax,%eax
1344 subl %edx,%ecx
1345 adcl $0,%eax
1346 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001347 jmp L032pw_end
1348L033pw_pos:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001349 andl $4294967288,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001350 jz L036pw_pos_finish
1351L037pw_pos_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001352 # dl>0 Round 0
1353 movl (%esi),%ecx
1354 subl %eax,%ecx
1355 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001356 jnc L038pw_nc0
Adam Langleyd9e397b2015-01-22 14:27:53 -08001357 # dl>0 Round 1
1358 movl 4(%esi),%ecx
1359 subl %eax,%ecx
1360 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001361 jnc L039pw_nc1
Adam Langleyd9e397b2015-01-22 14:27:53 -08001362 # dl>0 Round 2
1363 movl 8(%esi),%ecx
1364 subl %eax,%ecx
1365 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001366 jnc L040pw_nc2
Adam Langleyd9e397b2015-01-22 14:27:53 -08001367 # dl>0 Round 3
1368 movl 12(%esi),%ecx
1369 subl %eax,%ecx
1370 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001371 jnc L041pw_nc3
Adam Langleyd9e397b2015-01-22 14:27:53 -08001372 # dl>0 Round 4
1373 movl 16(%esi),%ecx
1374 subl %eax,%ecx
1375 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001376 jnc L042pw_nc4
Adam Langleyd9e397b2015-01-22 14:27:53 -08001377 # dl>0 Round 5
1378 movl 20(%esi),%ecx
1379 subl %eax,%ecx
1380 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001381 jnc L043pw_nc5
Adam Langleyd9e397b2015-01-22 14:27:53 -08001382 # dl>0 Round 6
1383 movl 24(%esi),%ecx
1384 subl %eax,%ecx
1385 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001386 jnc L044pw_nc6
Adam Langleyd9e397b2015-01-22 14:27:53 -08001387 # dl>0 Round 7
1388 movl 28(%esi),%ecx
1389 subl %eax,%ecx
1390 movl %ecx,28(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001391 jnc L045pw_nc7
Adam Langleyd9e397b2015-01-22 14:27:53 -08001392
1393 addl $32,%esi
1394 addl $32,%ebx
1395 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001396 jnz L037pw_pos_loop
1397L036pw_pos_finish:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001398 movl 36(%esp),%ebp
1399 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001400 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001401 # dl>0 Tail Round 0
1402 movl (%esi),%ecx
1403 subl %eax,%ecx
1404 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001405 jnc L046pw_tail_nc0
Adam Langleyd9e397b2015-01-22 14:27:53 -08001406 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001407 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001408 # dl>0 Tail Round 1
1409 movl 4(%esi),%ecx
1410 subl %eax,%ecx
1411 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001412 jnc L047pw_tail_nc1
Adam Langleyd9e397b2015-01-22 14:27:53 -08001413 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001414 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001415 # dl>0 Tail Round 2
1416 movl 8(%esi),%ecx
1417 subl %eax,%ecx
1418 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001419 jnc L048pw_tail_nc2
Adam Langleyd9e397b2015-01-22 14:27:53 -08001420 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001421 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001422 # dl>0 Tail Round 3
1423 movl 12(%esi),%ecx
1424 subl %eax,%ecx
1425 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001426 jnc L049pw_tail_nc3
Adam Langleyd9e397b2015-01-22 14:27:53 -08001427 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001428 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001429 # dl>0 Tail Round 4
1430 movl 16(%esi),%ecx
1431 subl %eax,%ecx
1432 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001433 jnc L050pw_tail_nc4
Adam Langleyd9e397b2015-01-22 14:27:53 -08001434 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001435 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001436 # dl>0 Tail Round 5
1437 movl 20(%esi),%ecx
1438 subl %eax,%ecx
1439 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001440 jnc L051pw_tail_nc5
Adam Langleyd9e397b2015-01-22 14:27:53 -08001441 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001442 jz L032pw_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001443 # dl>0 Tail Round 6
1444 movl 24(%esi),%ecx
1445 subl %eax,%ecx
1446 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001447 jnc L052pw_tail_nc6
Adam Langleyd9e397b2015-01-22 14:27:53 -08001448 movl $1,%eax
Adam Langleye9ada862015-05-11 17:20:37 -07001449 jmp L032pw_end
1450L053pw_nc_loop:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001451 movl (%esi),%ecx
1452 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001453L038pw_nc0:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001454 movl 4(%esi),%ecx
1455 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001456L039pw_nc1:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001457 movl 8(%esi),%ecx
1458 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001459L040pw_nc2:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001460 movl 12(%esi),%ecx
1461 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001462L041pw_nc3:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001463 movl 16(%esi),%ecx
1464 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001465L042pw_nc4:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001466 movl 20(%esi),%ecx
1467 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001468L043pw_nc5:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001469 movl 24(%esi),%ecx
1470 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001471L044pw_nc6:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001472 movl 28(%esi),%ecx
1473 movl %ecx,28(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001474L045pw_nc7:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001475
1476 addl $32,%esi
1477 addl $32,%ebx
1478 subl $8,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001479 jnz L053pw_nc_loop
Adam Langleyd9e397b2015-01-22 14:27:53 -08001480 movl 36(%esp),%ebp
1481 andl $7,%ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001482 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001483 movl (%esi),%ecx
1484 movl %ecx,(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001485L046pw_tail_nc0:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001486 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001487 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001488 movl 4(%esi),%ecx
1489 movl %ecx,4(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001490L047pw_tail_nc1:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001491 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001492 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001493 movl 8(%esi),%ecx
1494 movl %ecx,8(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001495L048pw_tail_nc2:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001496 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001497 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001498 movl 12(%esi),%ecx
1499 movl %ecx,12(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001500L049pw_tail_nc3:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001501 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001502 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001503 movl 16(%esi),%ecx
1504 movl %ecx,16(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001505L050pw_tail_nc4:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001506 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001507 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001508 movl 20(%esi),%ecx
1509 movl %ecx,20(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001510L051pw_tail_nc5:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001511 decl %ebp
Adam Langleye9ada862015-05-11 17:20:37 -07001512 jz L054pw_nc_end
Adam Langleyd9e397b2015-01-22 14:27:53 -08001513 movl 24(%esi),%ecx
1514 movl %ecx,24(%ebx)
Adam Langleye9ada862015-05-11 17:20:37 -07001515L052pw_tail_nc6:
1516L054pw_nc_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001517 movl $0,%eax
Adam Langleye9ada862015-05-11 17:20:37 -07001518L032pw_end:
Adam Langleyd9e397b2015-01-22 14:27:53 -08001519 popl %edi
1520 popl %esi
1521 popl %ebx
1522 popl %ebp
1523 ret
Adam Langleye9ada862015-05-11 17:20:37 -07001524.section __IMPORT,__pointers,non_lazy_symbol_pointers
1525L_OPENSSL_ia32cap_P$non_lazy_ptr:
1526.indirect_symbol _OPENSSL_ia32cap_P
1527.long 0
Adam Langleyd9e397b2015-01-22 14:27:53 -08001528#endif