1 #include <machine/asm.h>
5 .globl sha1_block_data_order
6 .type sha1_block_data_order,@function
9 movq OPENSSL_ia32cap_P+0@GOTPCREL(%rip),%r8
50 leal 1518500249(%rdx,%r13,1),%r13d
63 leal 1518500249(%rbp,%r12,1),%r12d
76 leal 1518500249(%rdx,%r11,1),%r11d
89 leal 1518500249(%rbp,%rdi,1),%edi
102 leal 1518500249(%rdx,%rsi,1),%esi
115 leal 1518500249(%rbp,%r13,1),%r13d
128 leal 1518500249(%rdx,%r12,1),%r12d
141 leal 1518500249(%rbp,%r11,1),%r11d
154 leal 1518500249(%rdx,%rdi,1),%edi
167 leal 1518500249(%rbp,%rsi,1),%esi
180 leal 1518500249(%rdx,%r13,1),%r13d
193 leal 1518500249(%rbp,%r12,1),%r12d
206 leal 1518500249(%rdx,%r11,1),%r11d
219 leal 1518500249(%rbp,%rdi,1),%edi
232 leal 1518500249(%rdx,%rsi,1),%esi
247 leal 1518500249(%rbp,%r13,1),%r13d
263 leal 1518500249(%rdx,%r12,1),%r12d
279 leal 1518500249(%rbp,%r11,1),%r11d
295 leal 1518500249(%rdx,%rdi,1),%edi
311 leal 1518500249(%rbp,%rsi,1),%esi
325 leal 1859775393(%rdx,%r13,1),%r13d
340 leal 1859775393(%rbp,%r12,1),%r12d
355 leal 1859775393(%rdx,%r11,1),%r11d
370 leal 1859775393(%rbp,%rdi,1),%edi
385 leal 1859775393(%rdx,%rsi,1),%esi
400 leal 1859775393(%rbp,%r13,1),%r13d
415 leal 1859775393(%rdx,%r12,1),%r12d
430 leal 1859775393(%rbp,%r11,1),%r11d
445 leal 1859775393(%rdx,%rdi,1),%edi
460 leal 1859775393(%rbp,%rsi,1),%esi
475 leal 1859775393(%rdx,%r13,1),%r13d
490 leal 1859775393(%rbp,%r12,1),%r12d
505 leal 1859775393(%rdx,%r11,1),%r11d
520 leal 1859775393(%rbp,%rdi,1),%edi
535 leal 1859775393(%rdx,%rsi,1),%esi
550 leal 1859775393(%rbp,%r13,1),%r13d
565 leal 1859775393(%rdx,%r12,1),%r12d
580 leal 1859775393(%rbp,%r11,1),%r11d
595 leal 1859775393(%rdx,%rdi,1),%edi
610 leal 1859775393(%rbp,%rsi,1),%esi
627 leal -1894007588(%rdx,%r13,1),%r13d
645 leal -1894007588(%rbp,%r12,1),%r12d
663 leal -1894007588(%rdx,%r11,1),%r11d
681 leal -1894007588(%rbp,%rdi,1),%edi
699 leal -1894007588(%rdx,%rsi,1),%esi
717 leal -1894007588(%rbp,%r13,1),%r13d
735 leal -1894007588(%rdx,%r12,1),%r12d
753 leal -1894007588(%rbp,%r11,1),%r11d
771 leal -1894007588(%rdx,%rdi,1),%edi
789 leal -1894007588(%rbp,%rsi,1),%esi
807 leal -1894007588(%rdx,%r13,1),%r13d
825 leal -1894007588(%rbp,%r12,1),%r12d
843 leal -1894007588(%rdx,%r11,1),%r11d
861 leal -1894007588(%rbp,%rdi,1),%edi
879 leal -1894007588(%rdx,%rsi,1),%esi
897 leal -1894007588(%rbp,%r13,1),%r13d
915 leal -1894007588(%rdx,%r12,1),%r12d
933 leal -1894007588(%rbp,%r11,1),%r11d
951 leal -1894007588(%rdx,%rdi,1),%edi
969 leal -1894007588(%rbp,%rsi,1),%esi
985 leal -899497514(%rdx,%r13,1),%r13d
1000 leal -899497514(%rbp,%r12,1),%r12d
1015 leal -899497514(%rdx,%r11,1),%r11d
1030 leal -899497514(%rbp,%rdi,1),%edi
1045 leal -899497514(%rdx,%rsi,1),%esi
1060 leal -899497514(%rbp,%r13,1),%r13d
1075 leal -899497514(%rdx,%r12,1),%r12d
1090 leal -899497514(%rbp,%r11,1),%r11d
1105 leal -899497514(%rdx,%rdi,1),%edi
1120 leal -899497514(%rbp,%rsi,1),%esi
1135 leal -899497514(%rdx,%r13,1),%r13d
1150 leal -899497514(%rbp,%r12,1),%r12d
1165 leal -899497514(%rdx,%r11,1),%r11d
1180 leal -899497514(%rbp,%rdi,1),%edi
1195 leal -899497514(%rdx,%rsi,1),%esi
1210 leal -899497514(%rbp,%r13,1),%r13d
1225 leal -899497514(%rdx,%r12,1),%r12d
1239 leal -899497514(%rbp,%r11,1),%r11d
1253 leal -899497514(%rdx,%rdi,1),%edi
1264 leal -899497514(%rbp,%rsi,1),%esi
1293 .size sha1_block_data_order,.-sha1_block_data_order
1294 .type sha1_block_data_order_ssse3,@function
1296 sha1_block_data_order_ssse3:
1308 leaq K_XX_XX(%rip),%r11
1317 movdqa 64(%r11),%xmm6
1318 movdqa 0(%r11),%xmm9
1320 movdqu 16(%r9),%xmm1
1321 movdqu 32(%r9),%xmm2
1322 movdqu 48(%r9),%xmm3
1323 .byte 102,15,56,0,198
1325 .byte 102,15,56,0,206
1326 .byte 102,15,56,0,214
1327 .byte 102,15,56,0,222
1331 movdqa %xmm0,0(%rsp)
1333 movdqa %xmm1,16(%rsp)
1335 movdqa %xmm2,32(%rsp)
1344 .byte 102,15,58,15,224,8
1364 movdqa %xmm9,48(%rsp)
1395 movdqa 0(%r11),%xmm10
1405 .byte 102,15,58,15,233,8
1425 movdqa %xmm10,0(%rsp)
1456 movdqa 16(%r11),%xmm8
1466 .byte 102,15,58,15,242,8
1486 movdqa %xmm8,16(%rsp)
1517 movdqa 16(%r11),%xmm9
1527 .byte 102,15,58,15,251,8
1547 movdqa %xmm9,32(%rsp)
1578 movdqa 16(%r11),%xmm10
1587 .byte 102,68,15,58,15,206,8
1604 movdqa %xmm10,48(%rsp)
1639 .byte 102,68,15,58,15,215,8
1656 movdqa %xmm8,0(%rsp)
1683 .byte 102,68,15,58,15,192,8
1690 movdqa 32(%r11),%xmm10
1700 movdqa %xmm9,16(%rsp)
1727 .byte 102,68,15,58,15,201,8
1744 movdqa %xmm10,32(%rsp)
1771 .byte 102,68,15,58,15,210,8
1788 movdqa %xmm8,48(%rsp)
1815 .byte 102,68,15,58,15,195,8
1832 movdqa %xmm9,0(%rsp)
1859 .byte 102,68,15,58,15,204,8
1876 movdqa %xmm10,16(%rsp)
1919 .byte 102,68,15,58,15,213,8
1926 movdqa 48(%r11),%xmm9
1936 movdqa %xmm8,32(%rsp)
1979 .byte 102,68,15,58,15,198,8
1996 movdqa %xmm9,48(%rsp)
2039 .byte 102,68,15,58,15,207,8
2056 movdqa %xmm10,0(%rsp)
2099 .byte 102,68,15,58,15,208,8
2116 movdqa %xmm8,16(%rsp)
2159 .byte 102,68,15,58,15,193,8
2176 movdqa %xmm9,32(%rsp)
2206 movdqa %xmm10,48(%rsp)
2236 movdqa 64(%r11),%xmm6
2237 movdqa 0(%r11),%xmm9
2239 movdqu 16(%r9),%xmm1
2240 movdqu 32(%r9),%xmm2
2241 movdqu 48(%r9),%xmm3
2242 .byte 102,15,56,0,198
2246 .byte 102,15,56,0,206
2254 movdqa %xmm0,0(%rsp)
2282 .byte 102,15,56,0,214
2290 movdqa %xmm1,16(%rsp)
2318 .byte 102,15,56,0,222
2326 movdqa %xmm2,32(%rsp)
2480 .size sha1_block_data_order_ssse3,.-sha1_block_data_order_ssse3
2481 .type sha1_block_data_order_avx,@function
2483 sha1_block_data_order_avx:
2496 leaq K_XX_XX(%rip),%r11
2505 vmovdqa 64(%r11),%xmm6
2506 vmovdqa 0(%r11),%xmm9
2507 vmovdqu 0(%r9),%xmm0
2508 vmovdqu 16(%r9),%xmm1
2509 vmovdqu 32(%r9),%xmm2
2510 vmovdqu 48(%r9),%xmm3
2511 vpshufb %xmm6,%xmm0,%xmm0
2513 vpshufb %xmm6,%xmm1,%xmm1
2514 vpshufb %xmm6,%xmm2,%xmm2
2515 vpshufb %xmm6,%xmm3,%xmm3
2516 vpaddd %xmm9,%xmm0,%xmm4
2517 vpaddd %xmm9,%xmm1,%xmm5
2518 vpaddd %xmm9,%xmm2,%xmm6
2519 vmovdqa %xmm4,0(%rsp)
2520 vmovdqa %xmm5,16(%rsp)
2521 vmovdqa %xmm6,32(%rsp)
2527 vpalignr $8,%xmm0,%xmm1,%xmm4
2530 vpaddd %xmm3,%xmm9,%xmm9
2533 vpsrldq $4,%xmm3,%xmm8
2536 vpxor %xmm0,%xmm4,%xmm4
2539 vpxor %xmm2,%xmm8,%xmm8
2544 vpxor %xmm8,%xmm4,%xmm4
2547 vmovdqa %xmm9,48(%rsp)
2550 vpsrld $31,%xmm4,%xmm8
2555 vpslldq $12,%xmm4,%xmm10
2556 vpaddd %xmm4,%xmm4,%xmm4
2561 vpsrld $30,%xmm10,%xmm9
2562 vpor %xmm8,%xmm4,%xmm4
2567 vpslld $2,%xmm10,%xmm10
2568 vpxor %xmm9,%xmm4,%xmm4
2573 vpxor %xmm10,%xmm4,%xmm4
2576 vmovdqa 0(%r11),%xmm10
2583 vpalignr $8,%xmm1,%xmm2,%xmm5
2586 vpaddd %xmm4,%xmm10,%xmm10
2589 vpsrldq $4,%xmm4,%xmm9
2592 vpxor %xmm1,%xmm5,%xmm5
2595 vpxor %xmm3,%xmm9,%xmm9
2600 vpxor %xmm9,%xmm5,%xmm5
2603 vmovdqa %xmm10,0(%rsp)
2606 vpsrld $31,%xmm5,%xmm9
2611 vpslldq $12,%xmm5,%xmm8
2612 vpaddd %xmm5,%xmm5,%xmm5
2617 vpsrld $30,%xmm8,%xmm10
2618 vpor %xmm9,%xmm5,%xmm5
2623 vpslld $2,%xmm8,%xmm8
2624 vpxor %xmm10,%xmm5,%xmm5
2629 vpxor %xmm8,%xmm5,%xmm5
2632 vmovdqa 16(%r11),%xmm8
2639 vpalignr $8,%xmm2,%xmm3,%xmm6
2642 vpaddd %xmm5,%xmm8,%xmm8
2645 vpsrldq $4,%xmm5,%xmm10
2648 vpxor %xmm2,%xmm6,%xmm6
2651 vpxor %xmm4,%xmm10,%xmm10
2656 vpxor %xmm10,%xmm6,%xmm6
2659 vmovdqa %xmm8,16(%rsp)
2662 vpsrld $31,%xmm6,%xmm10
2667 vpslldq $12,%xmm6,%xmm9
2668 vpaddd %xmm6,%xmm6,%xmm6
2673 vpsrld $30,%xmm9,%xmm8
2674 vpor %xmm10,%xmm6,%xmm6
2679 vpslld $2,%xmm9,%xmm9
2680 vpxor %xmm8,%xmm6,%xmm6
2685 vpxor %xmm9,%xmm6,%xmm6
2688 vmovdqa 16(%r11),%xmm9
2695 vpalignr $8,%xmm3,%xmm4,%xmm7
2698 vpaddd %xmm6,%xmm9,%xmm9
2701 vpsrldq $4,%xmm6,%xmm8
2704 vpxor %xmm3,%xmm7,%xmm7
2707 vpxor %xmm5,%xmm8,%xmm8
2712 vpxor %xmm8,%xmm7,%xmm7
2715 vmovdqa %xmm9,32(%rsp)
2718 vpsrld $31,%xmm7,%xmm8
2723 vpslldq $12,%xmm7,%xmm10
2724 vpaddd %xmm7,%xmm7,%xmm7
2729 vpsrld $30,%xmm10,%xmm9
2730 vpor %xmm8,%xmm7,%xmm7
2735 vpslld $2,%xmm10,%xmm10
2736 vpxor %xmm9,%xmm7,%xmm7
2741 vpxor %xmm10,%xmm7,%xmm7
2744 vmovdqa 16(%r11),%xmm10
2749 vpalignr $8,%xmm6,%xmm7,%xmm9
2750 vpxor %xmm4,%xmm0,%xmm0
2755 vpxor %xmm1,%xmm0,%xmm0
2758 vmovdqa %xmm10,%xmm8
2759 vpaddd %xmm7,%xmm10,%xmm10
2762 vpxor %xmm9,%xmm0,%xmm0
2767 vpsrld $30,%xmm0,%xmm9
2768 vmovdqa %xmm10,48(%rsp)
2773 vpslld $2,%xmm0,%xmm0
2782 vpor %xmm9,%xmm0,%xmm0
2785 vmovdqa %xmm0,%xmm10
2800 vpalignr $8,%xmm7,%xmm0,%xmm10
2801 vpxor %xmm5,%xmm1,%xmm1
2806 vpxor %xmm2,%xmm1,%xmm1
2810 vpaddd %xmm0,%xmm8,%xmm8
2813 vpxor %xmm10,%xmm1,%xmm1
2818 vpsrld $30,%xmm1,%xmm10
2819 vmovdqa %xmm8,0(%rsp)
2824 vpslld $2,%xmm1,%xmm1
2833 vpor %xmm10,%xmm1,%xmm1
2843 vpalignr $8,%xmm0,%xmm1,%xmm8
2844 vpxor %xmm6,%xmm2,%xmm2
2849 vpxor %xmm3,%xmm2,%xmm2
2852 vmovdqa 32(%r11),%xmm10
2853 vpaddd %xmm1,%xmm9,%xmm9
2856 vpxor %xmm8,%xmm2,%xmm2
2861 vpsrld $30,%xmm2,%xmm8
2862 vmovdqa %xmm9,16(%rsp)
2867 vpslld $2,%xmm2,%xmm2
2876 vpor %xmm8,%xmm2,%xmm2
2886 vpalignr $8,%xmm1,%xmm2,%xmm9
2887 vpxor %xmm7,%xmm3,%xmm3
2892 vpxor %xmm4,%xmm3,%xmm3
2895 vmovdqa %xmm10,%xmm8
2896 vpaddd %xmm2,%xmm10,%xmm10
2899 vpxor %xmm9,%xmm3,%xmm3
2904 vpsrld $30,%xmm3,%xmm9
2905 vmovdqa %xmm10,32(%rsp)
2910 vpslld $2,%xmm3,%xmm3
2919 vpor %xmm9,%xmm3,%xmm3
2922 vmovdqa %xmm3,%xmm10
2929 vpalignr $8,%xmm2,%xmm3,%xmm10
2930 vpxor %xmm0,%xmm4,%xmm4
2935 vpxor %xmm5,%xmm4,%xmm4
2939 vpaddd %xmm3,%xmm8,%xmm8
2942 vpxor %xmm10,%xmm4,%xmm4
2947 vpsrld $30,%xmm4,%xmm10
2948 vmovdqa %xmm8,48(%rsp)
2953 vpslld $2,%xmm4,%xmm4
2962 vpor %xmm10,%xmm4,%xmm4
2972 vpalignr $8,%xmm3,%xmm4,%xmm8
2973 vpxor %xmm1,%xmm5,%xmm5
2978 vpxor %xmm6,%xmm5,%xmm5
2981 vmovdqa %xmm9,%xmm10
2982 vpaddd %xmm4,%xmm9,%xmm9
2985 vpxor %xmm8,%xmm5,%xmm5
2990 vpsrld $30,%xmm5,%xmm8
2991 vmovdqa %xmm9,0(%rsp)
2996 vpslld $2,%xmm5,%xmm5
3005 vpor %xmm8,%xmm5,%xmm5
3015 vpalignr $8,%xmm4,%xmm5,%xmm9
3016 vpxor %xmm2,%xmm6,%xmm6
3021 vpxor %xmm7,%xmm6,%xmm6
3024 vmovdqa %xmm10,%xmm8
3025 vpaddd %xmm5,%xmm10,%xmm10
3028 vpxor %xmm9,%xmm6,%xmm6
3033 vpsrld $30,%xmm6,%xmm9
3034 vmovdqa %xmm10,16(%rsp)
3039 vpslld $2,%xmm6,%xmm6
3048 vpor %xmm9,%xmm6,%xmm6
3051 vmovdqa %xmm6,%xmm10
3074 vpalignr $8,%xmm5,%xmm6,%xmm10
3075 vpxor %xmm3,%xmm7,%xmm7
3080 vpxor %xmm0,%xmm7,%xmm7
3083 vmovdqa 48(%r11),%xmm9
3084 vpaddd %xmm6,%xmm8,%xmm8
3087 vpxor %xmm10,%xmm7,%xmm7
3092 vpsrld $30,%xmm7,%xmm10
3093 vmovdqa %xmm8,32(%rsp)
3098 vpslld $2,%xmm7,%xmm7
3107 vpor %xmm10,%xmm7,%xmm7
3133 vpalignr $8,%xmm6,%xmm7,%xmm8
3134 vpxor %xmm4,%xmm0,%xmm0
3139 vpxor %xmm1,%xmm0,%xmm0
3142 vmovdqa %xmm9,%xmm10
3143 vpaddd %xmm7,%xmm9,%xmm9
3146 vpxor %xmm8,%xmm0,%xmm0
3151 vpsrld $30,%xmm0,%xmm8
3152 vmovdqa %xmm9,48(%rsp)
3157 vpslld $2,%xmm0,%xmm0
3166 vpor %xmm8,%xmm0,%xmm0
3192 vpalignr $8,%xmm7,%xmm0,%xmm9
3193 vpxor %xmm5,%xmm1,%xmm1
3198 vpxor %xmm2,%xmm1,%xmm1
3201 vmovdqa %xmm10,%xmm8
3202 vpaddd %xmm0,%xmm10,%xmm10
3205 vpxor %xmm9,%xmm1,%xmm1
3210 vpsrld $30,%xmm1,%xmm9
3211 vmovdqa %xmm10,0(%rsp)
3216 vpslld $2,%xmm1,%xmm1
3225 vpor %xmm9,%xmm1,%xmm1
3228 vmovdqa %xmm1,%xmm10
3251 vpalignr $8,%xmm0,%xmm1,%xmm10
3252 vpxor %xmm6,%xmm2,%xmm2
3257 vpxor %xmm3,%xmm2,%xmm2
3261 vpaddd %xmm1,%xmm8,%xmm8
3264 vpxor %xmm10,%xmm2,%xmm2
3269 vpsrld $30,%xmm2,%xmm10
3270 vmovdqa %xmm8,16(%rsp)
3275 vpslld $2,%xmm2,%xmm2
3284 vpor %xmm10,%xmm2,%xmm2
3310 vpalignr $8,%xmm1,%xmm2,%xmm8
3311 vpxor %xmm7,%xmm3,%xmm3
3316 vpxor %xmm4,%xmm3,%xmm3
3319 vmovdqa %xmm9,%xmm10
3320 vpaddd %xmm2,%xmm9,%xmm9
3323 vpxor %xmm8,%xmm3,%xmm3
3328 vpsrld $30,%xmm3,%xmm8
3329 vmovdqa %xmm9,32(%rsp)
3334 vpslld $2,%xmm3,%xmm3
3343 vpor %xmm8,%xmm3,%xmm3
3353 vpaddd %xmm3,%xmm10,%xmm10
3358 movdqa %xmm10,48(%rsp)
3388 vmovdqa 64(%r11),%xmm6
3389 vmovdqa 0(%r11),%xmm9
3390 vmovdqu 0(%r9),%xmm0
3391 vmovdqu 16(%r9),%xmm1
3392 vmovdqu 32(%r9),%xmm2
3393 vmovdqu 48(%r9),%xmm3
3394 vpshufb %xmm6,%xmm0,%xmm0
3398 vpshufb %xmm6,%xmm1,%xmm1
3401 vpaddd %xmm9,%xmm0,%xmm4
3406 vmovdqa %xmm4,0(%rsp)
3433 vpshufb %xmm6,%xmm2,%xmm2
3436 vpaddd %xmm9,%xmm1,%xmm5
3441 vmovdqa %xmm5,16(%rsp)
3468 vpshufb %xmm6,%xmm3,%xmm3
3471 vpaddd %xmm9,%xmm2,%xmm6
3476 vmovdqa %xmm6,32(%rsp)
3631 .size sha1_block_data_order_avx,.-sha1_block_data_order_avx
3634 .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999
3635 .long 0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
3636 .long 0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
3637 .long 0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
3638 .long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
3639 .byte 83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0