Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Side by Side Diff: third_party/boringssl/win-x86_64/crypto/bn/rsaz-x86_64.asm

Issue 377783004: Add BoringSSL GYP files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Python fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 OPTION DOTNAME
2 .text$ SEGMENT ALIGN(64) 'CODE'
3
4 EXTERN OPENSSL_ia32cap_P:NEAR
5
6 PUBLIC rsaz_512_sqr
7
8 ALIGN 32
9 rsaz_512_sqr PROC PUBLIC
10 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
11 mov QWORD PTR[16+rsp],rsi
12 mov rax,rsp
13 $L$SEH_begin_rsaz_512_sqr::
14 mov rdi,rcx
15 mov rsi,rdx
16 mov rdx,r8
17 mov rcx,r9
18 mov r8,QWORD PTR[40+rsp]
19
20
21 push rbx
22 push rbp
23 push r12
24 push r13
25 push r14
26 push r15
27
28 sub rsp,128+24
29 $L$sqr_body::
30 mov rbp,rdx
31 mov rdx,QWORD PTR[rsi]
32 mov rax,QWORD PTR[8+rsi]
33 mov QWORD PTR[128+rsp],rcx
34 jmp $L$oop_sqr
35
36 ALIGN 32
37 $L$oop_sqr::
38 mov DWORD PTR[((128+8))+rsp],r8d
39
40 mov rbx,rdx
41 mul rdx
42 mov r8,rax
43 mov rax,QWORD PTR[16+rsi]
44 mov r9,rdx
45
46 mul rbx
47 add r9,rax
48 mov rax,QWORD PTR[24+rsi]
49 mov r10,rdx
50 adc r10,0
51
52 mul rbx
53 add r10,rax
54 mov rax,QWORD PTR[32+rsi]
55 mov r11,rdx
56 adc r11,0
57
58 mul rbx
59 add r11,rax
60 mov rax,QWORD PTR[40+rsi]
61 mov r12,rdx
62 adc r12,0
63
64 mul rbx
65 add r12,rax
66 mov rax,QWORD PTR[48+rsi]
67 mov r13,rdx
68 adc r13,0
69
70 mul rbx
71 add r13,rax
72 mov rax,QWORD PTR[56+rsi]
73 mov r14,rdx
74 adc r14,0
75
76 mul rbx
77 add r14,rax
78 mov rax,rbx
79 mov r15,rdx
80 adc r15,0
81
82 add r8,r8
83 mov rcx,r9
84 adc r9,r9
85
86 mul rax
87 mov QWORD PTR[rsp],rax
88 add r8,rdx
89 adc r9,0
90
91 mov QWORD PTR[8+rsp],r8
92 shr rcx,63
93
94
95 mov r8,QWORD PTR[8+rsi]
96 mov rax,QWORD PTR[16+rsi]
97 mul r8
98 add r10,rax
99 mov rax,QWORD PTR[24+rsi]
100 mov rbx,rdx
101 adc rbx,0
102
103 mul r8
104 add r11,rax
105 mov rax,QWORD PTR[32+rsi]
106 adc rdx,0
107 add r11,rbx
108 mov rbx,rdx
109 adc rbx,0
110
111 mul r8
112 add r12,rax
113 mov rax,QWORD PTR[40+rsi]
114 adc rdx,0
115 add r12,rbx
116 mov rbx,rdx
117 adc rbx,0
118
119 mul r8
120 add r13,rax
121 mov rax,QWORD PTR[48+rsi]
122 adc rdx,0
123 add r13,rbx
124 mov rbx,rdx
125 adc rbx,0
126
127 mul r8
128 add r14,rax
129 mov rax,QWORD PTR[56+rsi]
130 adc rdx,0
131 add r14,rbx
132 mov rbx,rdx
133 adc rbx,0
134
135 mul r8
136 add r15,rax
137 mov rax,r8
138 adc rdx,0
139 add r15,rbx
140 mov r8,rdx
141 mov rdx,r10
142 adc r8,0
143
144 add rdx,rdx
145 lea r10,QWORD PTR[r10*2+rcx]
146 mov rbx,r11
147 adc r11,r11
148
149 mul rax
150 add r9,rax
151 adc r10,rdx
152 adc r11,0
153
154 mov QWORD PTR[16+rsp],r9
155 mov QWORD PTR[24+rsp],r10
156 shr rbx,63
157
158
159 mov r9,QWORD PTR[16+rsi]
160 mov rax,QWORD PTR[24+rsi]
161 mul r9
162 add r12,rax
163 mov rax,QWORD PTR[32+rsi]
164 mov rcx,rdx
165 adc rcx,0
166
167 mul r9
168 add r13,rax
169 mov rax,QWORD PTR[40+rsi]
170 adc rdx,0
171 add r13,rcx
172 mov rcx,rdx
173 adc rcx,0
174
175 mul r9
176 add r14,rax
177 mov rax,QWORD PTR[48+rsi]
178 adc rdx,0
179 add r14,rcx
180 mov rcx,rdx
181 adc rcx,0
182
183 mul r9
184 mov r10,r12
185 lea r12,QWORD PTR[r12*2+rbx]
186 add r15,rax
187 mov rax,QWORD PTR[56+rsi]
188 adc rdx,0
189 add r15,rcx
190 mov rcx,rdx
191 adc rcx,0
192
193 mul r9
194 shr r10,63
195 add r8,rax
196 mov rax,r9
197 adc rdx,0
198 add r8,rcx
199 mov r9,rdx
200 adc r9,0
201
202 mov rcx,r13
203 lea r13,QWORD PTR[r13*2+r10]
204
205 mul rax
206 add r11,rax
207 adc r12,rdx
208 adc r13,0
209
210 mov QWORD PTR[32+rsp],r11
211 mov QWORD PTR[40+rsp],r12
212 shr rcx,63
213
214
215 mov r10,QWORD PTR[24+rsi]
216 mov rax,QWORD PTR[32+rsi]
217 mul r10
218 add r14,rax
219 mov rax,QWORD PTR[40+rsi]
220 mov rbx,rdx
221 adc rbx,0
222
223 mul r10
224 add r15,rax
225 mov rax,QWORD PTR[48+rsi]
226 adc rdx,0
227 add r15,rbx
228 mov rbx,rdx
229 adc rbx,0
230
231 mul r10
232 mov r12,r14
233 lea r14,QWORD PTR[r14*2+rcx]
234 add r8,rax
235 mov rax,QWORD PTR[56+rsi]
236 adc rdx,0
237 add r8,rbx
238 mov rbx,rdx
239 adc rbx,0
240
241 mul r10
242 shr r12,63
243 add r9,rax
244 mov rax,r10
245 adc rdx,0
246 add r9,rbx
247 mov r10,rdx
248 adc r10,0
249
250 mov rbx,r15
251 lea r15,QWORD PTR[r15*2+r12]
252
253 mul rax
254 add r13,rax
255 adc r14,rdx
256 adc r15,0
257
258 mov QWORD PTR[48+rsp],r13
259 mov QWORD PTR[56+rsp],r14
260 shr rbx,63
261
262
263 mov r11,QWORD PTR[32+rsi]
264 mov rax,QWORD PTR[40+rsi]
265 mul r11
266 add r8,rax
267 mov rax,QWORD PTR[48+rsi]
268 mov rcx,rdx
269 adc rcx,0
270
271 mul r11
272 add r9,rax
273 mov rax,QWORD PTR[56+rsi]
274 adc rdx,0
275 mov r12,r8
276 lea r8,QWORD PTR[r8*2+rbx]
277 add r9,rcx
278 mov rcx,rdx
279 adc rcx,0
280
281 mul r11
282 shr r12,63
283 add r10,rax
284 mov rax,r11
285 adc rdx,0
286 add r10,rcx
287 mov r11,rdx
288 adc r11,0
289
290 mov rcx,r9
291 lea r9,QWORD PTR[r9*2+r12]
292
293 mul rax
294 add r15,rax
295 adc r8,rdx
296 adc r9,0
297
298 mov QWORD PTR[64+rsp],r15
299 mov QWORD PTR[72+rsp],r8
300 shr rcx,63
301
302
303 mov r12,QWORD PTR[40+rsi]
304 mov rax,QWORD PTR[48+rsi]
305 mul r12
306 add r10,rax
307 mov rax,QWORD PTR[56+rsi]
308 mov rbx,rdx
309 adc rbx,0
310
311 mul r12
312 add r11,rax
313 mov rax,r12
314 mov r15,r10
315 lea r10,QWORD PTR[r10*2+rcx]
316 adc rdx,0
317 shr r15,63
318 add r11,rbx
319 mov r12,rdx
320 adc r12,0
321
322 mov rbx,r11
323 lea r11,QWORD PTR[r11*2+r15]
324
325 mul rax
326 add r9,rax
327 adc r10,rdx
328 adc r11,0
329
330 mov QWORD PTR[80+rsp],r9
331 mov QWORD PTR[88+rsp],r10
332
333
334 mov r13,QWORD PTR[48+rsi]
335 mov rax,QWORD PTR[56+rsi]
336 mul r13
337 add r12,rax
338 mov rax,r13
339 mov r13,rdx
340 adc r13,0
341
342 xor r14,r14
343 shl rbx,1
344 adc r12,r12
345 adc r13,r13
346 adc r14,r14
347
348 mul rax
349 add r11,rax
350 adc r12,rdx
351 adc r13,0
352
353 mov QWORD PTR[96+rsp],r11
354 mov QWORD PTR[104+rsp],r12
355
356
357 mov rax,QWORD PTR[56+rsi]
358 mul rax
359 add r13,rax
360 adc rdx,0
361
362 add r14,rdx
363
364 mov QWORD PTR[112+rsp],r13
365 mov QWORD PTR[120+rsp],r14
366
367 mov r8,QWORD PTR[rsp]
368 mov r9,QWORD PTR[8+rsp]
369 mov r10,QWORD PTR[16+rsp]
370 mov r11,QWORD PTR[24+rsp]
371 mov r12,QWORD PTR[32+rsp]
372 mov r13,QWORD PTR[40+rsp]
373 mov r14,QWORD PTR[48+rsp]
374 mov r15,QWORD PTR[56+rsp]
375
376 call __rsaz_512_reduce
377
378 add r8,QWORD PTR[64+rsp]
379 adc r9,QWORD PTR[72+rsp]
380 adc r10,QWORD PTR[80+rsp]
381 adc r11,QWORD PTR[88+rsp]
382 adc r12,QWORD PTR[96+rsp]
383 adc r13,QWORD PTR[104+rsp]
384 adc r14,QWORD PTR[112+rsp]
385 adc r15,QWORD PTR[120+rsp]
386 sbb rcx,rcx
387
388 call __rsaz_512_subtract
389
390 mov rdx,r8
391 mov rax,r9
392 mov r8d,DWORD PTR[((128+8))+rsp]
393 mov rsi,rdi
394
395 dec r8d
396 jnz $L$oop_sqr
397
398 lea rax,QWORD PTR[((128+24+48))+rsp]
399 mov r15,QWORD PTR[((-48))+rax]
400 mov r14,QWORD PTR[((-40))+rax]
401 mov r13,QWORD PTR[((-32))+rax]
402 mov r12,QWORD PTR[((-24))+rax]
403 mov rbp,QWORD PTR[((-16))+rax]
404 mov rbx,QWORD PTR[((-8))+rax]
405 lea rsp,QWORD PTR[rax]
406 $L$sqr_epilogue::
407 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
408 mov rsi,QWORD PTR[16+rsp]
409 DB 0F3h,0C3h ;repret
410 $L$SEH_end_rsaz_512_sqr::
411 rsaz_512_sqr ENDP
412 PUBLIC rsaz_512_mul
413
414 ALIGN 32
415 rsaz_512_mul PROC PUBLIC
416 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
417 mov QWORD PTR[16+rsp],rsi
418 mov rax,rsp
419 $L$SEH_begin_rsaz_512_mul::
420 mov rdi,rcx
421 mov rsi,rdx
422 mov rdx,r8
423 mov rcx,r9
424 mov r8,QWORD PTR[40+rsp]
425
426
427 push rbx
428 push rbp
429 push r12
430 push r13
431 push r14
432 push r15
433
434 sub rsp,128+24
435 $L$mul_body::
436 DB 102,72,15,110,199
437 DB 102,72,15,110,201
438 mov QWORD PTR[128+rsp],r8
439 mov rbx,QWORD PTR[rdx]
440 mov rbp,rdx
441 call __rsaz_512_mul
442
443 DB 102,72,15,126,199
444 DB 102,72,15,126,205
445
446 mov r8,QWORD PTR[rsp]
447 mov r9,QWORD PTR[8+rsp]
448 mov r10,QWORD PTR[16+rsp]
449 mov r11,QWORD PTR[24+rsp]
450 mov r12,QWORD PTR[32+rsp]
451 mov r13,QWORD PTR[40+rsp]
452 mov r14,QWORD PTR[48+rsp]
453 mov r15,QWORD PTR[56+rsp]
454
455 call __rsaz_512_reduce
456 add r8,QWORD PTR[64+rsp]
457 adc r9,QWORD PTR[72+rsp]
458 adc r10,QWORD PTR[80+rsp]
459 adc r11,QWORD PTR[88+rsp]
460 adc r12,QWORD PTR[96+rsp]
461 adc r13,QWORD PTR[104+rsp]
462 adc r14,QWORD PTR[112+rsp]
463 adc r15,QWORD PTR[120+rsp]
464 sbb rcx,rcx
465
466 call __rsaz_512_subtract
467
468 lea rax,QWORD PTR[((128+24+48))+rsp]
469 mov r15,QWORD PTR[((-48))+rax]
470 mov r14,QWORD PTR[((-40))+rax]
471 mov r13,QWORD PTR[((-32))+rax]
472 mov r12,QWORD PTR[((-24))+rax]
473 mov rbp,QWORD PTR[((-16))+rax]
474 mov rbx,QWORD PTR[((-8))+rax]
475 lea rsp,QWORD PTR[rax]
476 $L$mul_epilogue::
477 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
478 mov rsi,QWORD PTR[16+rsp]
479 DB 0F3h,0C3h ;repret
480 $L$SEH_end_rsaz_512_mul::
481 rsaz_512_mul ENDP
482 PUBLIC rsaz_512_mul_gather4
483
484 ALIGN 32
485 rsaz_512_mul_gather4 PROC PUBLIC
486 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
487 mov QWORD PTR[16+rsp],rsi
488 mov rax,rsp
489 $L$SEH_begin_rsaz_512_mul_gather4::
490 mov rdi,rcx
491 mov rsi,rdx
492 mov rdx,r8
493 mov rcx,r9
494 mov r8,QWORD PTR[40+rsp]
495 mov r9,QWORD PTR[48+rsp]
496
497
498 push rbx
499 push rbp
500 push r12
501 push r13
502 push r14
503 push r15
504
505 mov r9d,r9d
506 sub rsp,128+24
507 $L$mul_gather4_body::
508 mov eax,DWORD PTR[64+r9*4+rdx]
509 DB 102,72,15,110,199
510 mov ebx,DWORD PTR[r9*4+rdx]
511 DB 102,72,15,110,201
512 mov QWORD PTR[128+rsp],r8
513
514 shl rax,32
515 or rbx,rax
516 mov rax,QWORD PTR[rsi]
517 mov rcx,QWORD PTR[8+rsi]
518 lea rbp,QWORD PTR[128+r9*4+rdx]
519 mul rbx
520 mov QWORD PTR[rsp],rax
521 mov rax,rcx
522 mov r8,rdx
523
524 mul rbx
525 movd xmm4,DWORD PTR[rbp]
526 add r8,rax
527 mov rax,QWORD PTR[16+rsi]
528 mov r9,rdx
529 adc r9,0
530
531 mul rbx
532 movd xmm5,DWORD PTR[64+rbp]
533 add r9,rax
534 mov rax,QWORD PTR[24+rsi]
535 mov r10,rdx
536 adc r10,0
537
538 mul rbx
539 pslldq xmm5,4
540 add r10,rax
541 mov rax,QWORD PTR[32+rsi]
542 mov r11,rdx
543 adc r11,0
544
545 mul rbx
546 por xmm4,xmm5
547 add r11,rax
548 mov rax,QWORD PTR[40+rsi]
549 mov r12,rdx
550 adc r12,0
551
552 mul rbx
553 add r12,rax
554 mov rax,QWORD PTR[48+rsi]
555 mov r13,rdx
556 adc r13,0
557
558 mul rbx
559 lea rbp,QWORD PTR[128+rbp]
560 add r13,rax
561 mov rax,QWORD PTR[56+rsi]
562 mov r14,rdx
563 adc r14,0
564
565 mul rbx
566 DB 102,72,15,126,227
567 add r14,rax
568 mov rax,QWORD PTR[rsi]
569 mov r15,rdx
570 adc r15,0
571
572 lea rdi,QWORD PTR[8+rsp]
573 mov ecx,7
574 jmp $L$oop_mul_gather
575
576 ALIGN 32
577 $L$oop_mul_gather::
578 mul rbx
579 add r8,rax
580 mov rax,QWORD PTR[8+rsi]
581 mov QWORD PTR[rdi],r8
582 mov r8,rdx
583 adc r8,0
584
585 mul rbx
586 movd xmm4,DWORD PTR[rbp]
587 add r9,rax
588 mov rax,QWORD PTR[16+rsi]
589 adc rdx,0
590 add r8,r9
591 mov r9,rdx
592 adc r9,0
593
594 mul rbx
595 movd xmm5,DWORD PTR[64+rbp]
596 add r10,rax
597 mov rax,QWORD PTR[24+rsi]
598 adc rdx,0
599 add r9,r10
600 mov r10,rdx
601 adc r10,0
602
603 mul rbx
604 pslldq xmm5,4
605 add r11,rax
606 mov rax,QWORD PTR[32+rsi]
607 adc rdx,0
608 add r10,r11
609 mov r11,rdx
610 adc r11,0
611
612 mul rbx
613 por xmm4,xmm5
614 add r12,rax
615 mov rax,QWORD PTR[40+rsi]
616 adc rdx,0
617 add r11,r12
618 mov r12,rdx
619 adc r12,0
620
621 mul rbx
622 add r13,rax
623 mov rax,QWORD PTR[48+rsi]
624 adc rdx,0
625 add r12,r13
626 mov r13,rdx
627 adc r13,0
628
629 mul rbx
630 add r14,rax
631 mov rax,QWORD PTR[56+rsi]
632 adc rdx,0
633 add r13,r14
634 mov r14,rdx
635 adc r14,0
636
637 mul rbx
638 DB 102,72,15,126,227
639 add r15,rax
640 mov rax,QWORD PTR[rsi]
641 adc rdx,0
642 add r14,r15
643 mov r15,rdx
644 adc r15,0
645
646 lea rbp,QWORD PTR[128+rbp]
647 lea rdi,QWORD PTR[8+rdi]
648
649 dec ecx
650 jnz $L$oop_mul_gather
651
652 mov QWORD PTR[rdi],r8
653 mov QWORD PTR[8+rdi],r9
654 mov QWORD PTR[16+rdi],r10
655 mov QWORD PTR[24+rdi],r11
656 mov QWORD PTR[32+rdi],r12
657 mov QWORD PTR[40+rdi],r13
658 mov QWORD PTR[48+rdi],r14
659 mov QWORD PTR[56+rdi],r15
660
661 DB 102,72,15,126,199
662 DB 102,72,15,126,205
663
664 mov r8,QWORD PTR[rsp]
665 mov r9,QWORD PTR[8+rsp]
666 mov r10,QWORD PTR[16+rsp]
667 mov r11,QWORD PTR[24+rsp]
668 mov r12,QWORD PTR[32+rsp]
669 mov r13,QWORD PTR[40+rsp]
670 mov r14,QWORD PTR[48+rsp]
671 mov r15,QWORD PTR[56+rsp]
672
673 call __rsaz_512_reduce
674 add r8,QWORD PTR[64+rsp]
675 adc r9,QWORD PTR[72+rsp]
676 adc r10,QWORD PTR[80+rsp]
677 adc r11,QWORD PTR[88+rsp]
678 adc r12,QWORD PTR[96+rsp]
679 adc r13,QWORD PTR[104+rsp]
680 adc r14,QWORD PTR[112+rsp]
681 adc r15,QWORD PTR[120+rsp]
682 sbb rcx,rcx
683
684 call __rsaz_512_subtract
685
686 lea rax,QWORD PTR[((128+24+48))+rsp]
687 mov r15,QWORD PTR[((-48))+rax]
688 mov r14,QWORD PTR[((-40))+rax]
689 mov r13,QWORD PTR[((-32))+rax]
690 mov r12,QWORD PTR[((-24))+rax]
691 mov rbp,QWORD PTR[((-16))+rax]
692 mov rbx,QWORD PTR[((-8))+rax]
693 lea rsp,QWORD PTR[rax]
694 $L$mul_gather4_epilogue::
695 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
696 mov rsi,QWORD PTR[16+rsp]
697 DB 0F3h,0C3h ;repret
698 $L$SEH_end_rsaz_512_mul_gather4::
699 rsaz_512_mul_gather4 ENDP
700 PUBLIC rsaz_512_mul_scatter4
701
702 ALIGN 32
703 rsaz_512_mul_scatter4 PROC PUBLIC
704 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
705 mov QWORD PTR[16+rsp],rsi
706 mov rax,rsp
707 $L$SEH_begin_rsaz_512_mul_scatter4::
708 mov rdi,rcx
709 mov rsi,rdx
710 mov rdx,r8
711 mov rcx,r9
712 mov r8,QWORD PTR[40+rsp]
713 mov r9,QWORD PTR[48+rsp]
714
715
716 push rbx
717 push rbp
718 push r12
719 push r13
720 push r14
721 push r15
722
723 mov r9d,r9d
724 sub rsp,128+24
725 $L$mul_scatter4_body::
726 lea r8,QWORD PTR[r9*4+r8]
727 DB 102,72,15,110,199
728 DB 102,72,15,110,202
729 DB 102,73,15,110,208
730 mov QWORD PTR[128+rsp],rcx
731
732 mov rbp,rdi
733 mov rbx,QWORD PTR[rdi]
734 call __rsaz_512_mul
735
736 DB 102,72,15,126,199
737 DB 102,72,15,126,205
738
739 mov r8,QWORD PTR[rsp]
740 mov r9,QWORD PTR[8+rsp]
741 mov r10,QWORD PTR[16+rsp]
742 mov r11,QWORD PTR[24+rsp]
743 mov r12,QWORD PTR[32+rsp]
744 mov r13,QWORD PTR[40+rsp]
745 mov r14,QWORD PTR[48+rsp]
746 mov r15,QWORD PTR[56+rsp]
747
748 call __rsaz_512_reduce
749 add r8,QWORD PTR[64+rsp]
750 adc r9,QWORD PTR[72+rsp]
751 adc r10,QWORD PTR[80+rsp]
752 adc r11,QWORD PTR[88+rsp]
753 adc r12,QWORD PTR[96+rsp]
754 adc r13,QWORD PTR[104+rsp]
755 adc r14,QWORD PTR[112+rsp]
756 adc r15,QWORD PTR[120+rsp]
757 DB 102,72,15,126,214
758 sbb rcx,rcx
759
760 call __rsaz_512_subtract
761
762 mov DWORD PTR[rsi],r8d
763 shr r8,32
764 mov DWORD PTR[128+rsi],r9d
765 shr r9,32
766 mov DWORD PTR[256+rsi],r10d
767 shr r10,32
768 mov DWORD PTR[384+rsi],r11d
769 shr r11,32
770 mov DWORD PTR[512+rsi],r12d
771 shr r12,32
772 mov DWORD PTR[640+rsi],r13d
773 shr r13,32
774 mov DWORD PTR[768+rsi],r14d
775 shr r14,32
776 mov DWORD PTR[896+rsi],r15d
777 shr r15,32
778 mov DWORD PTR[64+rsi],r8d
779 mov DWORD PTR[192+rsi],r9d
780 mov DWORD PTR[320+rsi],r10d
781 mov DWORD PTR[448+rsi],r11d
782 mov DWORD PTR[576+rsi],r12d
783 mov DWORD PTR[704+rsi],r13d
784 mov DWORD PTR[832+rsi],r14d
785 mov DWORD PTR[960+rsi],r15d
786
787 lea rax,QWORD PTR[((128+24+48))+rsp]
788 mov r15,QWORD PTR[((-48))+rax]
789 mov r14,QWORD PTR[((-40))+rax]
790 mov r13,QWORD PTR[((-32))+rax]
791 mov r12,QWORD PTR[((-24))+rax]
792 mov rbp,QWORD PTR[((-16))+rax]
793 mov rbx,QWORD PTR[((-8))+rax]
794 lea rsp,QWORD PTR[rax]
795 $L$mul_scatter4_epilogue::
796 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
797 mov rsi,QWORD PTR[16+rsp]
798 DB 0F3h,0C3h ;repret
799 $L$SEH_end_rsaz_512_mul_scatter4::
800 rsaz_512_mul_scatter4 ENDP
801 PUBLIC rsaz_512_mul_by_one
802
803 ALIGN 32
804 rsaz_512_mul_by_one PROC PUBLIC
805 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
806 mov QWORD PTR[16+rsp],rsi
807 mov rax,rsp
808 $L$SEH_begin_rsaz_512_mul_by_one::
809 mov rdi,rcx
810 mov rsi,rdx
811 mov rdx,r8
812 mov rcx,r9
813
814
815 push rbx
816 push rbp
817 push r12
818 push r13
819 push r14
820 push r15
821
822 sub rsp,128+24
823 $L$mul_by_one_body::
824 mov rbp,rdx
825 mov QWORD PTR[128+rsp],rcx
826
827 mov r8,QWORD PTR[rsi]
828 pxor xmm0,xmm0
829 mov r9,QWORD PTR[8+rsi]
830 mov r10,QWORD PTR[16+rsi]
831 mov r11,QWORD PTR[24+rsi]
832 mov r12,QWORD PTR[32+rsi]
833 mov r13,QWORD PTR[40+rsi]
834 mov r14,QWORD PTR[48+rsi]
835 mov r15,QWORD PTR[56+rsi]
836
837 movdqa XMMWORD PTR[rsp],xmm0
838 movdqa XMMWORD PTR[16+rsp],xmm0
839 movdqa XMMWORD PTR[32+rsp],xmm0
840 movdqa XMMWORD PTR[48+rsp],xmm0
841 movdqa XMMWORD PTR[64+rsp],xmm0
842 movdqa XMMWORD PTR[80+rsp],xmm0
843 movdqa XMMWORD PTR[96+rsp],xmm0
844 call __rsaz_512_reduce
845 mov QWORD PTR[rdi],r8
846 mov QWORD PTR[8+rdi],r9
847 mov QWORD PTR[16+rdi],r10
848 mov QWORD PTR[24+rdi],r11
849 mov QWORD PTR[32+rdi],r12
850 mov QWORD PTR[40+rdi],r13
851 mov QWORD PTR[48+rdi],r14
852 mov QWORD PTR[56+rdi],r15
853
854 lea rax,QWORD PTR[((128+24+48))+rsp]
855 mov r15,QWORD PTR[((-48))+rax]
856 mov r14,QWORD PTR[((-40))+rax]
857 mov r13,QWORD PTR[((-32))+rax]
858 mov r12,QWORD PTR[((-24))+rax]
859 mov rbp,QWORD PTR[((-16))+rax]
860 mov rbx,QWORD PTR[((-8))+rax]
861 lea rsp,QWORD PTR[rax]
862 $L$mul_by_one_epilogue::
863 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
864 mov rsi,QWORD PTR[16+rsp]
865 DB 0F3h,0C3h ;repret
866 $L$SEH_end_rsaz_512_mul_by_one::
867 rsaz_512_mul_by_one ENDP
868
869 ALIGN 32
870 __rsaz_512_reduce PROC PRIVATE
871 mov rbx,r8
872 imul rbx,QWORD PTR[((128+8))+rsp]
873 mov rax,QWORD PTR[rbp]
874 mov ecx,8
875 jmp $L$reduction_loop
876
877 ALIGN 32
878 $L$reduction_loop::
879 mul rbx
880 mov rax,QWORD PTR[8+rbp]
881 neg r8
882 mov r8,rdx
883 adc r8,0
884
885 mul rbx
886 add r9,rax
887 mov rax,QWORD PTR[16+rbp]
888 adc rdx,0
889 add r8,r9
890 mov r9,rdx
891 adc r9,0
892
893 mul rbx
894 add r10,rax
895 mov rax,QWORD PTR[24+rbp]
896 adc rdx,0
897 add r9,r10
898 mov r10,rdx
899 adc r10,0
900
901 mul rbx
902 add r11,rax
903 mov rax,QWORD PTR[32+rbp]
904 adc rdx,0
905 add r10,r11
906 mov rsi,QWORD PTR[((128+8))+rsp]
907
908
909 adc rdx,0
910 mov r11,rdx
911
912 mul rbx
913 add r12,rax
914 mov rax,QWORD PTR[40+rbp]
915 adc rdx,0
916 imul rsi,r8
917 add r11,r12
918 mov r12,rdx
919 adc r12,0
920
921 mul rbx
922 add r13,rax
923 mov rax,QWORD PTR[48+rbp]
924 adc rdx,0
925 add r12,r13
926 mov r13,rdx
927 adc r13,0
928
929 mul rbx
930 add r14,rax
931 mov rax,QWORD PTR[56+rbp]
932 adc rdx,0
933 add r13,r14
934 mov r14,rdx
935 adc r14,0
936
937 mul rbx
938 mov rbx,rsi
939 add r15,rax
940 mov rax,QWORD PTR[rbp]
941 adc rdx,0
942 add r14,r15
943 mov r15,rdx
944 adc r15,0
945
946 dec ecx
947 jne $L$reduction_loop
948
949 DB 0F3h,0C3h ;repret
950 __rsaz_512_reduce ENDP
951
952 ALIGN 32
953 __rsaz_512_subtract PROC PRIVATE
954 mov QWORD PTR[rdi],r8
955 mov QWORD PTR[8+rdi],r9
956 mov QWORD PTR[16+rdi],r10
957 mov QWORD PTR[24+rdi],r11
958 mov QWORD PTR[32+rdi],r12
959 mov QWORD PTR[40+rdi],r13
960 mov QWORD PTR[48+rdi],r14
961 mov QWORD PTR[56+rdi],r15
962
963 mov r8,QWORD PTR[rbp]
964 mov r9,QWORD PTR[8+rbp]
965 neg r8
966 not r9
967 and r8,rcx
968 mov r10,QWORD PTR[16+rbp]
969 and r9,rcx
970 not r10
971 mov r11,QWORD PTR[24+rbp]
972 and r10,rcx
973 not r11
974 mov r12,QWORD PTR[32+rbp]
975 and r11,rcx
976 not r12
977 mov r13,QWORD PTR[40+rbp]
978 and r12,rcx
979 not r13
980 mov r14,QWORD PTR[48+rbp]
981 and r13,rcx
982 not r14
983 mov r15,QWORD PTR[56+rbp]
984 and r14,rcx
985 not r15
986 and r15,rcx
987
988 add r8,QWORD PTR[rdi]
989 adc r9,QWORD PTR[8+rdi]
990 adc r10,QWORD PTR[16+rdi]
991 adc r11,QWORD PTR[24+rdi]
992 adc r12,QWORD PTR[32+rdi]
993 adc r13,QWORD PTR[40+rdi]
994 adc r14,QWORD PTR[48+rdi]
995 adc r15,QWORD PTR[56+rdi]
996
997 mov QWORD PTR[rdi],r8
998 mov QWORD PTR[8+rdi],r9
999 mov QWORD PTR[16+rdi],r10
1000 mov QWORD PTR[24+rdi],r11
1001 mov QWORD PTR[32+rdi],r12
1002 mov QWORD PTR[40+rdi],r13
1003 mov QWORD PTR[48+rdi],r14
1004 mov QWORD PTR[56+rdi],r15
1005
1006 DB 0F3h,0C3h ;repret
1007 __rsaz_512_subtract ENDP
1008
1009 ALIGN 32
1010 __rsaz_512_mul PROC PRIVATE
1011 lea rdi,QWORD PTR[8+rsp]
1012
1013 mov rax,QWORD PTR[rsi]
1014 mul rbx
1015 mov QWORD PTR[rdi],rax
1016 mov rax,QWORD PTR[8+rsi]
1017 mov r8,rdx
1018
1019 mul rbx
1020 add r8,rax
1021 mov rax,QWORD PTR[16+rsi]
1022 mov r9,rdx
1023 adc r9,0
1024
1025 mul rbx
1026 add r9,rax
1027 mov rax,QWORD PTR[24+rsi]
1028 mov r10,rdx
1029 adc r10,0
1030
1031 mul rbx
1032 add r10,rax
1033 mov rax,QWORD PTR[32+rsi]
1034 mov r11,rdx
1035 adc r11,0
1036
1037 mul rbx
1038 add r11,rax
1039 mov rax,QWORD PTR[40+rsi]
1040 mov r12,rdx
1041 adc r12,0
1042
1043 mul rbx
1044 add r12,rax
1045 mov rax,QWORD PTR[48+rsi]
1046 mov r13,rdx
1047 adc r13,0
1048
1049 mul rbx
1050 add r13,rax
1051 mov rax,QWORD PTR[56+rsi]
1052 mov r14,rdx
1053 adc r14,0
1054
1055 mul rbx
1056 add r14,rax
1057 mov rax,QWORD PTR[rsi]
1058 mov r15,rdx
1059 adc r15,0
1060
1061 lea rbp,QWORD PTR[8+rbp]
1062 lea rdi,QWORD PTR[8+rdi]
1063
1064 mov ecx,7
1065 jmp $L$oop_mul
1066
1067 ALIGN 32
1068 $L$oop_mul::
1069 mov rbx,QWORD PTR[rbp]
1070 mul rbx
1071 add r8,rax
1072 mov rax,QWORD PTR[8+rsi]
1073 mov QWORD PTR[rdi],r8
1074 mov r8,rdx
1075 adc r8,0
1076
1077 mul rbx
1078 add r9,rax
1079 mov rax,QWORD PTR[16+rsi]
1080 adc rdx,0
1081 add r8,r9
1082 mov r9,rdx
1083 adc r9,0
1084
1085 mul rbx
1086 add r10,rax
1087 mov rax,QWORD PTR[24+rsi]
1088 adc rdx,0
1089 add r9,r10
1090 mov r10,rdx
1091 adc r10,0
1092
1093 mul rbx
1094 add r11,rax
1095 mov rax,QWORD PTR[32+rsi]
1096 adc rdx,0
1097 add r10,r11
1098 mov r11,rdx
1099 adc r11,0
1100
1101 mul rbx
1102 add r12,rax
1103 mov rax,QWORD PTR[40+rsi]
1104 adc rdx,0
1105 add r11,r12
1106 mov r12,rdx
1107 adc r12,0
1108
1109 mul rbx
1110 add r13,rax
1111 mov rax,QWORD PTR[48+rsi]
1112 adc rdx,0
1113 add r12,r13
1114 mov r13,rdx
1115 adc r13,0
1116
1117 mul rbx
1118 add r14,rax
1119 mov rax,QWORD PTR[56+rsi]
1120 adc rdx,0
1121 add r13,r14
1122 mov r14,rdx
1123 lea rbp,QWORD PTR[8+rbp]
1124 adc r14,0
1125
1126 mul rbx
1127 add r15,rax
1128 mov rax,QWORD PTR[rsi]
1129 adc rdx,0
1130 add r14,r15
1131 mov r15,rdx
1132 adc r15,0
1133
1134 lea rdi,QWORD PTR[8+rdi]
1135
1136 dec ecx
1137 jnz $L$oop_mul
1138
1139 mov QWORD PTR[rdi],r8
1140 mov QWORD PTR[8+rdi],r9
1141 mov QWORD PTR[16+rdi],r10
1142 mov QWORD PTR[24+rdi],r11
1143 mov QWORD PTR[32+rdi],r12
1144 mov QWORD PTR[40+rdi],r13
1145 mov QWORD PTR[48+rdi],r14
1146 mov QWORD PTR[56+rdi],r15
1147
1148 DB 0F3h,0C3h ;repret
1149 __rsaz_512_mul ENDP
1150 PUBLIC rsaz_512_scatter4
1151
1152 ALIGN 16
1153 rsaz_512_scatter4 PROC PUBLIC
1154 lea rcx,QWORD PTR[r8*4+rcx]
1155 mov r9d,8
1156 jmp $L$oop_scatter
1157 ALIGN 16
1158 $L$oop_scatter::
1159 mov rax,QWORD PTR[rdx]
1160 lea rdx,QWORD PTR[8+rdx]
1161 mov DWORD PTR[rcx],eax
1162 shr rax,32
1163 mov DWORD PTR[64+rcx],eax
1164 lea rcx,QWORD PTR[128+rcx]
1165 dec r9d
1166 jnz $L$oop_scatter
1167 DB 0F3h,0C3h ;repret
1168 rsaz_512_scatter4 ENDP
1169
1170 PUBLIC rsaz_512_gather4
1171
1172 ALIGN 16
1173 rsaz_512_gather4 PROC PUBLIC
1174 lea rdx,QWORD PTR[r8*4+rdx]
1175 mov r9d,8
1176 jmp $L$oop_gather
1177 ALIGN 16
1178 $L$oop_gather::
1179 mov eax,DWORD PTR[rdx]
1180 mov r8d,DWORD PTR[64+rdx]
1181 lea rdx,QWORD PTR[128+rdx]
1182 shl r8,32
1183 or rax,r8
1184 mov QWORD PTR[rcx],rax
1185 lea rcx,QWORD PTR[8+rcx]
1186 dec r9d
1187 jnz $L$oop_gather
1188 DB 0F3h,0C3h ;repret
1189 rsaz_512_gather4 ENDP
1190 EXTERN __imp_RtlVirtualUnwind:NEAR
1191
1192 ALIGN 16
1193 se_handler PROC PRIVATE
1194 push rsi
1195 push rdi
1196 push rbx
1197 push rbp
1198 push r12
1199 push r13
1200 push r14
1201 push r15
1202 pushfq
1203 sub rsp,64
1204
1205 mov rax,QWORD PTR[120+r8]
1206 mov rbx,QWORD PTR[248+r8]
1207
1208 mov rsi,QWORD PTR[8+r9]
1209 mov r11,QWORD PTR[56+r9]
1210
1211 mov r10d,DWORD PTR[r11]
1212 lea r10,QWORD PTR[r10*1+rsi]
1213 cmp rbx,r10
1214 jb $L$common_seh_tail
1215
1216 mov rax,QWORD PTR[152+r8]
1217
1218 mov r10d,DWORD PTR[4+r11]
1219 lea r10,QWORD PTR[r10*1+rsi]
1220 cmp rbx,r10
1221 jae $L$common_seh_tail
1222
1223 lea rax,QWORD PTR[((128+24+48))+rax]
1224
1225 mov rbx,QWORD PTR[((-8))+rax]
1226 mov rbp,QWORD PTR[((-16))+rax]
1227 mov r12,QWORD PTR[((-24))+rax]
1228 mov r13,QWORD PTR[((-32))+rax]
1229 mov r14,QWORD PTR[((-40))+rax]
1230 mov r15,QWORD PTR[((-48))+rax]
1231 mov QWORD PTR[144+r8],rbx
1232 mov QWORD PTR[160+r8],rbp
1233 mov QWORD PTR[216+r8],r12
1234 mov QWORD PTR[224+r8],r13
1235 mov QWORD PTR[232+r8],r14
1236 mov QWORD PTR[240+r8],r15
1237
1238 $L$common_seh_tail::
1239 mov rdi,QWORD PTR[8+rax]
1240 mov rsi,QWORD PTR[16+rax]
1241 mov QWORD PTR[152+r8],rax
1242 mov QWORD PTR[168+r8],rsi
1243 mov QWORD PTR[176+r8],rdi
1244
1245 mov rdi,QWORD PTR[40+r9]
1246 mov rsi,r8
1247 mov ecx,154
1248 DD 0a548f3fch
1249
1250 mov rsi,r9
1251 xor rcx,rcx
1252 mov rdx,QWORD PTR[8+rsi]
1253 mov r8,QWORD PTR[rsi]
1254 mov r9,QWORD PTR[16+rsi]
1255 mov r10,QWORD PTR[40+rsi]
1256 lea r11,QWORD PTR[56+rsi]
1257 lea r12,QWORD PTR[24+rsi]
1258 mov QWORD PTR[32+rsp],r10
1259 mov QWORD PTR[40+rsp],r11
1260 mov QWORD PTR[48+rsp],r12
1261 mov QWORD PTR[56+rsp],rcx
1262 call QWORD PTR[__imp_RtlVirtualUnwind]
1263
1264 mov eax,1
1265 add rsp,64
1266 popfq
1267 pop r15
1268 pop r14
1269 pop r13
1270 pop r12
1271 pop rbp
1272 pop rbx
1273 pop rdi
1274 pop rsi
1275 DB 0F3h,0C3h ;repret
1276 se_handler ENDP
1277
1278 .text$ ENDS
1279 .pdata SEGMENT READONLY ALIGN(4)
1280 ALIGN 4
1281 DD imagerel $L$SEH_begin_rsaz_512_sqr
1282 DD imagerel $L$SEH_end_rsaz_512_sqr
1283 DD imagerel $L$SEH_info_rsaz_512_sqr
1284
1285 DD imagerel $L$SEH_begin_rsaz_512_mul
1286 DD imagerel $L$SEH_end_rsaz_512_mul
1287 DD imagerel $L$SEH_info_rsaz_512_mul
1288
1289 DD imagerel $L$SEH_begin_rsaz_512_mul_gather4
1290 DD imagerel $L$SEH_end_rsaz_512_mul_gather4
1291 DD imagerel $L$SEH_info_rsaz_512_mul_gather4
1292
1293 DD imagerel $L$SEH_begin_rsaz_512_mul_scatter4
1294 DD imagerel $L$SEH_end_rsaz_512_mul_scatter4
1295 DD imagerel $L$SEH_info_rsaz_512_mul_scatter4
1296
1297 DD imagerel $L$SEH_begin_rsaz_512_mul_by_one
1298 DD imagerel $L$SEH_end_rsaz_512_mul_by_one
1299 DD imagerel $L$SEH_info_rsaz_512_mul_by_one
1300
1301 .pdata ENDS
1302 .xdata SEGMENT READONLY ALIGN(8)
1303 ALIGN 8
1304 $L$SEH_info_rsaz_512_sqr::
1305 DB 9,0,0,0
1306 DD imagerel se_handler
1307 DD imagerel $L$sqr_body,imagerel $L$sqr_epilogue
1308 $L$SEH_info_rsaz_512_mul::
1309 DB 9,0,0,0
1310 DD imagerel se_handler
1311 DD imagerel $L$mul_body,imagerel $L$mul_epilogue
1312 $L$SEH_info_rsaz_512_mul_gather4::
1313 DB 9,0,0,0
1314 DD imagerel se_handler
1315 DD imagerel $L$mul_gather4_body,imagerel $L$mul_gather4_epilogue
1316 $L$SEH_info_rsaz_512_mul_scatter4::
1317 DB 9,0,0,0
1318 DD imagerel se_handler
1319 DD imagerel $L$mul_scatter4_body,imagerel $L$mul_scatter4_epilogue
1320 $L$SEH_info_rsaz_512_mul_by_one::
1321 DB 9,0,0,0
1322 DD imagerel se_handler
1323 DD imagerel $L$mul_by_one_body,imagerel $L$mul_by_one_epilogue
1324
1325 .xdata ENDS
1326 END
OLDNEW
« no previous file with comments | « third_party/boringssl/win-x86_64/crypto/bn/rsaz-avx2.asm ('k') | third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698