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

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

Issue 2695223006: Roll src/third_party/boringssl/src dc8c1d962..0f28691d3 (Closed)
Patch Set: Use correct parent. Created 3 years, 10 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
OLDNEW
1 default rel 1 default rel
2 %define XMMWORD 2 %define XMMWORD
3 %define YMMWORD 3 %define YMMWORD
4 %define ZMMWORD 4 %define ZMMWORD
5 section .text code align=64 5 section .text code align=64
6 6
7 7
8 EXTERN OPENSSL_ia32cap_P 8 EXTERN OPENSSL_ia32cap_P
9 9
10 global bn_mul_mont_gather5 10 global bn_mul_mont_gather5
11 11
12 ALIGN 64 12 ALIGN 64
13 bn_mul_mont_gather5: 13 bn_mul_mont_gather5:
14 mov QWORD[8+rsp],rdi ;WIN64 prologue 14 mov QWORD[8+rsp],rdi ;WIN64 prologue
15 mov QWORD[16+rsp],rsi 15 mov QWORD[16+rsp],rsi
16 mov rax,rsp 16 mov rax,rsp
17 $L$SEH_begin_bn_mul_mont_gather5: 17 $L$SEH_begin_bn_mul_mont_gather5:
18 mov rdi,rcx 18 mov rdi,rcx
19 mov rsi,rdx 19 mov rsi,rdx
20 mov rdx,r8 20 mov rdx,r8
21 mov rcx,r9 21 mov rcx,r9
22 mov r8,QWORD[40+rsp] 22 mov r8,QWORD[40+rsp]
23 mov r9,QWORD[48+rsp] 23 mov r9,QWORD[48+rsp]
24 24
25 25
26 mov r9d,r9d
27 mov rax,rsp
26 test r9d,7 28 test r9d,7
27 jnz NEAR $L$mul_enter 29 jnz NEAR $L$mul_enter
28 jmp NEAR $L$mul4x_enter 30 jmp NEAR $L$mul4x_enter
29 31
30 ALIGN 16 32 ALIGN 16
31 $L$mul_enter: 33 $L$mul_enter:
32 mov r9d,r9d
33 mov rax,rsp
34 movd xmm5,DWORD[56+rsp] 34 movd xmm5,DWORD[56+rsp]
35 lea r10,[$L$inc]
36 push rbx 35 push rbx
37 push rbp 36 push rbp
38 push r12 37 push r12
39 push r13 38 push r13
40 push r14 39 push r14
41 push r15 40 push r15
42 41
43 » lea» r11,[2+r9] 42 » neg» r9
44 » neg» r11 43 » mov» r11,rsp
45 » lea» rsp,[((-264))+r11*8+rsp] 44 » lea» r10,[((-280))+r9*8+rsp]
46 » and» rsp,-1024 45 » neg» r9
46 » and» r10,-1024
47 47
48
49
50
51
52
53
54
55
56 sub r11,r10
57 and r11,-4096
58 lea rsp,[r11*1+r10]
59 mov r11,QWORD[rsp]
60 cmp rsp,r10
61 ja NEAR $L$mul_page_walk
62 jmp NEAR $L$mul_page_walk_done
63
64 $L$mul_page_walk:
65 lea rsp,[((-4096))+rsp]
66 mov r11,QWORD[rsp]
67 cmp rsp,r10
68 ja NEAR $L$mul_page_walk
69 $L$mul_page_walk_done:
70
71 lea r10,[$L$inc]
48 mov QWORD[8+r9*8+rsp],rax 72 mov QWORD[8+r9*8+rsp],rax
49 $L$mul_body: 73 $L$mul_body:
74
50 lea r12,[128+rdx] 75 lea r12,[128+rdx]
51 movdqa xmm0,XMMWORD[r10] 76 movdqa xmm0,XMMWORD[r10]
52 movdqa xmm1,XMMWORD[16+r10] 77 movdqa xmm1,XMMWORD[16+r10]
53 lea r10,[((24-112))+r9*8+rsp] 78 lea r10,[((24-112))+r9*8+rsp]
54 and r10,-16 79 and r10,-16
55 80
56 pshufd xmm5,xmm5,0 81 pshufd xmm5,xmm5,0
57 movdqa xmm4,xmm1 82 movdqa xmm4,xmm1
58 movdqa xmm2,xmm1 83 movdqa xmm2,xmm1
59 paddd xmm1,xmm0 84 paddd xmm1,xmm0
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 ALIGN 16 403 ALIGN 16
379 $L$sub: sbb rax,QWORD[r14*8+rcx] 404 $L$sub: sbb rax,QWORD[r14*8+rcx]
380 mov QWORD[r14*8+rdi],rax 405 mov QWORD[r14*8+rdi],rax
381 mov rax,QWORD[8+r14*8+rsi] 406 mov rax,QWORD[8+r14*8+rsi]
382 lea r14,[1+r14] 407 lea r14,[1+r14]
383 dec r15 408 dec r15
384 jnz NEAR $L$sub 409 jnz NEAR $L$sub
385 410
386 sbb rax,0 411 sbb rax,0
387 xor r14,r14 412 xor r14,r14
413 and rsi,rax
414 not rax
415 mov rcx,rdi
416 and rcx,rax
388 mov r15,r9 417 mov r15,r9
418 or rsi,rcx
389 ALIGN 16 419 ALIGN 16
390 $L$copy: 420 $L$copy:
391 » mov» rsi,QWORD[r14*8+rsp] 421 » mov» rax,QWORD[r14*8+rsi]
392 » mov» rcx,QWORD[r14*8+rdi]
393 » xor» rsi,rcx
394 » and» rsi,rax
395 » xor» rsi,rcx
396 mov QWORD[r14*8+rsp],r14 422 mov QWORD[r14*8+rsp],r14
397 » mov» QWORD[r14*8+rdi],rsi 423 » mov» QWORD[r14*8+rdi],rax
398 lea r14,[1+r14] 424 lea r14,[1+r14]
399 sub r15,1 425 sub r15,1
400 jnz NEAR $L$copy 426 jnz NEAR $L$copy
401 427
402 mov rsi,QWORD[8+r9*8+rsp] 428 mov rsi,QWORD[8+r9*8+rsp]
403 mov rax,1 429 mov rax,1
404 430
405 mov r15,QWORD[((-48))+rsi] 431 mov r15,QWORD[((-48))+rsi]
406 mov r14,QWORD[((-40))+rsi] 432 mov r14,QWORD[((-40))+rsi]
407 mov r13,QWORD[((-32))+rsi] 433 mov r13,QWORD[((-32))+rsi]
(...skipping 14 matching lines...) Expand all
422 mov rax,rsp 448 mov rax,rsp
423 $L$SEH_begin_bn_mul4x_mont_gather5: 449 $L$SEH_begin_bn_mul4x_mont_gather5:
424 mov rdi,rcx 450 mov rdi,rcx
425 mov rsi,rdx 451 mov rsi,rdx
426 mov rdx,r8 452 mov rdx,r8
427 mov rcx,r9 453 mov rcx,r9
428 mov r8,QWORD[40+rsp] 454 mov r8,QWORD[40+rsp]
429 mov r9,QWORD[48+rsp] 455 mov r9,QWORD[48+rsp]
430 456
431 457
432 $L$mul4x_enter:
433 DB 0x67 458 DB 0x67
434 mov rax,rsp 459 mov rax,rsp
460 $L$mul4x_enter:
435 push rbx 461 push rbx
436 push rbp 462 push rbp
437 push r12 463 push r12
438 push r13 464 push r13
439 push r14 465 push r14
440 push r15 466 push r15
467 $L$mul4x_prologue:
441 468
442 DB 0x67 469 DB 0x67
443 shl r9d,3 470 shl r9d,3
444 lea r10,[r9*2+r9] 471 lea r10,[r9*2+r9]
445 neg r9 472 neg r9
446 473
447 474
448 475
449 476
450 477
451 478
452 479
453 480
454 481
455 482
456 lea r11,[((-320))+r9*2+rsp] 483 lea r11,[((-320))+r9*2+rsp]
484 mov rbp,rsp
457 sub r11,rdi 485 sub r11,rdi
458 and r11,4095 486 and r11,4095
459 cmp r10,r11 487 cmp r10,r11
460 jb NEAR $L$mul4xsp_alt 488 jb NEAR $L$mul4xsp_alt
461 » sub» rsp,r11 489 » sub» rbp,r11
462 » lea» rsp,[((-320))+r9*2+rsp] 490 » lea» rbp,[((-320))+r9*2+rbp]
463 jmp NEAR $L$mul4xsp_done 491 jmp NEAR $L$mul4xsp_done
464 492
465 ALIGN 32 493 ALIGN 32
466 $L$mul4xsp_alt: 494 $L$mul4xsp_alt:
467 lea r10,[((4096-320))+r9*2] 495 lea r10,[((4096-320))+r9*2]
468 » lea» rsp,[((-320))+r9*2+rsp] 496 » lea» rbp,[((-320))+r9*2+rbp]
469 sub r11,r10 497 sub r11,r10
470 mov r10,0 498 mov r10,0
471 cmovc r11,r10 499 cmovc r11,r10
472 » sub» rsp,r11 500 » sub» rbp,r11
473 $L$mul4xsp_done: 501 $L$mul4xsp_done:
474 » and» rsp,-64 502 » and» rbp,-64
503 » mov» r11,rsp
504 » sub» r11,rbp
505 » and» r11,-4096
506 » lea» rsp,[rbp*1+r11]
507 » mov» r10,QWORD[rsp]
508 » cmp» rsp,rbp
509 » ja» NEAR $L$mul4x_page_walk
510 » jmp» NEAR $L$mul4x_page_walk_done
511
512 $L$mul4x_page_walk:
513 » lea» rsp,[((-4096))+rsp]
514 » mov» r10,QWORD[rsp]
515 » cmp» rsp,rbp
516 » ja» NEAR $L$mul4x_page_walk
517 $L$mul4x_page_walk_done:
518
475 neg r9 519 neg r9
476 520
477 mov QWORD[40+rsp],rax 521 mov QWORD[40+rsp],rax
478 $L$mul4x_body: 522 $L$mul4x_body:
479 523
480 call mul4x_internal 524 call mul4x_internal
481 525
482 mov rsi,QWORD[40+rsp] 526 mov rsi,QWORD[40+rsp]
483 mov rax,1 527 mov rax,1
484 528
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 mov r9,QWORD[48+rsp] 1080 mov r9,QWORD[48+rsp]
1037 1081
1038 1082
1039 mov rax,rsp 1083 mov rax,rsp
1040 push rbx 1084 push rbx
1041 push rbp 1085 push rbp
1042 push r12 1086 push r12
1043 push r13 1087 push r13
1044 push r14 1088 push r14
1045 push r15 1089 push r15
1090 $L$power5_prologue:
1046 1091
1047 shl r9d,3 1092 shl r9d,3
1048 lea r10d,[r9*2+r9] 1093 lea r10d,[r9*2+r9]
1049 neg r9 1094 neg r9
1050 mov r8,QWORD[r8] 1095 mov r8,QWORD[r8]
1051 1096
1052 1097
1053 1098
1054 1099
1055 1100
1056 1101
1057 1102
1058 1103
1059 lea r11,[((-320))+r9*2+rsp] 1104 lea r11,[((-320))+r9*2+rsp]
1105 mov rbp,rsp
1060 sub r11,rdi 1106 sub r11,rdi
1061 and r11,4095 1107 and r11,4095
1062 cmp r10,r11 1108 cmp r10,r11
1063 jb NEAR $L$pwr_sp_alt 1109 jb NEAR $L$pwr_sp_alt
1064 » sub» rsp,r11 1110 » sub» rbp,r11
1065 » lea» rsp,[((-320))+r9*2+rsp] 1111 » lea» rbp,[((-320))+r9*2+rbp]
1066 jmp NEAR $L$pwr_sp_done 1112 jmp NEAR $L$pwr_sp_done
1067 1113
1068 ALIGN 32 1114 ALIGN 32
1069 $L$pwr_sp_alt: 1115 $L$pwr_sp_alt:
1070 lea r10,[((4096-320))+r9*2] 1116 lea r10,[((4096-320))+r9*2]
1071 » lea» rsp,[((-320))+r9*2+rsp] 1117 » lea» rbp,[((-320))+r9*2+rbp]
1072 sub r11,r10 1118 sub r11,r10
1073 mov r10,0 1119 mov r10,0
1074 cmovc r11,r10 1120 cmovc r11,r10
1075 » sub» rsp,r11 1121 » sub» rbp,r11
1076 $L$pwr_sp_done: 1122 $L$pwr_sp_done:
1077 » and» rsp,-64 1123 » and» rbp,-64
1124 » mov» r11,rsp
1125 » sub» r11,rbp
1126 » and» r11,-4096
1127 » lea» rsp,[rbp*1+r11]
1128 » mov» r10,QWORD[rsp]
1129 » cmp» rsp,rbp
1130 » ja» NEAR $L$pwr_page_walk
1131 » jmp» NEAR $L$pwr_page_walk_done
1132
1133 $L$pwr_page_walk:
1134 » lea» rsp,[((-4096))+rsp]
1135 » mov» r10,QWORD[rsp]
1136 » cmp» rsp,rbp
1137 » ja» NEAR $L$pwr_page_walk
1138 $L$pwr_page_walk_done:
1139
1078 mov r10,r9 1140 mov r10,r9
1079 neg r9 1141 neg r9
1080 1142
1081 1143
1082 1144
1083 1145
1084 1146
1085 1147
1086 1148
1087 1149
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 2052
1991 2053
1992 DB 0x67 2054 DB 0x67
1993 mov rax,rsp 2055 mov rax,rsp
1994 push rbx 2056 push rbx
1995 push rbp 2057 push rbp
1996 push r12 2058 push r12
1997 push r13 2059 push r13
1998 push r14 2060 push r14
1999 push r15 2061 push r15
2062 $L$from_prologue:
2000 2063
2001 shl r9d,3 2064 shl r9d,3
2002 lea r10,[r9*2+r9] 2065 lea r10,[r9*2+r9]
2003 neg r9 2066 neg r9
2004 mov r8,QWORD[r8] 2067 mov r8,QWORD[r8]
2005 2068
2006 2069
2007 2070
2008 2071
2009 2072
2010 2073
2011 2074
2012 2075
2013 lea r11,[((-320))+r9*2+rsp] 2076 lea r11,[((-320))+r9*2+rsp]
2077 mov rbp,rsp
2014 sub r11,rdi 2078 sub r11,rdi
2015 and r11,4095 2079 and r11,4095
2016 cmp r10,r11 2080 cmp r10,r11
2017 jb NEAR $L$from_sp_alt 2081 jb NEAR $L$from_sp_alt
2018 » sub» rsp,r11 2082 » sub» rbp,r11
2019 » lea» rsp,[((-320))+r9*2+rsp] 2083 » lea» rbp,[((-320))+r9*2+rbp]
2020 jmp NEAR $L$from_sp_done 2084 jmp NEAR $L$from_sp_done
2021 2085
2022 ALIGN 32 2086 ALIGN 32
2023 $L$from_sp_alt: 2087 $L$from_sp_alt:
2024 lea r10,[((4096-320))+r9*2] 2088 lea r10,[((4096-320))+r9*2]
2025 » lea» rsp,[((-320))+r9*2+rsp] 2089 » lea» rbp,[((-320))+r9*2+rbp]
2026 sub r11,r10 2090 sub r11,r10
2027 mov r10,0 2091 mov r10,0
2028 cmovc r11,r10 2092 cmovc r11,r10
2029 » sub» rsp,r11 2093 » sub» rbp,r11
2030 $L$from_sp_done: 2094 $L$from_sp_done:
2031 » and» rsp,-64 2095 » and» rbp,-64
2096 » mov» r11,rsp
2097 » sub» r11,rbp
2098 » and» r11,-4096
2099 » lea» rsp,[rbp*1+r11]
2100 » mov» r10,QWORD[rsp]
2101 » cmp» rsp,rbp
2102 » ja» NEAR $L$from_page_walk
2103 » jmp» NEAR $L$from_page_walk_done
2104
2105 $L$from_page_walk:
2106 » lea» rsp,[((-4096))+rsp]
2107 » mov» r10,QWORD[rsp]
2108 » cmp» rsp,rbp
2109 » ja» NEAR $L$from_page_walk
2110 $L$from_page_walk_done:
2111
2032 mov r10,r9 2112 mov r10,r9
2033 neg r9 2113 neg r9
2034 2114
2035 2115
2036 2116
2037 2117
2038 2118
2039 2119
2040 2120
2041 2121
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 mov rbx,QWORD[248+r8] 2394 mov rbx,QWORD[248+r8]
2315 2395
2316 mov rsi,QWORD[8+r9] 2396 mov rsi,QWORD[8+r9]
2317 mov r11,QWORD[56+r9] 2397 mov r11,QWORD[56+r9]
2318 2398
2319 mov r10d,DWORD[r11] 2399 mov r10d,DWORD[r11]
2320 lea r10,[r10*1+rsi] 2400 lea r10,[r10*1+rsi]
2321 cmp rbx,r10 2401 cmp rbx,r10
2322 jb NEAR $L$common_seh_tail 2402 jb NEAR $L$common_seh_tail
2323 2403
2324 mov rax,QWORD[152+r8]
2325
2326 mov r10d,DWORD[4+r11] 2404 mov r10d,DWORD[4+r11]
2327 lea r10,[r10*1+rsi] 2405 lea r10,[r10*1+rsi]
2328 cmp rbx,r10 2406 cmp rbx,r10
2407 jb NEAR $L$common_pop_regs
2408
2409 mov rax,QWORD[152+r8]
2410
2411 mov r10d,DWORD[8+r11]
2412 lea r10,[r10*1+rsi]
2413 cmp rbx,r10
2329 jae NEAR $L$common_seh_tail 2414 jae NEAR $L$common_seh_tail
2330 2415
2331 lea r10,[$L$mul_epilogue] 2416 lea r10,[$L$mul_epilogue]
2332 cmp rbx,r10 2417 cmp rbx,r10
2333 ja NEAR $L$body_40 2418 ja NEAR $L$body_40
2334 2419
2335 mov r10,QWORD[192+r8] 2420 mov r10,QWORD[192+r8]
2336 mov rax,QWORD[8+r10*8+rax] 2421 mov rax,QWORD[8+r10*8+rax]
2337 2422
2338 » jmp» NEAR $L$body_proceed 2423 » jmp» NEAR $L$common_pop_regs
2339 2424
2340 $L$body_40: 2425 $L$body_40:
2341 mov rax,QWORD[40+rax] 2426 mov rax,QWORD[40+rax]
2342 $L$body_proceed: 2427 $L$common_pop_regs:
2343 mov rbx,QWORD[((-8))+rax] 2428 mov rbx,QWORD[((-8))+rax]
2344 mov rbp,QWORD[((-16))+rax] 2429 mov rbp,QWORD[((-16))+rax]
2345 mov r12,QWORD[((-24))+rax] 2430 mov r12,QWORD[((-24))+rax]
2346 mov r13,QWORD[((-32))+rax] 2431 mov r13,QWORD[((-32))+rax]
2347 mov r14,QWORD[((-40))+rax] 2432 mov r14,QWORD[((-40))+rax]
2348 mov r15,QWORD[((-48))+rax] 2433 mov r15,QWORD[((-48))+rax]
2349 mov QWORD[144+r8],rbx 2434 mov QWORD[144+r8],rbx
2350 mov QWORD[160+r8],rbp 2435 mov QWORD[160+r8],rbp
2351 mov QWORD[216+r8],r12 2436 mov QWORD[216+r8],r12
2352 mov QWORD[224+r8],r13 2437 mov QWORD[224+r8],r13
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 DD $L$SEH_info_bn_from_mont8x wrt ..imagebase 2497 DD $L$SEH_info_bn_from_mont8x wrt ..imagebase
2413 DD $L$SEH_begin_bn_gather5 wrt ..imagebase 2498 DD $L$SEH_begin_bn_gather5 wrt ..imagebase
2414 DD $L$SEH_end_bn_gather5 wrt ..imagebase 2499 DD $L$SEH_end_bn_gather5 wrt ..imagebase
2415 DD $L$SEH_info_bn_gather5 wrt ..imagebase 2500 DD $L$SEH_info_bn_gather5 wrt ..imagebase
2416 2501
2417 section .xdata rdata align=8 2502 section .xdata rdata align=8
2418 ALIGN 8 2503 ALIGN 8
2419 $L$SEH_info_bn_mul_mont_gather5: 2504 $L$SEH_info_bn_mul_mont_gather5:
2420 DB 9,0,0,0 2505 DB 9,0,0,0
2421 DD mul_handler wrt ..imagebase 2506 DD mul_handler wrt ..imagebase
2422 » DD» $L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase 2507 » DD» $L$mul_body wrt ..imagebase,$L$mul_body wrt ..imagebase,$L$mul_e pilogue wrt ..imagebase
2423 ALIGN 8 2508 ALIGN 8
2424 $L$SEH_info_bn_mul4x_mont_gather5: 2509 $L$SEH_info_bn_mul4x_mont_gather5:
2425 DB 9,0,0,0 2510 DB 9,0,0,0
2426 DD mul_handler wrt ..imagebase 2511 DD mul_handler wrt ..imagebase
2427 » DD» $L$mul4x_body wrt ..imagebase,$L$mul4x_epilogue wrt ..imagebase 2512 » DD» $L$mul4x_prologue wrt ..imagebase,$L$mul4x_body wrt ..imagebase, $L$mul4x_epilogue wrt ..imagebase
2428 ALIGN 8 2513 ALIGN 8
2429 $L$SEH_info_bn_power5: 2514 $L$SEH_info_bn_power5:
2430 DB 9,0,0,0 2515 DB 9,0,0,0
2431 DD mul_handler wrt ..imagebase 2516 DD mul_handler wrt ..imagebase
2432 » DD» $L$power5_body wrt ..imagebase,$L$power5_epilogue wrt ..imagebas e 2517 » DD» $L$power5_prologue wrt ..imagebase,$L$power5_body wrt ..imagebas e,$L$power5_epilogue wrt ..imagebase
2433 ALIGN 8 2518 ALIGN 8
2434 $L$SEH_info_bn_from_mont8x: 2519 $L$SEH_info_bn_from_mont8x:
2435 DB 9,0,0,0 2520 DB 9,0,0,0
2436 DD mul_handler wrt ..imagebase 2521 DD mul_handler wrt ..imagebase
2437 » DD» $L$from_body wrt ..imagebase,$L$from_epilogue wrt ..imagebase 2522 » DD» $L$from_prologue wrt ..imagebase,$L$from_body wrt ..imagebase,$L $from_epilogue wrt ..imagebase
2438 ALIGN 8 2523 ALIGN 8
2439 $L$SEH_info_bn_gather5: 2524 $L$SEH_info_bn_gather5:
2440 DB 0x01,0x0b,0x03,0x0a 2525 DB 0x01,0x0b,0x03,0x0a
2441 DB 0x0b,0x01,0x21,0x00 2526 DB 0x0b,0x01,0x21,0x00
2442 DB 0x04,0xa3,0x00,0x00 2527 DB 0x04,0xa3,0x00,0x00
2443 ALIGN 8 2528 ALIGN 8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698