From: dan pittman Date: Tue, 25 Feb 2025 01:29:15 +0000 (-0800) Subject: fix windows calling convention in aesni-xts-avx512 X-Git-Tag: openssl-3.5.0-alpha1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddc8529e872348ad47df2ba55ffac1626637fa54;p=thirdparty%2Fopenssl.git fix windows calling convention in aesni-xts-avx512 Reviewed-by: Neil Horman Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/26410) --- diff --git a/crypto/aes/asm/aesni-xts-avx512.pl b/crypto/aes/asm/aesni-xts-avx512.pl index b821c6ddecf..55cbb14c66f 100644 --- a/crypto/aes/asm/aesni-xts-avx512.pl +++ b/crypto/aes/asm/aesni-xts-avx512.pl @@ -66,7 +66,7 @@ open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\"" if ($avx512vaes) { my $GP_STORAGE = $win64 ? (16 * 18) : (16 * 8); # store rbx - my $XMM_STORAGE = $win64 ? (16 * 23) : 0; # store xmm6:xmm15 + my $XMM_STORAGE = $win64 ? (16 * 8) : 0; # store xmm6:xmm15 my $VARIABLE_OFFSET = $win64 ? (16*8 + 16*10 + 8*3) : (16*8 + 8*1); @@ -83,33 +83,19 @@ if ($avx512vaes) { # ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; my ($key2, $key1, $tweak, $length, $input, $output); - if ($win64) { - $input = "%rcx"; - $output = "%rdx"; - $length = "%r8"; - $key1 = "%r9"; - $key2 = "%r10"; - $tweak = "%r11"; - } else { - $input = "%rdi"; - $output = "%rsi"; - $length = "%rdx"; - $key1 = "%rcx"; - $key2 = "%r8"; - $tweak = "%r9"; - } + +$input = "%rdi"; +$output = "%rsi"; +$length = "%rdx"; +$key1 = "%rcx"; +$key2 = "%r8"; +$tweak = "%r9"; # arguments for temp parameters my ($tmp1, $gf_poly_8b, $gf_poly_8b_temp); - if ($win64) { - $tmp1 = "%r10"; - $gf_poly_8b = "%rdi"; - $gf_poly_8b_temp = "%rsi"; - } else { $tmp1 = "%r8"; $gf_poly_8b = "%r10"; $gf_poly_8b_temp = "%r11"; - } # ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; # ;;; Helper functions @@ -1153,7 +1139,7 @@ ___ $code.=<<___; .globl aesni_xts_128_encrypt_avx512 .hidden aesni_xts_128_encrypt_avx512 - .type aesni_xts_128_encrypt_avx512,\@abi-omnipotent + .type aesni_xts_128_encrypt_avx512,\@function,6 .align 32 aesni_xts_128_encrypt_avx512: .cfi_startproc @@ -1163,7 +1149,7 @@ ___ $code.=<<___; .globl aesni_xts_256_encrypt_avx512 .hidden aesni_xts_256_encrypt_avx512 - .type aesni_xts_256_encrypt_avx512,\@abi-omnipotent + .type aesni_xts_256_encrypt_avx512,\@function,6 .align 32 aesni_xts_256_encrypt_avx512: .cfi_startproc @@ -1836,7 +1822,7 @@ ___ $code.=<<___; .globl aesni_xts_128_decrypt_avx512 .hidden aesni_xts_128_decrypt_avx512 - .type aesni_xts_128_decrypt_avx512,\@abi-omnipotent + .type aesni_xts_128_decrypt_avx512,\@function,6 .align 32 aesni_xts_128_decrypt_avx512: .cfi_startproc @@ -1846,7 +1832,7 @@ ___ $code.=<<___; .globl aesni_xts_256_decrypt_avx512 .hidden aesni_xts_256_decrypt_avx512 - .type aesni_xts_256_decrypt_avx512,\@abi-omnipotent + .type aesni_xts_256_decrypt_avx512,\@function,6 .align 32 aesni_xts_256_decrypt_avx512: .cfi_startproc