local-require-bmi-in-avx2-ifunc
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Fri, 14 Oct 2022 19:35:00 +0000 (20:35 +0100)
committerAurelien Jarno <aurel32@debian.org>
Fri, 14 Oct 2022 19:35:00 +0000 (20:35 +0100)
This patch is extracted from upstream commit 83c5b368226c ("x86-64: Require

This patch is extracted from upstream commit 83c5b368226c ("x86-64: Require
BMI2 for strchr-avx2.S"). It changes the common ifunc AVX2 selector to require
the BMI2 instructions, and the backported fixes for memchr and strlen rely on
that change.

Gbp-Pq: Topic amd64
Gbp-Pq: Name local-require-bmi-in-avx2-ifunc.diff

sysdeps/x86_64/multiarch/ifunc-avx2.h

index 74189b6aa5abb3b0d80b902945600a46096833aa..925e5b61eb6384016e5867bbd0ef6510720cbad9 100644 (file)
@@ -30,11 +30,11 @@ IFUNC_SELECTOR (void)
   const struct cpu_features* cpu_features = __get_cpu_features ();
 
   if (CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+      && CPU_FEATURES_CPU_P (cpu_features, BMI2)
       && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
     {
       if (CPU_FEATURES_ARCH_P (cpu_features, AVX512VL_Usable)
-         && CPU_FEATURES_ARCH_P (cpu_features, AVX512BW_Usable)
-         && CPU_FEATURES_CPU_P (cpu_features, BMI2))
+         && CPU_FEATURES_ARCH_P (cpu_features, AVX512BW_Usable))
        return OPTIMIZE (evex);
 
       if (CPU_FEATURES_CPU_P (cpu_features, RTM))