]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - secure/lib/libcrypto/i386/bn-586.s
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / secure / lib / libcrypto / i386 / bn-586.s
1         # $FreeBSD$
2 .file   "bn-586.s"
3 .text
4 .globl  bn_mul_add_words
5 .type   bn_mul_add_words,@function
6 .align  16
7 bn_mul_add_words:
8 .L_bn_mul_add_words_begin:
9         leal    OPENSSL_ia32cap_P,%eax
10         btl     $26,(%eax)
11         jnc     .L000maw_non_sse2
12         movl    4(%esp),%eax
13         movl    8(%esp),%edx
14         movl    12(%esp),%ecx
15         movd    16(%esp),%mm0
16         pxor    %mm1,%mm1
17         jmp     .L001maw_sse2_entry
18 .align  16
19 .L002maw_sse2_unrolled:
20         movd    (%eax),%mm3
21         paddq   %mm3,%mm1
22         movd    (%edx),%mm2
23         pmuludq %mm0,%mm2
24         movd    4(%edx),%mm4
25         pmuludq %mm0,%mm4
26         movd    8(%edx),%mm6
27         pmuludq %mm0,%mm6
28         movd    12(%edx),%mm7
29         pmuludq %mm0,%mm7
30         paddq   %mm2,%mm1
31         movd    4(%eax),%mm3
32         paddq   %mm4,%mm3
33         movd    8(%eax),%mm5
34         paddq   %mm6,%mm5
35         movd    12(%eax),%mm4
36         paddq   %mm4,%mm7
37         movd    %mm1,(%eax)
38         movd    16(%edx),%mm2
39         pmuludq %mm0,%mm2
40         psrlq   $32,%mm1
41         movd    20(%edx),%mm4
42         pmuludq %mm0,%mm4
43         paddq   %mm3,%mm1
44         movd    24(%edx),%mm6
45         pmuludq %mm0,%mm6
46         movd    %mm1,4(%eax)
47         psrlq   $32,%mm1
48         movd    28(%edx),%mm3
49         addl    $32,%edx
50         pmuludq %mm0,%mm3
51         paddq   %mm5,%mm1
52         movd    16(%eax),%mm5
53         paddq   %mm5,%mm2
54         movd    %mm1,8(%eax)
55         psrlq   $32,%mm1
56         paddq   %mm7,%mm1
57         movd    20(%eax),%mm5
58         paddq   %mm5,%mm4
59         movd    %mm1,12(%eax)
60         psrlq   $32,%mm1
61         paddq   %mm2,%mm1
62         movd    24(%eax),%mm5
63         paddq   %mm5,%mm6
64         movd    %mm1,16(%eax)
65         psrlq   $32,%mm1
66         paddq   %mm4,%mm1
67         movd    28(%eax),%mm5
68         paddq   %mm5,%mm3
69         movd    %mm1,20(%eax)
70         psrlq   $32,%mm1
71         paddq   %mm6,%mm1
72         movd    %mm1,24(%eax)
73         psrlq   $32,%mm1
74         paddq   %mm3,%mm1
75         movd    %mm1,28(%eax)
76         leal    32(%eax),%eax
77         psrlq   $32,%mm1
78         subl    $8,%ecx
79         jz      .L003maw_sse2_exit
80 .L001maw_sse2_entry:
81         testl   $4294967288,%ecx
82         jnz     .L002maw_sse2_unrolled
83 .align  4
84 .L004maw_sse2_loop:
85         movd    (%edx),%mm2
86         movd    (%eax),%mm3
87         pmuludq %mm0,%mm2
88         leal    4(%edx),%edx
89         paddq   %mm3,%mm1
90         paddq   %mm2,%mm1
91         movd    %mm1,(%eax)
92         subl    $1,%ecx
93         psrlq   $32,%mm1
94         leal    4(%eax),%eax
95         jnz     .L004maw_sse2_loop
96 .L003maw_sse2_exit:
97         movd    %mm1,%eax
98         emms
99         ret
100 .align  16
101 .L000maw_non_sse2:
102         pushl   %ebp
103         pushl   %ebx
104         pushl   %esi
105         pushl   %edi
106
107         xorl    %esi,%esi
108         movl    20(%esp),%edi
109         movl    28(%esp),%ecx
110         movl    24(%esp),%ebx
111         andl    $4294967288,%ecx
112         movl    32(%esp),%ebp
113         pushl   %ecx
114         jz      .L005maw_finish
115 .align  16
116 .L006maw_loop:
117
118         movl    (%ebx),%eax
119         mull    %ebp
120         addl    %esi,%eax
121         adcl    $0,%edx
122         addl    (%edi),%eax
123         adcl    $0,%edx
124         movl    %eax,(%edi)
125         movl    %edx,%esi
126
127         movl    4(%ebx),%eax
128         mull    %ebp
129         addl    %esi,%eax
130         adcl    $0,%edx
131         addl    4(%edi),%eax
132         adcl    $0,%edx
133         movl    %eax,4(%edi)
134         movl    %edx,%esi
135
136         movl    8(%ebx),%eax
137         mull    %ebp
138         addl    %esi,%eax
139         adcl    $0,%edx
140         addl    8(%edi),%eax
141         adcl    $0,%edx
142         movl    %eax,8(%edi)
143         movl    %edx,%esi
144
145         movl    12(%ebx),%eax
146         mull    %ebp
147         addl    %esi,%eax
148         adcl    $0,%edx
149         addl    12(%edi),%eax
150         adcl    $0,%edx
151         movl    %eax,12(%edi)
152         movl    %edx,%esi
153
154         movl    16(%ebx),%eax
155         mull    %ebp
156         addl    %esi,%eax
157         adcl    $0,%edx
158         addl    16(%edi),%eax
159         adcl    $0,%edx
160         movl    %eax,16(%edi)
161         movl    %edx,%esi
162
163         movl    20(%ebx),%eax
164         mull    %ebp
165         addl    %esi,%eax
166         adcl    $0,%edx
167         addl    20(%edi),%eax
168         adcl    $0,%edx
169         movl    %eax,20(%edi)
170         movl    %edx,%esi
171
172         movl    24(%ebx),%eax
173         mull    %ebp
174         addl    %esi,%eax
175         adcl    $0,%edx
176         addl    24(%edi),%eax
177         adcl    $0,%edx
178         movl    %eax,24(%edi)
179         movl    %edx,%esi
180
181         movl    28(%ebx),%eax
182         mull    %ebp
183         addl    %esi,%eax
184         adcl    $0,%edx
185         addl    28(%edi),%eax
186         adcl    $0,%edx
187         movl    %eax,28(%edi)
188         movl    %edx,%esi
189
190         subl    $8,%ecx
191         leal    32(%ebx),%ebx
192         leal    32(%edi),%edi
193         jnz     .L006maw_loop
194 .L005maw_finish:
195         movl    32(%esp),%ecx
196         andl    $7,%ecx
197         jnz     .L007maw_finish2
198         jmp     .L008maw_end
199 .L007maw_finish2:
200
201         movl    (%ebx),%eax
202         mull    %ebp
203         addl    %esi,%eax
204         adcl    $0,%edx
205         addl    (%edi),%eax
206         adcl    $0,%edx
207         decl    %ecx
208         movl    %eax,(%edi)
209         movl    %edx,%esi
210         jz      .L008maw_end
211
212         movl    4(%ebx),%eax
213         mull    %ebp
214         addl    %esi,%eax
215         adcl    $0,%edx
216         addl    4(%edi),%eax
217         adcl    $0,%edx
218         decl    %ecx
219         movl    %eax,4(%edi)
220         movl    %edx,%esi
221         jz      .L008maw_end
222
223         movl    8(%ebx),%eax
224         mull    %ebp
225         addl    %esi,%eax
226         adcl    $0,%edx
227         addl    8(%edi),%eax
228         adcl    $0,%edx
229         decl    %ecx
230         movl    %eax,8(%edi)
231         movl    %edx,%esi
232         jz      .L008maw_end
233
234         movl    12(%ebx),%eax
235         mull    %ebp
236         addl    %esi,%eax
237         adcl    $0,%edx
238         addl    12(%edi),%eax
239         adcl    $0,%edx
240         decl    %ecx
241         movl    %eax,12(%edi)
242         movl    %edx,%esi
243         jz      .L008maw_end
244
245         movl    16(%ebx),%eax
246         mull    %ebp
247         addl    %esi,%eax
248         adcl    $0,%edx
249         addl    16(%edi),%eax
250         adcl    $0,%edx
251         decl    %ecx
252         movl    %eax,16(%edi)
253         movl    %edx,%esi
254         jz      .L008maw_end
255
256         movl    20(%ebx),%eax
257         mull    %ebp
258         addl    %esi,%eax
259         adcl    $0,%edx
260         addl    20(%edi),%eax
261         adcl    $0,%edx
262         decl    %ecx
263         movl    %eax,20(%edi)
264         movl    %edx,%esi
265         jz      .L008maw_end
266
267         movl    24(%ebx),%eax
268         mull    %ebp
269         addl    %esi,%eax
270         adcl    $0,%edx
271         addl    24(%edi),%eax
272         adcl    $0,%edx
273         movl    %eax,24(%edi)
274         movl    %edx,%esi
275 .L008maw_end:
276         movl    %esi,%eax
277         popl    %ecx
278         popl    %edi
279         popl    %esi
280         popl    %ebx
281         popl    %ebp
282         ret
283 .size   bn_mul_add_words,.-.L_bn_mul_add_words_begin
284 .globl  bn_mul_words
285 .type   bn_mul_words,@function
286 .align  16
287 bn_mul_words:
288 .L_bn_mul_words_begin:
289         leal    OPENSSL_ia32cap_P,%eax
290         btl     $26,(%eax)
291         jnc     .L009mw_non_sse2
292         movl    4(%esp),%eax
293         movl    8(%esp),%edx
294         movl    12(%esp),%ecx
295         movd    16(%esp),%mm0
296         pxor    %mm1,%mm1
297 .align  16
298 .L010mw_sse2_loop:
299         movd    (%edx),%mm2
300         pmuludq %mm0,%mm2
301         leal    4(%edx),%edx
302         paddq   %mm2,%mm1
303         movd    %mm1,(%eax)
304         subl    $1,%ecx
305         psrlq   $32,%mm1
306         leal    4(%eax),%eax
307         jnz     .L010mw_sse2_loop
308         movd    %mm1,%eax
309         emms
310         ret
311 .align  16
312 .L009mw_non_sse2:
313         pushl   %ebp
314         pushl   %ebx
315         pushl   %esi
316         pushl   %edi
317
318         xorl    %esi,%esi
319         movl    20(%esp),%edi
320         movl    24(%esp),%ebx
321         movl    28(%esp),%ebp
322         movl    32(%esp),%ecx
323         andl    $4294967288,%ebp
324         jz      .L011mw_finish
325 .L012mw_loop:
326
327         movl    (%ebx),%eax
328         mull    %ecx
329         addl    %esi,%eax
330         adcl    $0,%edx
331         movl    %eax,(%edi)
332         movl    %edx,%esi
333
334         movl    4(%ebx),%eax
335         mull    %ecx
336         addl    %esi,%eax
337         adcl    $0,%edx
338         movl    %eax,4(%edi)
339         movl    %edx,%esi
340
341         movl    8(%ebx),%eax
342         mull    %ecx
343         addl    %esi,%eax
344         adcl    $0,%edx
345         movl    %eax,8(%edi)
346         movl    %edx,%esi
347
348         movl    12(%ebx),%eax
349         mull    %ecx
350         addl    %esi,%eax
351         adcl    $0,%edx
352         movl    %eax,12(%edi)
353         movl    %edx,%esi
354
355         movl    16(%ebx),%eax
356         mull    %ecx
357         addl    %esi,%eax
358         adcl    $0,%edx
359         movl    %eax,16(%edi)
360         movl    %edx,%esi
361
362         movl    20(%ebx),%eax
363         mull    %ecx
364         addl    %esi,%eax
365         adcl    $0,%edx
366         movl    %eax,20(%edi)
367         movl    %edx,%esi
368
369         movl    24(%ebx),%eax
370         mull    %ecx
371         addl    %esi,%eax
372         adcl    $0,%edx
373         movl    %eax,24(%edi)
374         movl    %edx,%esi
375
376         movl    28(%ebx),%eax
377         mull    %ecx
378         addl    %esi,%eax
379         adcl    $0,%edx
380         movl    %eax,28(%edi)
381         movl    %edx,%esi
382
383         addl    $32,%ebx
384         addl    $32,%edi
385         subl    $8,%ebp
386         jz      .L011mw_finish
387         jmp     .L012mw_loop
388 .L011mw_finish:
389         movl    28(%esp),%ebp
390         andl    $7,%ebp
391         jnz     .L013mw_finish2
392         jmp     .L014mw_end
393 .L013mw_finish2:
394
395         movl    (%ebx),%eax
396         mull    %ecx
397         addl    %esi,%eax
398         adcl    $0,%edx
399         movl    %eax,(%edi)
400         movl    %edx,%esi
401         decl    %ebp
402         jz      .L014mw_end
403
404         movl    4(%ebx),%eax
405         mull    %ecx
406         addl    %esi,%eax
407         adcl    $0,%edx
408         movl    %eax,4(%edi)
409         movl    %edx,%esi
410         decl    %ebp
411         jz      .L014mw_end
412
413         movl    8(%ebx),%eax
414         mull    %ecx
415         addl    %esi,%eax
416         adcl    $0,%edx
417         movl    %eax,8(%edi)
418         movl    %edx,%esi
419         decl    %ebp
420         jz      .L014mw_end
421
422         movl    12(%ebx),%eax
423         mull    %ecx
424         addl    %esi,%eax
425         adcl    $0,%edx
426         movl    %eax,12(%edi)
427         movl    %edx,%esi
428         decl    %ebp
429         jz      .L014mw_end
430
431         movl    16(%ebx),%eax
432         mull    %ecx
433         addl    %esi,%eax
434         adcl    $0,%edx
435         movl    %eax,16(%edi)
436         movl    %edx,%esi
437         decl    %ebp
438         jz      .L014mw_end
439
440         movl    20(%ebx),%eax
441         mull    %ecx
442         addl    %esi,%eax
443         adcl    $0,%edx
444         movl    %eax,20(%edi)
445         movl    %edx,%esi
446         decl    %ebp
447         jz      .L014mw_end
448
449         movl    24(%ebx),%eax
450         mull    %ecx
451         addl    %esi,%eax
452         adcl    $0,%edx
453         movl    %eax,24(%edi)
454         movl    %edx,%esi
455 .L014mw_end:
456         movl    %esi,%eax
457         popl    %edi
458         popl    %esi
459         popl    %ebx
460         popl    %ebp
461         ret
462 .size   bn_mul_words,.-.L_bn_mul_words_begin
463 .globl  bn_sqr_words
464 .type   bn_sqr_words,@function
465 .align  16
466 bn_sqr_words:
467 .L_bn_sqr_words_begin:
468         leal    OPENSSL_ia32cap_P,%eax
469         btl     $26,(%eax)
470         jnc     .L015sqr_non_sse2
471         movl    4(%esp),%eax
472         movl    8(%esp),%edx
473         movl    12(%esp),%ecx
474 .align  16
475 .L016sqr_sse2_loop:
476         movd    (%edx),%mm0
477         pmuludq %mm0,%mm0
478         leal    4(%edx),%edx
479         movq    %mm0,(%eax)
480         subl    $1,%ecx
481         leal    8(%eax),%eax
482         jnz     .L016sqr_sse2_loop
483         emms
484         ret
485 .align  16
486 .L015sqr_non_sse2:
487         pushl   %ebp
488         pushl   %ebx
489         pushl   %esi
490         pushl   %edi
491
492         movl    20(%esp),%esi
493         movl    24(%esp),%edi
494         movl    28(%esp),%ebx
495         andl    $4294967288,%ebx
496         jz      .L017sw_finish
497 .L018sw_loop:
498
499         movl    (%edi),%eax
500         mull    %eax
501         movl    %eax,(%esi)
502         movl    %edx,4(%esi)
503
504         movl    4(%edi),%eax
505         mull    %eax
506         movl    %eax,8(%esi)
507         movl    %edx,12(%esi)
508
509         movl    8(%edi),%eax
510         mull    %eax
511         movl    %eax,16(%esi)
512         movl    %edx,20(%esi)
513
514         movl    12(%edi),%eax
515         mull    %eax
516         movl    %eax,24(%esi)
517         movl    %edx,28(%esi)
518
519         movl    16(%edi),%eax
520         mull    %eax
521         movl    %eax,32(%esi)
522         movl    %edx,36(%esi)
523
524         movl    20(%edi),%eax
525         mull    %eax
526         movl    %eax,40(%esi)
527         movl    %edx,44(%esi)
528
529         movl    24(%edi),%eax
530         mull    %eax
531         movl    %eax,48(%esi)
532         movl    %edx,52(%esi)
533
534         movl    28(%edi),%eax
535         mull    %eax
536         movl    %eax,56(%esi)
537         movl    %edx,60(%esi)
538
539         addl    $32,%edi
540         addl    $64,%esi
541         subl    $8,%ebx
542         jnz     .L018sw_loop
543 .L017sw_finish:
544         movl    28(%esp),%ebx
545         andl    $7,%ebx
546         jz      .L019sw_end
547
548         movl    (%edi),%eax
549         mull    %eax
550         movl    %eax,(%esi)
551         decl    %ebx
552         movl    %edx,4(%esi)
553         jz      .L019sw_end
554
555         movl    4(%edi),%eax
556         mull    %eax
557         movl    %eax,8(%esi)
558         decl    %ebx
559         movl    %edx,12(%esi)
560         jz      .L019sw_end
561
562         movl    8(%edi),%eax
563         mull    %eax
564         movl    %eax,16(%esi)
565         decl    %ebx
566         movl    %edx,20(%esi)
567         jz      .L019sw_end
568
569         movl    12(%edi),%eax
570         mull    %eax
571         movl    %eax,24(%esi)
572         decl    %ebx
573         movl    %edx,28(%esi)
574         jz      .L019sw_end
575
576         movl    16(%edi),%eax
577         mull    %eax
578         movl    %eax,32(%esi)
579         decl    %ebx
580         movl    %edx,36(%esi)
581         jz      .L019sw_end
582
583         movl    20(%edi),%eax
584         mull    %eax
585         movl    %eax,40(%esi)
586         decl    %ebx
587         movl    %edx,44(%esi)
588         jz      .L019sw_end
589
590         movl    24(%edi),%eax
591         mull    %eax
592         movl    %eax,48(%esi)
593         movl    %edx,52(%esi)
594 .L019sw_end:
595         popl    %edi
596         popl    %esi
597         popl    %ebx
598         popl    %ebp
599         ret
600 .size   bn_sqr_words,.-.L_bn_sqr_words_begin
601 .globl  bn_div_words
602 .type   bn_div_words,@function
603 .align  16
604 bn_div_words:
605 .L_bn_div_words_begin:
606         movl    4(%esp),%edx
607         movl    8(%esp),%eax
608         movl    12(%esp),%ecx
609         divl    %ecx
610         ret
611 .size   bn_div_words,.-.L_bn_div_words_begin
612 .globl  bn_add_words
613 .type   bn_add_words,@function
614 .align  16
615 bn_add_words:
616 .L_bn_add_words_begin:
617         pushl   %ebp
618         pushl   %ebx
619         pushl   %esi
620         pushl   %edi
621
622         movl    20(%esp),%ebx
623         movl    24(%esp),%esi
624         movl    28(%esp),%edi
625         movl    32(%esp),%ebp
626         xorl    %eax,%eax
627         andl    $4294967288,%ebp
628         jz      .L020aw_finish
629 .L021aw_loop:
630
631         movl    (%esi),%ecx
632         movl    (%edi),%edx
633         addl    %eax,%ecx
634         movl    $0,%eax
635         adcl    %eax,%eax
636         addl    %edx,%ecx
637         adcl    $0,%eax
638         movl    %ecx,(%ebx)
639
640         movl    4(%esi),%ecx
641         movl    4(%edi),%edx
642         addl    %eax,%ecx
643         movl    $0,%eax
644         adcl    %eax,%eax
645         addl    %edx,%ecx
646         adcl    $0,%eax
647         movl    %ecx,4(%ebx)
648
649         movl    8(%esi),%ecx
650         movl    8(%edi),%edx
651         addl    %eax,%ecx
652         movl    $0,%eax
653         adcl    %eax,%eax
654         addl    %edx,%ecx
655         adcl    $0,%eax
656         movl    %ecx,8(%ebx)
657
658         movl    12(%esi),%ecx
659         movl    12(%edi),%edx
660         addl    %eax,%ecx
661         movl    $0,%eax
662         adcl    %eax,%eax
663         addl    %edx,%ecx
664         adcl    $0,%eax
665         movl    %ecx,12(%ebx)
666
667         movl    16(%esi),%ecx
668         movl    16(%edi),%edx
669         addl    %eax,%ecx
670         movl    $0,%eax
671         adcl    %eax,%eax
672         addl    %edx,%ecx
673         adcl    $0,%eax
674         movl    %ecx,16(%ebx)
675
676         movl    20(%esi),%ecx
677         movl    20(%edi),%edx
678         addl    %eax,%ecx
679         movl    $0,%eax
680         adcl    %eax,%eax
681         addl    %edx,%ecx
682         adcl    $0,%eax
683         movl    %ecx,20(%ebx)
684
685         movl    24(%esi),%ecx
686         movl    24(%edi),%edx
687         addl    %eax,%ecx
688         movl    $0,%eax
689         adcl    %eax,%eax
690         addl    %edx,%ecx
691         adcl    $0,%eax
692         movl    %ecx,24(%ebx)
693
694         movl    28(%esi),%ecx
695         movl    28(%edi),%edx
696         addl    %eax,%ecx
697         movl    $0,%eax
698         adcl    %eax,%eax
699         addl    %edx,%ecx
700         adcl    $0,%eax
701         movl    %ecx,28(%ebx)
702
703         addl    $32,%esi
704         addl    $32,%edi
705         addl    $32,%ebx
706         subl    $8,%ebp
707         jnz     .L021aw_loop
708 .L020aw_finish:
709         movl    32(%esp),%ebp
710         andl    $7,%ebp
711         jz      .L022aw_end
712
713         movl    (%esi),%ecx
714         movl    (%edi),%edx
715         addl    %eax,%ecx
716         movl    $0,%eax
717         adcl    %eax,%eax
718         addl    %edx,%ecx
719         adcl    $0,%eax
720         decl    %ebp
721         movl    %ecx,(%ebx)
722         jz      .L022aw_end
723
724         movl    4(%esi),%ecx
725         movl    4(%edi),%edx
726         addl    %eax,%ecx
727         movl    $0,%eax
728         adcl    %eax,%eax
729         addl    %edx,%ecx
730         adcl    $0,%eax
731         decl    %ebp
732         movl    %ecx,4(%ebx)
733         jz      .L022aw_end
734
735         movl    8(%esi),%ecx
736         movl    8(%edi),%edx
737         addl    %eax,%ecx
738         movl    $0,%eax
739         adcl    %eax,%eax
740         addl    %edx,%ecx
741         adcl    $0,%eax
742         decl    %ebp
743         movl    %ecx,8(%ebx)
744         jz      .L022aw_end
745
746         movl    12(%esi),%ecx
747         movl    12(%edi),%edx
748         addl    %eax,%ecx
749         movl    $0,%eax
750         adcl    %eax,%eax
751         addl    %edx,%ecx
752         adcl    $0,%eax
753         decl    %ebp
754         movl    %ecx,12(%ebx)
755         jz      .L022aw_end
756
757         movl    16(%esi),%ecx
758         movl    16(%edi),%edx
759         addl    %eax,%ecx
760         movl    $0,%eax
761         adcl    %eax,%eax
762         addl    %edx,%ecx
763         adcl    $0,%eax
764         decl    %ebp
765         movl    %ecx,16(%ebx)
766         jz      .L022aw_end
767
768         movl    20(%esi),%ecx
769         movl    20(%edi),%edx
770         addl    %eax,%ecx
771         movl    $0,%eax
772         adcl    %eax,%eax
773         addl    %edx,%ecx
774         adcl    $0,%eax
775         decl    %ebp
776         movl    %ecx,20(%ebx)
777         jz      .L022aw_end
778
779         movl    24(%esi),%ecx
780         movl    24(%edi),%edx
781         addl    %eax,%ecx
782         movl    $0,%eax
783         adcl    %eax,%eax
784         addl    %edx,%ecx
785         adcl    $0,%eax
786         movl    %ecx,24(%ebx)
787 .L022aw_end:
788         popl    %edi
789         popl    %esi
790         popl    %ebx
791         popl    %ebp
792         ret
793 .size   bn_add_words,.-.L_bn_add_words_begin
794 .globl  bn_sub_words
795 .type   bn_sub_words,@function
796 .align  16
797 bn_sub_words:
798 .L_bn_sub_words_begin:
799         pushl   %ebp
800         pushl   %ebx
801         pushl   %esi
802         pushl   %edi
803
804         movl    20(%esp),%ebx
805         movl    24(%esp),%esi
806         movl    28(%esp),%edi
807         movl    32(%esp),%ebp
808         xorl    %eax,%eax
809         andl    $4294967288,%ebp
810         jz      .L023aw_finish
811 .L024aw_loop:
812
813         movl    (%esi),%ecx
814         movl    (%edi),%edx
815         subl    %eax,%ecx
816         movl    $0,%eax
817         adcl    %eax,%eax
818         subl    %edx,%ecx
819         adcl    $0,%eax
820         movl    %ecx,(%ebx)
821
822         movl    4(%esi),%ecx
823         movl    4(%edi),%edx
824         subl    %eax,%ecx
825         movl    $0,%eax
826         adcl    %eax,%eax
827         subl    %edx,%ecx
828         adcl    $0,%eax
829         movl    %ecx,4(%ebx)
830
831         movl    8(%esi),%ecx
832         movl    8(%edi),%edx
833         subl    %eax,%ecx
834         movl    $0,%eax
835         adcl    %eax,%eax
836         subl    %edx,%ecx
837         adcl    $0,%eax
838         movl    %ecx,8(%ebx)
839
840         movl    12(%esi),%ecx
841         movl    12(%edi),%edx
842         subl    %eax,%ecx
843         movl    $0,%eax
844         adcl    %eax,%eax
845         subl    %edx,%ecx
846         adcl    $0,%eax
847         movl    %ecx,12(%ebx)
848
849         movl    16(%esi),%ecx
850         movl    16(%edi),%edx
851         subl    %eax,%ecx
852         movl    $0,%eax
853         adcl    %eax,%eax
854         subl    %edx,%ecx
855         adcl    $0,%eax
856         movl    %ecx,16(%ebx)
857
858         movl    20(%esi),%ecx
859         movl    20(%edi),%edx
860         subl    %eax,%ecx
861         movl    $0,%eax
862         adcl    %eax,%eax
863         subl    %edx,%ecx
864         adcl    $0,%eax
865         movl    %ecx,20(%ebx)
866
867         movl    24(%esi),%ecx
868         movl    24(%edi),%edx
869         subl    %eax,%ecx
870         movl    $0,%eax
871         adcl    %eax,%eax
872         subl    %edx,%ecx
873         adcl    $0,%eax
874         movl    %ecx,24(%ebx)
875
876         movl    28(%esi),%ecx
877         movl    28(%edi),%edx
878         subl    %eax,%ecx
879         movl    $0,%eax
880         adcl    %eax,%eax
881         subl    %edx,%ecx
882         adcl    $0,%eax
883         movl    %ecx,28(%ebx)
884
885         addl    $32,%esi
886         addl    $32,%edi
887         addl    $32,%ebx
888         subl    $8,%ebp
889         jnz     .L024aw_loop
890 .L023aw_finish:
891         movl    32(%esp),%ebp
892         andl    $7,%ebp
893         jz      .L025aw_end
894
895         movl    (%esi),%ecx
896         movl    (%edi),%edx
897         subl    %eax,%ecx
898         movl    $0,%eax
899         adcl    %eax,%eax
900         subl    %edx,%ecx
901         adcl    $0,%eax
902         decl    %ebp
903         movl    %ecx,(%ebx)
904         jz      .L025aw_end
905
906         movl    4(%esi),%ecx
907         movl    4(%edi),%edx
908         subl    %eax,%ecx
909         movl    $0,%eax
910         adcl    %eax,%eax
911         subl    %edx,%ecx
912         adcl    $0,%eax
913         decl    %ebp
914         movl    %ecx,4(%ebx)
915         jz      .L025aw_end
916
917         movl    8(%esi),%ecx
918         movl    8(%edi),%edx
919         subl    %eax,%ecx
920         movl    $0,%eax
921         adcl    %eax,%eax
922         subl    %edx,%ecx
923         adcl    $0,%eax
924         decl    %ebp
925         movl    %ecx,8(%ebx)
926         jz      .L025aw_end
927
928         movl    12(%esi),%ecx
929         movl    12(%edi),%edx
930         subl    %eax,%ecx
931         movl    $0,%eax
932         adcl    %eax,%eax
933         subl    %edx,%ecx
934         adcl    $0,%eax
935         decl    %ebp
936         movl    %ecx,12(%ebx)
937         jz      .L025aw_end
938
939         movl    16(%esi),%ecx
940         movl    16(%edi),%edx
941         subl    %eax,%ecx
942         movl    $0,%eax
943         adcl    %eax,%eax
944         subl    %edx,%ecx
945         adcl    $0,%eax
946         decl    %ebp
947         movl    %ecx,16(%ebx)
948         jz      .L025aw_end
949
950         movl    20(%esi),%ecx
951         movl    20(%edi),%edx
952         subl    %eax,%ecx
953         movl    $0,%eax
954         adcl    %eax,%eax
955         subl    %edx,%ecx
956         adcl    $0,%eax
957         decl    %ebp
958         movl    %ecx,20(%ebx)
959         jz      .L025aw_end
960
961         movl    24(%esi),%ecx
962         movl    24(%edi),%edx
963         subl    %eax,%ecx
964         movl    $0,%eax
965         adcl    %eax,%eax
966         subl    %edx,%ecx
967         adcl    $0,%eax
968         movl    %ecx,24(%ebx)
969 .L025aw_end:
970         popl    %edi
971         popl    %esi
972         popl    %ebx
973         popl    %ebp
974         ret
975 .size   bn_sub_words,.-.L_bn_sub_words_begin
976 .globl  bn_sub_part_words
977 .type   bn_sub_part_words,@function
978 .align  16
979 bn_sub_part_words:
980 .L_bn_sub_part_words_begin:
981         pushl   %ebp
982         pushl   %ebx
983         pushl   %esi
984         pushl   %edi
985
986         movl    20(%esp),%ebx
987         movl    24(%esp),%esi
988         movl    28(%esp),%edi
989         movl    32(%esp),%ebp
990         xorl    %eax,%eax
991         andl    $4294967288,%ebp
992         jz      .L026aw_finish
993 .L027aw_loop:
994
995         movl    (%esi),%ecx
996         movl    (%edi),%edx
997         subl    %eax,%ecx
998         movl    $0,%eax
999         adcl    %eax,%eax
1000         subl    %edx,%ecx
1001         adcl    $0,%eax
1002         movl    %ecx,(%ebx)
1003
1004         movl    4(%esi),%ecx
1005         movl    4(%edi),%edx
1006         subl    %eax,%ecx
1007         movl    $0,%eax
1008         adcl    %eax,%eax
1009         subl    %edx,%ecx
1010         adcl    $0,%eax
1011         movl    %ecx,4(%ebx)
1012
1013         movl    8(%esi),%ecx
1014         movl    8(%edi),%edx
1015         subl    %eax,%ecx
1016         movl    $0,%eax
1017         adcl    %eax,%eax
1018         subl    %edx,%ecx
1019         adcl    $0,%eax
1020         movl    %ecx,8(%ebx)
1021
1022         movl    12(%esi),%ecx
1023         movl    12(%edi),%edx
1024         subl    %eax,%ecx
1025         movl    $0,%eax
1026         adcl    %eax,%eax
1027         subl    %edx,%ecx
1028         adcl    $0,%eax
1029         movl    %ecx,12(%ebx)
1030
1031         movl    16(%esi),%ecx
1032         movl    16(%edi),%edx
1033         subl    %eax,%ecx
1034         movl    $0,%eax
1035         adcl    %eax,%eax
1036         subl    %edx,%ecx
1037         adcl    $0,%eax
1038         movl    %ecx,16(%ebx)
1039
1040         movl    20(%esi),%ecx
1041         movl    20(%edi),%edx
1042         subl    %eax,%ecx
1043         movl    $0,%eax
1044         adcl    %eax,%eax
1045         subl    %edx,%ecx
1046         adcl    $0,%eax
1047         movl    %ecx,20(%ebx)
1048
1049         movl    24(%esi),%ecx
1050         movl    24(%edi),%edx
1051         subl    %eax,%ecx
1052         movl    $0,%eax
1053         adcl    %eax,%eax
1054         subl    %edx,%ecx
1055         adcl    $0,%eax
1056         movl    %ecx,24(%ebx)
1057
1058         movl    28(%esi),%ecx
1059         movl    28(%edi),%edx
1060         subl    %eax,%ecx
1061         movl    $0,%eax
1062         adcl    %eax,%eax
1063         subl    %edx,%ecx
1064         adcl    $0,%eax
1065         movl    %ecx,28(%ebx)
1066
1067         addl    $32,%esi
1068         addl    $32,%edi
1069         addl    $32,%ebx
1070         subl    $8,%ebp
1071         jnz     .L027aw_loop
1072 .L026aw_finish:
1073         movl    32(%esp),%ebp
1074         andl    $7,%ebp
1075         jz      .L028aw_end
1076
1077         movl    (%esi),%ecx
1078         movl    (%edi),%edx
1079         subl    %eax,%ecx
1080         movl    $0,%eax
1081         adcl    %eax,%eax
1082         subl    %edx,%ecx
1083         adcl    $0,%eax
1084         movl    %ecx,(%ebx)
1085         addl    $4,%esi
1086         addl    $4,%edi
1087         addl    $4,%ebx
1088         decl    %ebp
1089         jz      .L028aw_end
1090
1091         movl    (%esi),%ecx
1092         movl    (%edi),%edx
1093         subl    %eax,%ecx
1094         movl    $0,%eax
1095         adcl    %eax,%eax
1096         subl    %edx,%ecx
1097         adcl    $0,%eax
1098         movl    %ecx,(%ebx)
1099         addl    $4,%esi
1100         addl    $4,%edi
1101         addl    $4,%ebx
1102         decl    %ebp
1103         jz      .L028aw_end
1104
1105         movl    (%esi),%ecx
1106         movl    (%edi),%edx
1107         subl    %eax,%ecx
1108         movl    $0,%eax
1109         adcl    %eax,%eax
1110         subl    %edx,%ecx
1111         adcl    $0,%eax
1112         movl    %ecx,(%ebx)
1113         addl    $4,%esi
1114         addl    $4,%edi
1115         addl    $4,%ebx
1116         decl    %ebp
1117         jz      .L028aw_end
1118
1119         movl    (%esi),%ecx
1120         movl    (%edi),%edx
1121         subl    %eax,%ecx
1122         movl    $0,%eax
1123         adcl    %eax,%eax
1124         subl    %edx,%ecx
1125         adcl    $0,%eax
1126         movl    %ecx,(%ebx)
1127         addl    $4,%esi
1128         addl    $4,%edi
1129         addl    $4,%ebx
1130         decl    %ebp
1131         jz      .L028aw_end
1132
1133         movl    (%esi),%ecx
1134         movl    (%edi),%edx
1135         subl    %eax,%ecx
1136         movl    $0,%eax
1137         adcl    %eax,%eax
1138         subl    %edx,%ecx
1139         adcl    $0,%eax
1140         movl    %ecx,(%ebx)
1141         addl    $4,%esi
1142         addl    $4,%edi
1143         addl    $4,%ebx
1144         decl    %ebp
1145         jz      .L028aw_end
1146
1147         movl    (%esi),%ecx
1148         movl    (%edi),%edx
1149         subl    %eax,%ecx
1150         movl    $0,%eax
1151         adcl    %eax,%eax
1152         subl    %edx,%ecx
1153         adcl    $0,%eax
1154         movl    %ecx,(%ebx)
1155         addl    $4,%esi
1156         addl    $4,%edi
1157         addl    $4,%ebx
1158         decl    %ebp
1159         jz      .L028aw_end
1160
1161         movl    (%esi),%ecx
1162         movl    (%edi),%edx
1163         subl    %eax,%ecx
1164         movl    $0,%eax
1165         adcl    %eax,%eax
1166         subl    %edx,%ecx
1167         adcl    $0,%eax
1168         movl    %ecx,(%ebx)
1169         addl    $4,%esi
1170         addl    $4,%edi
1171         addl    $4,%ebx
1172 .L028aw_end:
1173         cmpl    $0,36(%esp)
1174         je      .L029pw_end
1175         movl    36(%esp),%ebp
1176         cmpl    $0,%ebp
1177         je      .L029pw_end
1178         jge     .L030pw_pos
1179
1180         movl    $0,%edx
1181         subl    %ebp,%edx
1182         movl    %edx,%ebp
1183         andl    $4294967288,%ebp
1184         jz      .L031pw_neg_finish
1185 .L032pw_neg_loop:
1186
1187         movl    $0,%ecx
1188         movl    (%edi),%edx
1189         subl    %eax,%ecx
1190         movl    $0,%eax
1191         adcl    %eax,%eax
1192         subl    %edx,%ecx
1193         adcl    $0,%eax
1194         movl    %ecx,(%ebx)
1195
1196         movl    $0,%ecx
1197         movl    4(%edi),%edx
1198         subl    %eax,%ecx
1199         movl    $0,%eax
1200         adcl    %eax,%eax
1201         subl    %edx,%ecx
1202         adcl    $0,%eax
1203         movl    %ecx,4(%ebx)
1204
1205         movl    $0,%ecx
1206         movl    8(%edi),%edx
1207         subl    %eax,%ecx
1208         movl    $0,%eax
1209         adcl    %eax,%eax
1210         subl    %edx,%ecx
1211         adcl    $0,%eax
1212         movl    %ecx,8(%ebx)
1213
1214         movl    $0,%ecx
1215         movl    12(%edi),%edx
1216         subl    %eax,%ecx
1217         movl    $0,%eax
1218         adcl    %eax,%eax
1219         subl    %edx,%ecx
1220         adcl    $0,%eax
1221         movl    %ecx,12(%ebx)
1222
1223         movl    $0,%ecx
1224         movl    16(%edi),%edx
1225         subl    %eax,%ecx
1226         movl    $0,%eax
1227         adcl    %eax,%eax
1228         subl    %edx,%ecx
1229         adcl    $0,%eax
1230         movl    %ecx,16(%ebx)
1231
1232         movl    $0,%ecx
1233         movl    20(%edi),%edx
1234         subl    %eax,%ecx
1235         movl    $0,%eax
1236         adcl    %eax,%eax
1237         subl    %edx,%ecx
1238         adcl    $0,%eax
1239         movl    %ecx,20(%ebx)
1240
1241         movl    $0,%ecx
1242         movl    24(%edi),%edx
1243         subl    %eax,%ecx
1244         movl    $0,%eax
1245         adcl    %eax,%eax
1246         subl    %edx,%ecx
1247         adcl    $0,%eax
1248         movl    %ecx,24(%ebx)
1249
1250         movl    $0,%ecx
1251         movl    28(%edi),%edx
1252         subl    %eax,%ecx
1253         movl    $0,%eax
1254         adcl    %eax,%eax
1255         subl    %edx,%ecx
1256         adcl    $0,%eax
1257         movl    %ecx,28(%ebx)
1258
1259         addl    $32,%edi
1260         addl    $32,%ebx
1261         subl    $8,%ebp
1262         jnz     .L032pw_neg_loop
1263 .L031pw_neg_finish:
1264         movl    36(%esp),%edx
1265         movl    $0,%ebp
1266         subl    %edx,%ebp
1267         andl    $7,%ebp
1268         jz      .L029pw_end
1269
1270         movl    $0,%ecx
1271         movl    (%edi),%edx
1272         subl    %eax,%ecx
1273         movl    $0,%eax
1274         adcl    %eax,%eax
1275         subl    %edx,%ecx
1276         adcl    $0,%eax
1277         decl    %ebp
1278         movl    %ecx,(%ebx)
1279         jz      .L029pw_end
1280
1281         movl    $0,%ecx
1282         movl    4(%edi),%edx
1283         subl    %eax,%ecx
1284         movl    $0,%eax
1285         adcl    %eax,%eax
1286         subl    %edx,%ecx
1287         adcl    $0,%eax
1288         decl    %ebp
1289         movl    %ecx,4(%ebx)
1290         jz      .L029pw_end
1291
1292         movl    $0,%ecx
1293         movl    8(%edi),%edx
1294         subl    %eax,%ecx
1295         movl    $0,%eax
1296         adcl    %eax,%eax
1297         subl    %edx,%ecx
1298         adcl    $0,%eax
1299         decl    %ebp
1300         movl    %ecx,8(%ebx)
1301         jz      .L029pw_end
1302
1303         movl    $0,%ecx
1304         movl    12(%edi),%edx
1305         subl    %eax,%ecx
1306         movl    $0,%eax
1307         adcl    %eax,%eax
1308         subl    %edx,%ecx
1309         adcl    $0,%eax
1310         decl    %ebp
1311         movl    %ecx,12(%ebx)
1312         jz      .L029pw_end
1313
1314         movl    $0,%ecx
1315         movl    16(%edi),%edx
1316         subl    %eax,%ecx
1317         movl    $0,%eax
1318         adcl    %eax,%eax
1319         subl    %edx,%ecx
1320         adcl    $0,%eax
1321         decl    %ebp
1322         movl    %ecx,16(%ebx)
1323         jz      .L029pw_end
1324
1325         movl    $0,%ecx
1326         movl    20(%edi),%edx
1327         subl    %eax,%ecx
1328         movl    $0,%eax
1329         adcl    %eax,%eax
1330         subl    %edx,%ecx
1331         adcl    $0,%eax
1332         decl    %ebp
1333         movl    %ecx,20(%ebx)
1334         jz      .L029pw_end
1335
1336         movl    $0,%ecx
1337         movl    24(%edi),%edx
1338         subl    %eax,%ecx
1339         movl    $0,%eax
1340         adcl    %eax,%eax
1341         subl    %edx,%ecx
1342         adcl    $0,%eax
1343         movl    %ecx,24(%ebx)
1344         jmp     .L029pw_end
1345 .L030pw_pos:
1346         andl    $4294967288,%ebp
1347         jz      .L033pw_pos_finish
1348 .L034pw_pos_loop:
1349
1350         movl    (%esi),%ecx
1351         subl    %eax,%ecx
1352         movl    %ecx,(%ebx)
1353         jnc     .L035pw_nc0
1354
1355         movl    4(%esi),%ecx
1356         subl    %eax,%ecx
1357         movl    %ecx,4(%ebx)
1358         jnc     .L036pw_nc1
1359
1360         movl    8(%esi),%ecx
1361         subl    %eax,%ecx
1362         movl    %ecx,8(%ebx)
1363         jnc     .L037pw_nc2
1364
1365         movl    12(%esi),%ecx
1366         subl    %eax,%ecx
1367         movl    %ecx,12(%ebx)
1368         jnc     .L038pw_nc3
1369
1370         movl    16(%esi),%ecx
1371         subl    %eax,%ecx
1372         movl    %ecx,16(%ebx)
1373         jnc     .L039pw_nc4
1374
1375         movl    20(%esi),%ecx
1376         subl    %eax,%ecx
1377         movl    %ecx,20(%ebx)
1378         jnc     .L040pw_nc5
1379
1380         movl    24(%esi),%ecx
1381         subl    %eax,%ecx
1382         movl    %ecx,24(%ebx)
1383         jnc     .L041pw_nc6
1384
1385         movl    28(%esi),%ecx
1386         subl    %eax,%ecx
1387         movl    %ecx,28(%ebx)
1388         jnc     .L042pw_nc7
1389
1390         addl    $32,%esi
1391         addl    $32,%ebx
1392         subl    $8,%ebp
1393         jnz     .L034pw_pos_loop
1394 .L033pw_pos_finish:
1395         movl    36(%esp),%ebp
1396         andl    $7,%ebp
1397         jz      .L029pw_end
1398
1399         movl    (%esi),%ecx
1400         subl    %eax,%ecx
1401         movl    %ecx,(%ebx)
1402         jnc     .L043pw_tail_nc0
1403         decl    %ebp
1404         jz      .L029pw_end
1405
1406         movl    4(%esi),%ecx
1407         subl    %eax,%ecx
1408         movl    %ecx,4(%ebx)
1409         jnc     .L044pw_tail_nc1
1410         decl    %ebp
1411         jz      .L029pw_end
1412
1413         movl    8(%esi),%ecx
1414         subl    %eax,%ecx
1415         movl    %ecx,8(%ebx)
1416         jnc     .L045pw_tail_nc2
1417         decl    %ebp
1418         jz      .L029pw_end
1419
1420         movl    12(%esi),%ecx
1421         subl    %eax,%ecx
1422         movl    %ecx,12(%ebx)
1423         jnc     .L046pw_tail_nc3
1424         decl    %ebp
1425         jz      .L029pw_end
1426
1427         movl    16(%esi),%ecx
1428         subl    %eax,%ecx
1429         movl    %ecx,16(%ebx)
1430         jnc     .L047pw_tail_nc4
1431         decl    %ebp
1432         jz      .L029pw_end
1433
1434         movl    20(%esi),%ecx
1435         subl    %eax,%ecx
1436         movl    %ecx,20(%ebx)
1437         jnc     .L048pw_tail_nc5
1438         decl    %ebp
1439         jz      .L029pw_end
1440
1441         movl    24(%esi),%ecx
1442         subl    %eax,%ecx
1443         movl    %ecx,24(%ebx)
1444         jnc     .L049pw_tail_nc6
1445         movl    $1,%eax
1446         jmp     .L029pw_end
1447 .L050pw_nc_loop:
1448         movl    (%esi),%ecx
1449         movl    %ecx,(%ebx)
1450 .L035pw_nc0:
1451         movl    4(%esi),%ecx
1452         movl    %ecx,4(%ebx)
1453 .L036pw_nc1:
1454         movl    8(%esi),%ecx
1455         movl    %ecx,8(%ebx)
1456 .L037pw_nc2:
1457         movl    12(%esi),%ecx
1458         movl    %ecx,12(%ebx)
1459 .L038pw_nc3:
1460         movl    16(%esi),%ecx
1461         movl    %ecx,16(%ebx)
1462 .L039pw_nc4:
1463         movl    20(%esi),%ecx
1464         movl    %ecx,20(%ebx)
1465 .L040pw_nc5:
1466         movl    24(%esi),%ecx
1467         movl    %ecx,24(%ebx)
1468 .L041pw_nc6:
1469         movl    28(%esi),%ecx
1470         movl    %ecx,28(%ebx)
1471 .L042pw_nc7:
1472
1473         addl    $32,%esi
1474         addl    $32,%ebx
1475         subl    $8,%ebp
1476         jnz     .L050pw_nc_loop
1477         movl    36(%esp),%ebp
1478         andl    $7,%ebp
1479         jz      .L051pw_nc_end
1480         movl    (%esi),%ecx
1481         movl    %ecx,(%ebx)
1482 .L043pw_tail_nc0:
1483         decl    %ebp
1484         jz      .L051pw_nc_end
1485         movl    4(%esi),%ecx
1486         movl    %ecx,4(%ebx)
1487 .L044pw_tail_nc1:
1488         decl    %ebp
1489         jz      .L051pw_nc_end
1490         movl    8(%esi),%ecx
1491         movl    %ecx,8(%ebx)
1492 .L045pw_tail_nc2:
1493         decl    %ebp
1494         jz      .L051pw_nc_end
1495         movl    12(%esi),%ecx
1496         movl    %ecx,12(%ebx)
1497 .L046pw_tail_nc3:
1498         decl    %ebp
1499         jz      .L051pw_nc_end
1500         movl    16(%esi),%ecx
1501         movl    %ecx,16(%ebx)
1502 .L047pw_tail_nc4:
1503         decl    %ebp
1504         jz      .L051pw_nc_end
1505         movl    20(%esi),%ecx
1506         movl    %ecx,20(%ebx)
1507 .L048pw_tail_nc5:
1508         decl    %ebp
1509         jz      .L051pw_nc_end
1510         movl    24(%esi),%ecx
1511         movl    %ecx,24(%ebx)
1512 .L049pw_tail_nc6:
1513 .L051pw_nc_end:
1514         movl    $0,%eax
1515 .L029pw_end:
1516         popl    %edi
1517         popl    %esi
1518         popl    %ebx
1519         popl    %ebp
1520         ret
1521 .size   bn_sub_part_words,.-.L_bn_sub_part_words_begin
1522 .comm   OPENSSL_ia32cap_P,8,4