From 2e8d424dccc34c05cbfb0c09d4ff0332a3e4a060 Mon Sep 17 00:00:00 2001 From: Dan Pittman Date: Fri, 20 Sep 2024 14:08:23 -0700 Subject: [PATCH] universal abi used in amm functions, no need for OS dffn --- crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl | 4 +--- crypto/fipsmodule/bn/asm/rsaz-3k-avx512.pl | 5 ++--- crypto/fipsmodule/bn/asm/rsaz-4k-avx512.pl | 4 +--- crypto/fipsmodule/cpucap/internal.h | 6 ++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl b/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl index 7d780ece642..43df28261e1 100644 --- a/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl +++ b/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl @@ -76,9 +76,7 @@ if ($avx512ifma>0) {{{ -@_6_args_universal_ABI = $win64 ? -("%rcx","%rdx","%r8","%r9","%r10","%r11") : -("%rdi","%rsi","%rdx","%rcx","%r8","%r9"); +@_6_args_universal_ABI = ("%rdi","%rsi","%rdx","%rcx","%r8","%r9"); ############################################################################### # void rsaz_amm52x20_x1_ifma256(BN_ULONG *res, diff --git a/crypto/fipsmodule/bn/asm/rsaz-3k-avx512.pl b/crypto/fipsmodule/bn/asm/rsaz-3k-avx512.pl index a3fde129640..d2573e059e7 100644 --- a/crypto/fipsmodule/bn/asm/rsaz-3k-avx512.pl +++ b/crypto/fipsmodule/bn/asm/rsaz-3k-avx512.pl @@ -74,9 +74,8 @@ *STDOUT=*OUT; if ($avx512ifma>0) {{{ -@_6_args_universal_ABI = $win64 ? -("%rcx","%rdx","%r8","%r9","%r10","%r11") : -("%rdi","%rsi","%rdx","%rcx","%r8","%r9"); + +@_6_args_universal_ABI = ("%rdi","%rsi","%rdx","%rcx","%r8","%r9"); ############################################################################### # void rsaz_amm52x30_x1_ifma256(BN_ULONG *res, diff --git a/crypto/fipsmodule/bn/asm/rsaz-4k-avx512.pl b/crypto/fipsmodule/bn/asm/rsaz-4k-avx512.pl index e8729eb84ec..c3deafe987e 100644 --- a/crypto/fipsmodule/bn/asm/rsaz-4k-avx512.pl +++ b/crypto/fipsmodule/bn/asm/rsaz-4k-avx512.pl @@ -74,9 +74,7 @@ *STDOUT=*OUT; if ($avx512ifma>0) {{{ -@_6_args_universal_ABI = $win64 ? -("%rcx","%rdx","%r8","%r9","%r10","%r11") : -("%rdi","%rsi","%rdx","%rcx","%r8","%r9"); +@_6_args_universal_ABI = ("%rdi","%rsi","%rdx","%rcx","%r8","%r9"); ############################################################################### # void rsaz_amm52x40_x1_ifma256(BN_ULONG *res, diff --git a/crypto/fipsmodule/cpucap/internal.h b/crypto/fipsmodule/cpucap/internal.h index fd4690e3c9c..12e93ebcf8c 100644 --- a/crypto/fipsmodule/cpucap/internal.h +++ b/crypto/fipsmodule/cpucap/internal.h @@ -140,10 +140,8 @@ OPENSSL_INLINE int CRYPTO_is_VPCLMULQDQ_capable(void) { // 1100_0000_0010_0011_0000_0000_0000_0000 #define CPU_CAP_AVX512IFMA_BITFLAGS 0xC0230000 OPENSSL_INLINE int CRYPTO_is_AVX512IFMA_capable(void) { - return 0; -// TODO: Re-enable once we understand Windows test failures. -// return (OPENSSL_ia32cap_get()[2] & CPU_CAP_AVX512IFMA_BITFLAGS) == -// CPU_CAP_AVX512IFMA_BITFLAGS; + return (OPENSSL_ia32cap_get()[2] & CPU_CAP_AVX512IFMA_BITFLAGS) == + CPU_CAP_AVX512IFMA_BITFLAGS; } OPENSSL_INLINE int CRYPTO_is_VBMI2_capable(void) {