diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-03-07 09:44:18 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-03-29 07:40:17 -0700 |
commit | 4e2d8f352774b56078c34648b14a2412c38384f4 (patch) | |
tree | cafad171d93e598b9c6a1a0457853f6cdc98bf1d /sysdeps/x86_64/multiarch/ifunc-memset.h | |
parent | 4bd660be40967cd69072f69ebc2ad32bfcc1f206 (diff) | |
download | glibc-4e2d8f352774b56078c34648b14a2412c38384f4.zip glibc-4e2d8f352774b56078c34648b14a2412c38384f4.tar.gz glibc-4e2d8f352774b56078c34648b14a2412c38384f4.tar.bz2 |
x86-64: Use ZMM16-ZMM31 in AVX512 memset family functions
Update ifunc-memset.h/ifunc-wmemset.h to select the function optimized
with AVX512 instructions using ZMM16-ZMM31 registers to avoid RTM abort
with usable AVX512VL and AVX512BW since VZEROUPPER isn't needed at
function exit.
Diffstat (limited to 'sysdeps/x86_64/multiarch/ifunc-memset.h')
-rw-r--r-- | sysdeps/x86_64/multiarch/ifunc-memset.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sysdeps/x86_64/multiarch/ifunc-memset.h b/sysdeps/x86_64/multiarch/ifunc-memset.h index 43655fb..502f946 100644 --- a/sysdeps/x86_64/multiarch/ifunc-memset.h +++ b/sysdeps/x86_64/multiarch/ifunc-memset.h @@ -53,13 +53,16 @@ IFUNC_SELECTOR (void) if (CPU_FEATURE_USABLE_P (cpu_features, AVX512F) && !CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_AVX512)) { - if (CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)) - return OPTIMIZE (avx512_no_vzeroupper); + if (CPU_FEATURE_USABLE_P (cpu_features, AVX512VL) + && CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)) + { + if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) + return OPTIMIZE (avx512_unaligned_erms); - if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) - return OPTIMIZE (avx512_unaligned_erms); + return OPTIMIZE (avx512_unaligned); + } - return OPTIMIZE (avx512_unaligned); + return OPTIMIZE (avx512_no_vzeroupper); } if (CPU_FEATURE_USABLE_P (cpu_features, AVX2)) |