diff options
Diffstat (limited to 'sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h')
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h index a5f9375afc..c5924309c9 100644 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <init-arch.h> +#include <x86-math-features.h> extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (avx) attribute_hidden; @@ -27,16 +28,14 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (fma4) attribute_hidden; static inline void * IFUNC_SELECTOR (void) { - const struct cpu_features* cpu_features = __get_cpu_features (); + unsigned int features = __x86_math_features (); - if (CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable) - && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)) + if ((features & x86_math_feature_fma) + && (features & x86_math_feature_avx2)) return OPTIMIZE (fma); - - if (CPU_FEATURES_ARCH_P (cpu_features, FMA4_Usable)) + if (features & x86_math_feature_fma4) return OPTIMIZE (fma4); - - if (CPU_FEATURES_ARCH_P (cpu_features, AVX_Usable)) + if (features & x86_math_feature_avx) return OPTIMIZE (avx); return OPTIMIZE (sse2); |