]> sourceware.org Git - glibc.git/commitdiff
x86: Update F16C detection [BZ #26133]
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 18 Jun 2020 12:34:15 +0000 (05:34 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 18 Jun 2020 14:01:58 +0000 (07:01 -0700)
Since F16C requires AVX, set F16C usable only when AVX is usable.

sysdeps/x86/cpu-features.c
sysdeps/x86/cpu-features.h

index 916bbf5242675d25ebbd78afa91495182d36ea03..5b4a30e2203b7671f7a3e2ab800cf07488ec2bf0 100644 (file)
@@ -146,6 +146,10 @@ get_common_indices (struct cpu_features *cpu_features,
              if (CPU_FEATURES_CPU_P (cpu_features, XOP))
                cpu_features->feature[index_arch_XOP_Usable]
                  |= bit_arch_XOP_Usable;
+             /* Determine if F16C is usable.  */
+             if (CPU_FEATURES_CPU_P (cpu_features, F16C))
+               cpu_features->feature[index_arch_F16C_Usable]
+                 |= bit_arch_F16C_Usable;
            }
 
          /* Check if OPMASK state, upper 256-bit of ZMM0-ZMM15 and
index a5cc55d8b6f4428d198381cb8f8c3594061b8b8d..722bcdc427fd52b1cc525b524aa2fd33426cbab5 100644 (file)
@@ -142,6 +142,7 @@ extern const struct cpu_features *__get_cpu_features (void)
 #define bit_arch_VPCLMULQDQ_Usable             (1u << 20)
 #define bit_arch_XOP_Usable                    (1u << 21)
 #define bit_arch_XSAVEC_Usable                 (1u << 22)
+#define bit_arch_F16C_Usable                   (1u << 23)
 
 #define index_arch_AVX_Usable                  FEATURE_INDEX_1
 #define index_arch_AVX2_Usable                 FEATURE_INDEX_1
@@ -166,6 +167,7 @@ extern const struct cpu_features *__get_cpu_features (void)
 #define index_arch_VPCLMULQDQ_Usable           FEATURE_INDEX_1
 #define index_arch_XOP_Usable                  FEATURE_INDEX_1
 #define index_arch_XSAVEC_Usable               FEATURE_INDEX_1
+#define index_arch_F16C_Usable                 FEATURE_INDEX_1
 
 /* Unused.  Compiler will optimize them out.  */
 #define bit_arch_SSE3_Usable                   (1u << 0)
@@ -179,7 +181,6 @@ extern const struct cpu_features *__get_cpu_features (void)
 #define bit_arch_AES_Usable                    (1u << 0)
 #define bit_arch_XSAVE_Usable                  (1u << 0)
 #define bit_arch_OSXSAVE_Usable                        (1u << 0)
-#define bit_arch_F16C_Usable                   (1u << 0)
 #define bit_arch_RDRAND_Usable                 (1u << 0)
 #define bit_arch_FPU_Usable                    (1u << 0)
 #define bit_arch_TSC_Usable                    (1u << 0)
@@ -236,7 +237,6 @@ extern const struct cpu_features *__get_cpu_features (void)
 #define index_arch_AES_Usable                  FEATURE_INDEX_1
 #define index_arch_XSAVE_Usable                        FEATURE_INDEX_1
 #define index_arch_OSXSAVE_Usable              FEATURE_INDEX_1
-#define index_arch_F16C_Usable                 FEATURE_INDEX_1
 #define index_arch_RDRAND_Usable               FEATURE_INDEX_1
 #define index_arch_FPU_Usable                  FEATURE_INDEX_1
 #define index_arch_TSC_Usable                  FEATURE_INDEX_1
@@ -296,7 +296,7 @@ extern const struct cpu_features *__get_cpu_features (void)
 #define need_arch_feature_XSAVE                        0
 #define need_arch_feature_OSXSAVE              0
 #define need_arch_feature_AVX                  1
-#define need_arch_feature_F16C                 0
+#define need_arch_feature_F16C                 1
 #define need_arch_feature_RDRAND               0
 
 /* EDX.  */
This page took 0.042385 seconds and 5 git commands to generate.