about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/ifunc-avx2.h
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2022-10-03 23:46:11 +0200
committerAurelien Jarno <aurelien@aurel32.net>2022-10-03 23:46:11 +0200
commit7e8283170c5d6805b609a040801d819e362a6292 (patch)
treefaabe13505d48c0b933f175b088794beb9028072 /sysdeps/x86_64/multiarch/ifunc-avx2.h
parent3c0c78afabfed4b6fc161c159e628fbf14ff370b (diff)
downloadglibc-7e8283170c5d6805b609a040801d819e362a6292.tar.gz
glibc-7e8283170c5d6805b609a040801d819e362a6292.tar.xz
glibc-7e8283170c5d6805b609a040801d819e362a6292.zip
x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr implementations
The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk'
instruction which belongs to the BMI1 CPU feature and the 'shrx'
instruction, which belongs to the BMI2 CPU feature.

Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2")
Partially resolves: BZ #29611

Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
Diffstat (limited to 'sysdeps/x86_64/multiarch/ifunc-avx2.h')
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-avx2.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
index f1741083fd..f2f5e8a211 100644
--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
+++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void)
   const struct cpu_features *cpu_features = __get_cpu_features ();
 
   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
+      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1)
       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,