about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h')
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
index 1857e1f760..fffc9da114 100644
--- a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
@@ -32,11 +32,14 @@ IFUNC_SELECTOR (void)
 {
   const struct cpu_features* cpu_features = __get_cpu_features ();
 
-  if (CPU_FEATURES_ARCH_P (cpu_features, AVX512DQ_Usable))
-    return OPTIMIZE (skx);
-
-  if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable))
-    return OPTIMIZE (knl);
+  if (!CPU_FEATURES_ARCH_P (cpu_features, MathVec_Prefer_No_AVX512))
+    {
+      if (CPU_FEATURES_ARCH_P (cpu_features, AVX512DQ_Usable))
+	return OPTIMIZE (skx);
+
+      if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable))
+	return OPTIMIZE (knl);
+    }
 
   return OPTIMIZE (avx2_wrapper);
 }