.. | .. |
---|
109 | 109 | my ($name, $align, $nargs) = @_; |
---|
110 | 110 | if($kernel) { |
---|
111 | 111 | $code .= ".align $align\n"; |
---|
112 | | - $code .= "ENTRY($name)\n"; |
---|
| 112 | + $code .= "SYM_FUNC_START($name)\n"; |
---|
113 | 113 | $code .= ".L$name:\n"; |
---|
114 | 114 | } else { |
---|
115 | 115 | $code .= ".globl $name\n"; |
---|
.. | .. |
---|
122 | 122 | sub end_function() { |
---|
123 | 123 | my ($name) = @_; |
---|
124 | 124 | if($kernel) { |
---|
125 | | - $code .= "ENDPROC($name)\n"; |
---|
| 125 | + $code .= "SYM_FUNC_END($name)\n"; |
---|
126 | 126 | } else { |
---|
127 | 127 | $code .= ".size $name,.-$name\n"; |
---|
128 | 128 | } |
---|
.. | .. |
---|
297 | 297 | $code.=<<___; |
---|
298 | 298 | mov \$1,%eax |
---|
299 | 299 | .Lno_key: |
---|
300 | | - ret |
---|
| 300 | + RET |
---|
301 | 301 | ___ |
---|
302 | 302 | &end_function("poly1305_init_x86_64"); |
---|
303 | 303 | |
---|
.. | .. |
---|
373 | 373 | .cfi_adjust_cfa_offset -48 |
---|
374 | 374 | .Lno_data: |
---|
375 | 375 | .Lblocks_epilogue: |
---|
376 | | - ret |
---|
| 376 | + RET |
---|
377 | 377 | .cfi_endproc |
---|
378 | 378 | ___ |
---|
379 | 379 | &end_function("poly1305_blocks_x86_64"); |
---|
.. | .. |
---|
399 | 399 | mov %rax,0($mac) # write result |
---|
400 | 400 | mov %rcx,8($mac) |
---|
401 | 401 | |
---|
402 | | - ret |
---|
| 402 | + RET |
---|
403 | 403 | ___ |
---|
404 | 404 | &end_function("poly1305_emit_x86_64"); |
---|
405 | 405 | if ($avx) { |
---|
406 | | - |
---|
407 | | -if($kernel) { |
---|
408 | | - $code .= "#ifdef CONFIG_AS_AVX\n"; |
---|
409 | | -} |
---|
410 | 406 | |
---|
411 | 407 | ######################################################################## |
---|
412 | 408 | # Layout of opaque area is following. |
---|
.. | .. |
---|
433 | 429 | &poly1305_iteration(); |
---|
434 | 430 | $code.=<<___; |
---|
435 | 431 | pop $ctx |
---|
436 | | - ret |
---|
| 432 | + RET |
---|
437 | 433 | .size __poly1305_block,.-__poly1305_block |
---|
438 | 434 | |
---|
439 | 435 | .type __poly1305_init_avx,\@abi-omnipotent |
---|
.. | .. |
---|
598 | 594 | |
---|
599 | 595 | lea -48-64($ctx),$ctx # size [de-]optimization |
---|
600 | 596 | pop %rbp |
---|
601 | | - ret |
---|
| 597 | + RET |
---|
602 | 598 | .size __poly1305_init_avx,.-__poly1305_init_avx |
---|
603 | 599 | ___ |
---|
604 | 600 | |
---|
.. | .. |
---|
751 | 747 | .cfi_restore %rbp |
---|
752 | 748 | .Lno_data_avx: |
---|
753 | 749 | .Lblocks_avx_epilogue: |
---|
754 | | - ret |
---|
| 750 | + RET |
---|
755 | 751 | .cfi_endproc |
---|
756 | 752 | |
---|
757 | 753 | .align 32 |
---|
.. | .. |
---|
1456 | 1452 | ___ |
---|
1457 | 1453 | $code.=<<___; |
---|
1458 | 1454 | vzeroupper |
---|
1459 | | - ret |
---|
| 1455 | + RET |
---|
1460 | 1456 | .cfi_endproc |
---|
1461 | 1457 | ___ |
---|
1462 | 1458 | &end_function("poly1305_blocks_avx"); |
---|
.. | .. |
---|
1512 | 1508 | mov %rax,0($mac) # write result |
---|
1513 | 1509 | mov %rcx,8($mac) |
---|
1514 | 1510 | |
---|
1515 | | - ret |
---|
| 1511 | + RET |
---|
1516 | 1512 | ___ |
---|
1517 | 1513 | &end_function("poly1305_emit_avx"); |
---|
1518 | 1514 | |
---|
1519 | | -if ($kernel) { |
---|
1520 | | - $code .= "#endif\n"; |
---|
1521 | | -} |
---|
1522 | | - |
---|
1523 | 1515 | if ($avx>1) { |
---|
1524 | | - |
---|
1525 | | -if ($kernel) { |
---|
1526 | | - $code .= "#ifdef CONFIG_AS_AVX2\n"; |
---|
1527 | | -} |
---|
1528 | 1516 | |
---|
1529 | 1517 | my ($H0,$H1,$H2,$H3,$H4, $MASK, $T4,$T0,$T1,$T2,$T3, $D0,$D1,$D2,$D3,$D4) = |
---|
1530 | 1518 | map("%ymm$_",(0..15)); |
---|
.. | .. |
---|
1687 | 1675 | .cfi_restore %rbp |
---|
1688 | 1676 | .Lno_data_avx2$suffix: |
---|
1689 | 1677 | .Lblocks_avx2_epilogue$suffix: |
---|
1690 | | - ret |
---|
| 1678 | + RET |
---|
1691 | 1679 | .cfi_endproc |
---|
1692 | 1680 | |
---|
1693 | 1681 | .align 32 |
---|
.. | .. |
---|
2213 | 2201 | ___ |
---|
2214 | 2202 | $code.=<<___; |
---|
2215 | 2203 | vzeroupper |
---|
2216 | | - ret |
---|
| 2204 | + RET |
---|
2217 | 2205 | .cfi_endproc |
---|
2218 | 2206 | ___ |
---|
2219 | 2207 | if($avx > 2 && $avx512) { |
---|
.. | .. |
---|
2804 | 2792 | .cfi_def_cfa_register %rsp |
---|
2805 | 2793 | ___ |
---|
2806 | 2794 | $code.=<<___; |
---|
2807 | | - ret |
---|
| 2795 | + RET |
---|
2808 | 2796 | .cfi_endproc |
---|
2809 | 2797 | ___ |
---|
2810 | 2798 | |
---|
.. | .. |
---|
2815 | 2803 | &declare_function("poly1305_blocks_avx2", 32, 4); |
---|
2816 | 2804 | poly1305_blocks_avxN(0); |
---|
2817 | 2805 | &end_function("poly1305_blocks_avx2"); |
---|
2818 | | - |
---|
2819 | | -if($kernel) { |
---|
2820 | | - $code .= "#endif\n"; |
---|
2821 | | -} |
---|
2822 | 2806 | |
---|
2823 | 2807 | ####################################################################### |
---|
2824 | 2808 | if ($avx>2) { |
---|
.. | .. |
---|
2909 | 2893 | ___ |
---|
2910 | 2894 | $code.=<<___; |
---|
2911 | 2895 | mov \$1,%eax |
---|
2912 | | - ret |
---|
| 2896 | + RET |
---|
2913 | 2897 | .size poly1305_init_base2_44,.-poly1305_init_base2_44 |
---|
2914 | 2898 | ___ |
---|
2915 | 2899 | { |
---|
.. | .. |
---|
3026 | 3010 | jnz .Lblocks_vpmadd52_4x |
---|
3027 | 3011 | |
---|
3028 | 3012 | .Lno_data_vpmadd52: |
---|
3029 | | - ret |
---|
| 3013 | + RET |
---|
3030 | 3014 | .size poly1305_blocks_vpmadd52,.-poly1305_blocks_vpmadd52 |
---|
3031 | 3015 | ___ |
---|
3032 | 3016 | } |
---|
.. | .. |
---|
3467 | 3451 | vzeroall |
---|
3468 | 3452 | |
---|
3469 | 3453 | .Lno_data_vpmadd52_4x: |
---|
3470 | | - ret |
---|
| 3454 | + RET |
---|
3471 | 3455 | .size poly1305_blocks_vpmadd52_4x,.-poly1305_blocks_vpmadd52_4x |
---|
3472 | 3456 | ___ |
---|
3473 | 3457 | } |
---|
.. | .. |
---|
3840 | 3824 | vzeroall |
---|
3841 | 3825 | |
---|
3842 | 3826 | .Lno_data_vpmadd52_8x: |
---|
3843 | | - ret |
---|
| 3827 | + RET |
---|
3844 | 3828 | .size poly1305_blocks_vpmadd52_8x,.-poly1305_blocks_vpmadd52_8x |
---|
3845 | 3829 | ___ |
---|
3846 | 3830 | } |
---|
.. | .. |
---|
3877 | 3861 | mov %rax,0($mac) # write result |
---|
3878 | 3862 | mov %rcx,8($mac) |
---|
3879 | 3863 | |
---|
3880 | | - ret |
---|
| 3864 | + RET |
---|
3881 | 3865 | .size poly1305_emit_base2_44,.-poly1305_emit_base2_44 |
---|
3882 | 3866 | ___ |
---|
3883 | 3867 | } } } |
---|
.. | .. |
---|
3932 | 3916 | |
---|
3933 | 3917 | .Ldone_enc: |
---|
3934 | 3918 | mov $otp,%rax |
---|
3935 | | - ret |
---|
| 3919 | + RET |
---|
3936 | 3920 | .size xor128_encrypt_n_pad,.-xor128_encrypt_n_pad |
---|
3937 | 3921 | |
---|
3938 | 3922 | .globl xor128_decrypt_n_pad |
---|
.. | .. |
---|
3983 | 3967 | |
---|
3984 | 3968 | .Ldone_dec: |
---|
3985 | 3969 | mov $otp,%rax |
---|
3986 | | - ret |
---|
| 3970 | + RET |
---|
3987 | 3971 | .size xor128_decrypt_n_pad,.-xor128_decrypt_n_pad |
---|
3988 | 3972 | ___ |
---|
3989 | 3973 | } |
---|
.. | .. |
---|
4125 | 4109 | pop %rbx |
---|
4126 | 4110 | pop %rdi |
---|
4127 | 4111 | pop %rsi |
---|
4128 | | - ret |
---|
| 4112 | + RET |
---|
4129 | 4113 | .size avx_handler,.-avx_handler |
---|
4130 | 4114 | |
---|
4131 | 4115 | .section .pdata |
---|