b1dca6
commit ecbbadbf107ea1155ae5b71a8b7bd48f38c76731
b1dca6
Author: H.J. Lu <hjl.tools@gmail.com>
b1dca6
Date:   Wed Jun 17 06:34:46 2020 -0700
b1dca6
b1dca6
    x86: Update CPU feature detection [BZ #26149]
b1dca6
    
b1dca6
    1. Divide architecture features into the usable features and the preferred
b1dca6
    features.  The usable features are for correctness and can be exported in
b1dca6
    a stable ABI.  The preferred features are for performance and only for
b1dca6
    glibc internal use.
b1dca6
    2. Change struct cpu_features to
b1dca6
    
b1dca6
    struct cpu_features
b1dca6
    {
b1dca6
      struct cpu_features_basic basic;
b1dca6
      unsigned int *usable_p;
b1dca6
      struct cpuid_registers cpuid[COMMON_CPUID_INDEX_MAX];
b1dca6
      unsigned int usable[USABLE_FEATURE_INDEX_MAX];
b1dca6
      unsigned int preferred[PREFERRED_FEATURE_INDEX_MAX];
b1dca6
      ...
b1dca6
    };
b1dca6
    
b1dca6
    and initialize usable_p to pointer to the usable arary so that
b1dca6
    
b1dca6
    struct cpu_features
b1dca6
    {
b1dca6
      struct cpu_features_basic basic;
b1dca6
      unsigned int *usable_p;
b1dca6
      struct cpuid_registers cpuid[COMMON_CPUID_INDEX_MAX];
b1dca6
    };
b1dca6
    
b1dca6
    can be exported via a stable ABI.  The cpuid and usable arrays can be
b1dca6
    expanded with backward binary compatibility for both .o and .so files.
b1dca6
    3. Add COMMON_CPUID_INDEX_7_ECX_1 for AVX512_BF16.
b1dca6
    4. Detect ENQCMD, PKS, AVX512_VP2INTERSECT, MD_CLEAR, SERIALIZE, HYBRID,
b1dca6
    TSXLDTRK, L1D_FLUSH, CORE_CAPABILITIES and AVX512_BF16.
b1dca6
    5. Rename CAPABILITIES to ARCH_CAPABILITIES.
b1dca6
    6. Check if AVX512_VP2INTERSECT, AVX512_BF16 and PKU are usable.
b1dca6
    7. Update CPU feature detection test.
b1dca6
b1dca6
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
b1dca6
index ac694c032e7baf87..32f93bb3773a318b 100644
b1dca6
--- a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
b1dca6
+++ b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
b1dca6
@@ -33,7 +33,7 @@
b1dca6
   case 21:								  \
b1dca6
     if (!__libc_enable_secure						  \
b1dca6
 	&& memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0)		  \
b1dca6
-      GLRO(dl_x86_cpu_features).feature[index_arch_Prefer_MAP_32BIT_EXEC] \
b1dca6
+      GLRO(dl_x86_cpu_features).preferred[index_arch_Prefer_MAP_32BIT_EXEC] \
b1dca6
 	|= bit_arch_Prefer_MAP_32BIT_EXEC;				  \
b1dca6
     break;
b1dca6
 
b1dca6
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
b1dca6
index 37619c93f8dbcc5d..7b2a5bc3ed27ec39 100644
b1dca6
--- a/sysdeps/x86/cpu-features.c
b1dca6
+++ b/sysdeps/x86/cpu-features.c
b1dca6
@@ -90,11 +90,18 @@ get_common_indices (struct cpu_features *cpu_features,
b1dca6
     }
b1dca6
 
b1dca6
   if (cpu_features->basic.max_cpuid >= 7)
b1dca6
-    __cpuid_count (7, 0,
b1dca6
-		   cpu_features->cpuid[COMMON_CPUID_INDEX_7].eax,
b1dca6
-		   cpu_features->cpuid[COMMON_CPUID_INDEX_7].ebx,
b1dca6
-		   cpu_features->cpuid[COMMON_CPUID_INDEX_7].ecx,
b1dca6
-		   cpu_features->cpuid[COMMON_CPUID_INDEX_7].edx);
b1dca6
+    {
b1dca6
+      __cpuid_count (7, 0,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7].eax,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7].ebx,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7].ecx,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7].edx);
b1dca6
+      __cpuid_count (7, 1,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7_ECX_1].eax,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7_ECX_1].ebx,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7_ECX_1].ecx,
b1dca6
+		     cpu_features->cpuid[COMMON_CPUID_INDEX_7_ECX_1].edx);
b1dca6
+    }
b1dca6
 
b1dca6
   if (cpu_features->basic.max_cpuid >= 0xd)
b1dca6
     __cpuid_count (0xd, 1,
b1dca6
@@ -116,39 +123,39 @@ get_common_indices (struct cpu_features *cpu_features,
b1dca6
 	  /* Determine if AVX is usable.  */
b1dca6
 	  if (CPU_FEATURES_CPU_P (cpu_features, AVX))
b1dca6
 	    {
b1dca6
-	      cpu_features->feature[index_arch_AVX_Usable]
b1dca6
+	      cpu_features->usable[index_arch_AVX_Usable]
b1dca6
 		|= bit_arch_AVX_Usable;
b1dca6
 	      /* The following features depend on AVX being usable.  */
b1dca6
 	      /* Determine if AVX2 is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, AVX2))
b1dca6
 	      {
b1dca6
-		cpu_features->feature[index_arch_AVX2_Usable]
b1dca6
+		cpu_features->usable[index_arch_AVX2_Usable]
b1dca6
 		  |= bit_arch_AVX2_Usable;
b1dca6
 
b1dca6
 	        /* Unaligned load with 256-bit AVX registers are faster on
b1dca6
 	           Intel/AMD processors with AVX2.  */
b1dca6
-	        cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
+	        cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
 		  |= bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
 	      }
b1dca6
 	      /* Determine if FMA is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, FMA))
b1dca6
-		cpu_features->feature[index_arch_FMA_Usable]
b1dca6
+		cpu_features->usable[index_arch_FMA_Usable]
b1dca6
 		  |= bit_arch_FMA_Usable;
b1dca6
 	      /* Determine if VAES is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, VAES))
b1dca6
-		cpu_features->feature[index_arch_VAES_Usable]
b1dca6
+		cpu_features->usable[index_arch_VAES_Usable]
b1dca6
 		  |= bit_arch_VAES_Usable;
b1dca6
 	      /* Determine if VPCLMULQDQ is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, VPCLMULQDQ))
b1dca6
-		cpu_features->feature[index_arch_VPCLMULQDQ_Usable]
b1dca6
+		cpu_features->usable[index_arch_VPCLMULQDQ_Usable]
b1dca6
 		  |= bit_arch_VPCLMULQDQ_Usable;
b1dca6
 	      /* Determine if XOP is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, XOP))
b1dca6
-		cpu_features->feature[index_arch_XOP_Usable]
b1dca6
+		cpu_features->usable[index_arch_XOP_Usable]
b1dca6
 		  |= bit_arch_XOP_Usable;
b1dca6
 	      /* Determine if F16C is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, F16C))
b1dca6
-		cpu_features->feature[index_arch_F16C_Usable]
b1dca6
+		cpu_features->usable[index_arch_F16C_Usable]
b1dca6
 		  |= bit_arch_F16C_Usable;
b1dca6
 	    }
b1dca6
 
b1dca6
@@ -161,64 +168,73 @@ get_common_indices (struct cpu_features *cpu_features,
b1dca6
 	      /* Determine if AVX512F is usable.  */
b1dca6
 	      if (CPU_FEATURES_CPU_P (cpu_features, AVX512F))
b1dca6
 		{
b1dca6
-		  cpu_features->feature[index_arch_AVX512F_Usable]
b1dca6
+		  cpu_features->usable[index_arch_AVX512F_Usable]
b1dca6
 		    |= bit_arch_AVX512F_Usable;
b1dca6
 		  /* Determine if AVX512CD is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512CD))
b1dca6
-		    cpu_features->feature[index_arch_AVX512CD_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512CD_Usable]
b1dca6
 		      |= bit_arch_AVX512CD_Usable;
b1dca6
 		  /* Determine if AVX512ER is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512ER))
b1dca6
-		    cpu_features->feature[index_arch_AVX512ER_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512ER_Usable]
b1dca6
 		      |= bit_arch_AVX512ER_Usable;
b1dca6
 		  /* Determine if AVX512PF is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512PF))
b1dca6
-		    cpu_features->feature[index_arch_AVX512PF_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512PF_Usable]
b1dca6
 		      |= bit_arch_AVX512PF_Usable;
b1dca6
 		  /* Determine if AVX512VL is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512VL))
b1dca6
-		    cpu_features->feature[index_arch_AVX512VL_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512VL_Usable]
b1dca6
 		      |= bit_arch_AVX512VL_Usable;
b1dca6
 		  /* Determine if AVX512DQ is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512DQ))
b1dca6
-		    cpu_features->feature[index_arch_AVX512DQ_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512DQ_Usable]
b1dca6
 		      |= bit_arch_AVX512DQ_Usable;
b1dca6
 		  /* Determine if AVX512BW is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512BW))
b1dca6
-		    cpu_features->feature[index_arch_AVX512BW_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512BW_Usable]
b1dca6
 		      |= bit_arch_AVX512BW_Usable;
b1dca6
 		  /* Determine if AVX512_4FMAPS is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_4FMAPS))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_4FMAPS_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_4FMAPS_Usable]
b1dca6
 		      |= bit_arch_AVX512_4FMAPS_Usable;
b1dca6
 		  /* Determine if AVX512_4VNNIW is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_4VNNIW))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_4VNNIW_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_4VNNIW_Usable]
b1dca6
 		      |= bit_arch_AVX512_4VNNIW_Usable;
b1dca6
 		  /* Determine if AVX512_BITALG is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_BITALG))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_BITALG_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_BITALG_Usable]
b1dca6
 		      |= bit_arch_AVX512_BITALG_Usable;
b1dca6
 		  /* Determine if AVX512_IFMA is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_IFMA))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_IFMA_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_IFMA_Usable]
b1dca6
 		      |= bit_arch_AVX512_IFMA_Usable;
b1dca6
 		  /* Determine if AVX512_VBMI is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_VBMI))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_VBMI_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_VBMI_Usable]
b1dca6
 		      |= bit_arch_AVX512_VBMI_Usable;
b1dca6
 		  /* Determine if AVX512_VBMI2 is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_VBMI2))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_VBMI2_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_VBMI2_Usable]
b1dca6
 		      |= bit_arch_AVX512_VBMI2_Usable;
b1dca6
 		  /* Determine if is AVX512_VNNI usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_VNNI))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_VNNI_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_VNNI_Usable]
b1dca6
 		      |= bit_arch_AVX512_VNNI_Usable;
b1dca6
 		  /* Determine if AVX512_VPOPCNTDQ is usable.  */
b1dca6
 		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_VPOPCNTDQ))
b1dca6
-		    cpu_features->feature[index_arch_AVX512_VPOPCNTDQ_Usable]
b1dca6
+		    cpu_features->usable[index_arch_AVX512_VPOPCNTDQ_Usable]
b1dca6
 		      |= bit_arch_AVX512_VPOPCNTDQ_Usable;
b1dca6
+		  /* Determine if AVX512_VP2INTERSECT is usable.  */
b1dca6
+		  if (CPU_FEATURES_CPU_P (cpu_features,
b1dca6
+					  AVX512_VP2INTERSECT))
b1dca6
+		    cpu_features->usable[index_arch_AVX512_VP2INTERSECT_Usable]
b1dca6
+		      |= bit_arch_AVX512_VP2INTERSECT_Usable;
b1dca6
+		  /* Determine if AVX512_BF16 is usable.  */
b1dca6
+		  if (CPU_FEATURES_CPU_P (cpu_features, AVX512_BF16))
b1dca6
+		    cpu_features->usable[index_arch_AVX512_BF16_Usable]
b1dca6
+		      |= bit_arch_AVX512_BF16_Usable;
b1dca6
 		}
b1dca6
 	    }
b1dca6
 	}
b1dca6
@@ -284,13 +300,18 @@ get_common_indices (struct cpu_features *cpu_features,
b1dca6
 		    {
b1dca6
 		      cpu_features->xsave_state_size
b1dca6
 			= ALIGN_UP (size + STATE_SAVE_OFFSET, 64);
b1dca6
-		      cpu_features->feature[index_arch_XSAVEC_Usable]
b1dca6
+		      cpu_features->usable[index_arch_XSAVEC_Usable]
b1dca6
 			|= bit_arch_XSAVEC_Usable;
b1dca6
 		    }
b1dca6
 		}
b1dca6
 	    }
b1dca6
 	}
b1dca6
     }
b1dca6
+
b1dca6
+  /* Determine if PKU is usable.  */
b1dca6
+  if (CPU_FEATURES_CPU_P (cpu_features, OSPKE))
b1dca6
+    cpu_features->usable[index_arch_PKU_Usable]
b1dca6
+      |= bit_arch_PKU_Usable;
b1dca6
 }
b1dca6
 
b1dca6
 _Static_assert (((index_arch_Fast_Unaligned_Load
b1dca6
@@ -314,6 +335,8 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
   unsigned int stepping = 0;
b1dca6
   enum cpu_features_kind kind;
b1dca6
 
b1dca6
+  cpu_features->usable_p = cpu_features->usable;
b1dca6
+
b1dca6
 #if !HAS_CPUID
b1dca6
   if (__get_cpuid_max (0, 0) == 0)
b1dca6
     {
b1dca6
@@ -344,7 +367,7 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 	    case 0x1c:
b1dca6
 	    case 0x26:
b1dca6
 	      /* BSF is slow on Atom.  */
b1dca6
-	      cpu_features->feature[index_arch_Slow_BSF]
b1dca6
+	      cpu_features->preferred[index_arch_Slow_BSF]
b1dca6
 		|= bit_arch_Slow_BSF;
b1dca6
 	      break;
b1dca6
 
b1dca6
@@ -371,7 +394,7 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 	    case 0x5d:
b1dca6
 	      /* Unaligned load versions are faster than SSSE3
b1dca6
 		 on Silvermont.  */
b1dca6
-	      cpu_features->feature[index_arch_Fast_Unaligned_Load]
b1dca6
+	      cpu_features->preferred[index_arch_Fast_Unaligned_Load]
b1dca6
 		|= (bit_arch_Fast_Unaligned_Load
b1dca6
 		    | bit_arch_Fast_Unaligned_Copy
b1dca6
 		    | bit_arch_Prefer_PMINUB_for_stringop
b1dca6
@@ -383,7 +406,7 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 	    case 0x9c:
b1dca6
 	      /* Enable rep string instructions, unaligned load, unaligned
b1dca6
 	         copy, pminub and avoid SSE 4.2 on Tremont.  */
b1dca6
-	      cpu_features->feature[index_arch_Fast_Rep_String]
b1dca6
+	      cpu_features->preferred[index_arch_Fast_Rep_String]
b1dca6
 		|= (bit_arch_Fast_Rep_String
b1dca6
 		    | bit_arch_Fast_Unaligned_Load
b1dca6
 		    | bit_arch_Fast_Unaligned_Copy
b1dca6
@@ -407,7 +430,7 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 	    case 0x2f:
b1dca6
 	      /* Rep string instructions, unaligned load, unaligned copy,
b1dca6
 		 and pminub are fast on Intel Core i3, i5 and i7.  */
b1dca6
-	      cpu_features->feature[index_arch_Fast_Rep_String]
b1dca6
+	      cpu_features->preferred[index_arch_Fast_Rep_String]
b1dca6
 		|= (bit_arch_Fast_Rep_String
b1dca6
 		    | bit_arch_Fast_Unaligned_Load
b1dca6
 		    | bit_arch_Fast_Unaligned_Copy
b1dca6
@@ -442,10 +465,10 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
          if AVX512ER is available.  Don't use AVX512 to avoid lower CPU
b1dca6
 	 frequency if AVX512ER isn't available.  */
b1dca6
       if (CPU_FEATURES_CPU_P (cpu_features, AVX512ER))
b1dca6
-	cpu_features->feature[index_arch_Prefer_No_VZEROUPPER]
b1dca6
+	cpu_features->preferred[index_arch_Prefer_No_VZEROUPPER]
b1dca6
 	  |= bit_arch_Prefer_No_VZEROUPPER;
b1dca6
       else
b1dca6
-	cpu_features->feature[index_arch_Prefer_No_AVX512]
b1dca6
+	cpu_features->preferred[index_arch_Prefer_No_AVX512]
b1dca6
 	  |= bit_arch_Prefer_No_AVX512;
b1dca6
     }
b1dca6
   /* This spells out "AuthenticAMD".  */
b1dca6
@@ -467,7 +490,7 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 	  /* Since the FMA4 bit is in COMMON_CPUID_INDEX_80000001 and
b1dca6
 	     FMA4 requires AVX, determine if FMA4 is usable here.  */
b1dca6
 	  if (CPU_FEATURES_CPU_P (cpu_features, FMA4))
b1dca6
-	    cpu_features->feature[index_arch_FMA4_Usable]
b1dca6
+	    cpu_features->usable[index_arch_FMA4_Usable]
b1dca6
 	      |= bit_arch_FMA4_Usable;
b1dca6
 	}
b1dca6
 
b1dca6
@@ -476,13 +499,13 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 	  /* "Excavator"   */
b1dca6
 	  if (model >= 0x60 && model <= 0x7f)
b1dca6
 	  {
b1dca6
-	    cpu_features->feature[index_arch_Fast_Unaligned_Load]
b1dca6
+	    cpu_features->preferred[index_arch_Fast_Unaligned_Load]
b1dca6
 	      |= (bit_arch_Fast_Unaligned_Load
b1dca6
 		  | bit_arch_Fast_Copy_Backward);
b1dca6
 
b1dca6
 	    /* Unaligned AVX loads are slower.*/
b1dca6
-	    cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
-		  &= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
+	    cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
+	      &= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
 	  }
b1dca6
 	}
b1dca6
     }
b1dca6
@@ -504,41 +527,38 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
         {
b1dca6
           if (model == 0xf || model == 0x19)
b1dca6
             {
b1dca6
-              cpu_features->feature[index_arch_AVX_Usable]
b1dca6
-                &= (~bit_arch_AVX_Usable
b1dca6
-                & ~bit_arch_AVX2_Usable);
b1dca6
+              cpu_features->usable[index_arch_AVX_Usable]
b1dca6
+                &= ~(bit_arch_AVX_Usable | bit_arch_AVX2_Usable);
b1dca6
 
b1dca6
-              cpu_features->feature[index_arch_Slow_SSE4_2]
b1dca6
-                |= (bit_arch_Slow_SSE4_2);
b1dca6
+              cpu_features->preferred[index_arch_Slow_SSE4_2]
b1dca6
+                |= bit_arch_Slow_SSE4_2;
b1dca6
 
b1dca6
-              cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
-                &= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
+	      cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
+		&= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
             }
b1dca6
         }
b1dca6
       else if (family == 0x7)
b1dca6
         {
b1dca6
-          if (model == 0x1b)
b1dca6
-            {
b1dca6
-              cpu_features->feature[index_arch_AVX_Usable]
b1dca6
-                &= (~bit_arch_AVX_Usable
b1dca6
-                & ~bit_arch_AVX2_Usable);
b1dca6
+	  if (model == 0x1b)
b1dca6
+	    {
b1dca6
+	      cpu_features->usable[index_arch_AVX_Usable]
b1dca6
+		&= ~(bit_arch_AVX_Usable | bit_arch_AVX2_Usable);
b1dca6
 
b1dca6
-              cpu_features->feature[index_arch_Slow_SSE4_2]
b1dca6
-                |= bit_arch_Slow_SSE4_2;
b1dca6
+	      cpu_features->preferred[index_arch_Slow_SSE4_2]
b1dca6
+		|= bit_arch_Slow_SSE4_2;
b1dca6
+
b1dca6
+	      cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
+		&= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
+	    }
b1dca6
+	  else if (model == 0x3b)
b1dca6
+	    {
b1dca6
+	      cpu_features->usable[index_arch_AVX_Usable]
b1dca6
+		&= ~(bit_arch_AVX_Usable | bit_arch_AVX2_Usable);
b1dca6
 
b1dca6
-              cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
-                &= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
-           }
b1dca6
-         else if (model == 0x3b)
b1dca6
-           {
b1dca6
-             cpu_features->feature[index_arch_AVX_Usable]
b1dca6
-               &= (~bit_arch_AVX_Usable
b1dca6
-               & ~bit_arch_AVX2_Usable);
b1dca6
-
b1dca6
-               cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
-               &= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
-           }
b1dca6
-       }
b1dca6
+	      cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
b1dca6
+		&= ~bit_arch_AVX_Fast_Unaligned_Load;
b1dca6
+	    }
b1dca6
+	}
b1dca6
     }
b1dca6
   else
b1dca6
     {
b1dca6
@@ -548,11 +568,11 @@ init_cpu_features (struct cpu_features *cpu_features)
b1dca6
 
b1dca6
   /* Support i586 if CX8 is available.  */
b1dca6
   if (CPU_FEATURES_CPU_P (cpu_features, CX8))
b1dca6
-    cpu_features->feature[index_arch_I586] |= bit_arch_I586;
b1dca6
+    cpu_features->preferred[index_arch_I586] |= bit_arch_I586;
b1dca6
 
b1dca6
   /* Support i686 if CMOV is available.  */
b1dca6
   if (CPU_FEATURES_CPU_P (cpu_features, CMOV))
b1dca6
-    cpu_features->feature[index_arch_I686] |= bit_arch_I686;
b1dca6
+    cpu_features->preferred[index_arch_I686] |= bit_arch_I686;
b1dca6
 
b1dca6
 #if !HAS_CPUID
b1dca6
 no_cpuid:
b1dca6
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
b1dca6
index f18f7520fcb7714a..41c3855e94d16b49 100644
b1dca6
--- a/sysdeps/x86/cpu-features.h
b1dca6
+++ b/sysdeps/x86/cpu-features.h
b1dca6
@@ -20,12 +20,20 @@
b1dca6
 
b1dca6
 enum
b1dca6
 {
b1dca6
-  /* The integer bit array index for the first set of internal feature
b1dca6
+  /* The integer bit array index for the first set of usable feature
b1dca6
      bits.  */
b1dca6
-  FEATURE_INDEX_1 = 0,
b1dca6
-  FEATURE_INDEX_2,
b1dca6
+  USABLE_FEATURE_INDEX_1 = 0,
b1dca6
   /* The current maximum size of the feature integer bit array.  */
b1dca6
-  FEATURE_INDEX_MAX
b1dca6
+  USABLE_FEATURE_INDEX_MAX
b1dca6
+};
b1dca6
+
b1dca6
+enum
b1dca6
+{
b1dca6
+  /* The integer bit array index for the first set of preferred feature
b1dca6
+     bits.  */
b1dca6
+  PREFERRED_FEATURE_INDEX_1 = 0,
b1dca6
+  /* The current maximum size of the feature integer bit array.  */
b1dca6
+  PREFERRED_FEATURE_INDEX_MAX
b1dca6
 };
b1dca6
 
b1dca6
 enum
b1dca6
@@ -36,6 +44,7 @@ enum
b1dca6
   COMMON_CPUID_INDEX_D_ECX_1,
b1dca6
   COMMON_CPUID_INDEX_80000007,
b1dca6
   COMMON_CPUID_INDEX_80000008,
b1dca6
+  COMMON_CPUID_INDEX_7_ECX_1,
b1dca6
   /* Keep the following line at the end.  */
b1dca6
   COMMON_CPUID_INDEX_MAX
b1dca6
 };
b1dca6
@@ -68,9 +77,11 @@ struct cpu_features_basic
b1dca6
 
b1dca6
 struct cpu_features
b1dca6
 {
b1dca6
-  struct cpuid_registers cpuid[COMMON_CPUID_INDEX_MAX];
b1dca6
-  unsigned int feature[FEATURE_INDEX_MAX];
b1dca6
   struct cpu_features_basic basic;
b1dca6
+  unsigned int *usable_p;
b1dca6
+  struct cpuid_registers cpuid[COMMON_CPUID_INDEX_MAX];
b1dca6
+  unsigned int usable[USABLE_FEATURE_INDEX_MAX];
b1dca6
+  unsigned int preferred[PREFERRED_FEATURE_INDEX_MAX];
b1dca6
   /* The state size for XSAVEC or XSAVE.  The type must be unsigned long
b1dca6
      int so that we use
b1dca6
 
b1dca6
@@ -102,7 +113,7 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 # define CPU_FEATURES_CPU_P(ptr, name) \
b1dca6
   ((ptr->cpuid[index_cpu_##name].reg_##name & (bit_cpu_##name)) != 0)
b1dca6
 # define CPU_FEATURES_ARCH_P(ptr, name) \
b1dca6
-  ((ptr->feature[index_arch_##name] & (bit_arch_##name)) != 0)
b1dca6
+  ((ptr->feature_##name[index_arch_##name] & (bit_arch_##name)) != 0)
b1dca6
 
b1dca6
 /* HAS_CPU_FEATURE evaluates to true if CPU supports the feature.  */
b1dca6
 #define HAS_CPU_FEATURE(name) \
b1dca6
@@ -112,13 +123,12 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 # define HAS_ARCH_FEATURE(name) \
b1dca6
   CPU_FEATURES_ARCH_P (__get_cpu_features (), name)
b1dca6
 /* CPU_FEATURE_USABLE evaluates to true if the feature is usable.  */
b1dca6
-#define CPU_FEATURE_USABLE(name)				\
b1dca6
-  ((need_arch_feature_##name && HAS_ARCH_FEATURE (name##_Usable))	\
b1dca6
-   || (!need_arch_feature_##name && HAS_CPU_FEATURE(name)))
b1dca6
+#define CPU_FEATURE_USABLE(name) \
b1dca6
+  HAS_ARCH_FEATURE (name##_Usable)
b1dca6
 
b1dca6
 /* Architecture features.  */
b1dca6
 
b1dca6
-/* FEATURE_INDEX_1.  */
b1dca6
+/* USABLE_FEATURE_INDEX_1.  */
b1dca6
 #define bit_arch_AVX_Usable			(1u << 0)
b1dca6
 #define bit_arch_AVX2_Usable			(1u << 1)
b1dca6
 #define bit_arch_AVX512F_Usable			(1u << 2)
b1dca6
@@ -143,237 +153,65 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 #define bit_arch_XOP_Usable			(1u << 21)
b1dca6
 #define bit_arch_XSAVEC_Usable			(1u << 22)
b1dca6
 #define bit_arch_F16C_Usable			(1u << 23)
b1dca6
-
b1dca6
-#define index_arch_AVX_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX2_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512F_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512CD_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512ER_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512PF_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512VL_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512BW_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512DQ_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_4FMAPS_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_4VNNIW_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_BITALG_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_IFMA_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_VBMI_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_VBMI2_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_VNNI_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AVX512_VPOPCNTDQ_Usable	FEATURE_INDEX_1
b1dca6
-#define index_arch_FMA_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_FMA4_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_VAES_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_VPCLMULQDQ_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_XOP_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_XSAVEC_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_F16C_Usable			FEATURE_INDEX_1
b1dca6
-
b1dca6
-/* Unused.  Compiler will optimize them out.  */
b1dca6
-#define bit_arch_SSE3_Usable			(1u << 0)
b1dca6
-#define bit_arch_PCLMULQDQ_Usable		(1u << 0)
b1dca6
-#define bit_arch_SSSE3_Usable			(1u << 0)
b1dca6
-#define bit_arch_CMPXCHG16B_Usable		(1u << 0)
b1dca6
-#define bit_arch_SSE4_1_Usable			(1u << 0)
b1dca6
-#define bit_arch_SSE4_2_Usable			(1u << 0)
b1dca6
-#define bit_arch_MOVBE_Usable			(1u << 0)
b1dca6
-#define bit_arch_POPCNT_Usable			(1u << 0)
b1dca6
-#define bit_arch_AES_Usable			(1u << 0)
b1dca6
-#define bit_arch_XSAVE_Usable			(1u << 0)
b1dca6
-#define bit_arch_OSXSAVE_Usable			(1u << 0)
b1dca6
-#define bit_arch_RDRAND_Usable			(1u << 0)
b1dca6
-#define bit_arch_FPU_Usable			(1u << 0)
b1dca6
-#define bit_arch_TSC_Usable			(1u << 0)
b1dca6
-#define bit_arch_MSR_Usable			(1u << 0)
b1dca6
-#define bit_arch_CX8_Usable			(1u << 0)
b1dca6
-#define bit_arch_SEP_Usable			(1u << 0)
b1dca6
-#define bit_arch_CMOV_Usable			(1u << 0)
b1dca6
-#define bit_arch_CLFSH_Usable			(1u << 0)
b1dca6
-#define bit_arch_MMX_Usable			(1u << 0)
b1dca6
-#define bit_arch_FXSR_Usable			(1u << 0)
b1dca6
-#define bit_arch_SSE_Usable			(1u << 0)
b1dca6
-#define bit_arch_SSE2_Usable			(1u << 0)
b1dca6
-#define bit_arch_FSGSBASE_Usable		(1u << 0)
b1dca6
-#define bit_arch_BMI1_Usable			(1u << 0)
b1dca6
-#define bit_arch_HLE_Usable			(1u << 0)
b1dca6
-#define bit_arch_BMI2_Usable			(1u << 0)
b1dca6
-#define bit_arch_ERMS_Usable			(1u << 0)
b1dca6
-#define bit_arch_RTM_Usable			(1u << 0)
b1dca6
-#define bit_arch_RDSEED_Usable			(1u << 0)
b1dca6
-#define bit_arch_ADX_Usable			(1u << 0)
b1dca6
-#define bit_arch_CLFLUSHOPT_Usable		(1u << 0)
b1dca6
-#define bit_arch_CLWB_Usable			(1u << 0)
b1dca6
-#define bit_arch_SHA_Usable			(1u << 0)
b1dca6
-#define bit_arch_PREFETCHWT1_Usable		(1u << 0)
b1dca6
-#define bit_arch_GFNI_Usable			(1u << 0)
b1dca6
-#define bit_arch_RDPID_Usable			(1u << 0)
b1dca6
-#define bit_arch_CLDEMOTE_Usable		(1u << 0)
b1dca6
-#define bit_arch_MOVDIRI_Usable			(1u << 0)
b1dca6
-#define bit_arch_MOVDIR64B_Usable		(1u << 0)
b1dca6
-#define bit_arch_FSRM_Usable			(1u << 0)
b1dca6
-#define bit_arch_LAHF64_SAHF64_Usable		(1u << 0)
b1dca6
-#define bit_arch_SVM_Usable			(1u << 0)
b1dca6
-#define bit_arch_LZCNT_Usable			(1u << 0)
b1dca6
-#define bit_arch_SSE4A_Usable			(1u << 0)
b1dca6
-#define bit_arch_PREFETCHW_Usable		(1u << 0)
b1dca6
-#define bit_arch_TBM_Usable			(1u << 0)
b1dca6
-#define bit_arch_SYSCALL_SYSRET_Usable		(1u << 0)
b1dca6
-#define bit_arch_RDTSCP_Usable			(1u << 0)
b1dca6
-#define bit_arch_XSAVEOPT_Usable		(1u << 0)
b1dca6
-#define bit_arch_XGETBV_ECX_1_Usable		(1u << 0)
b1dca6
-#define bit_arch_XSAVES_Usable			(1u << 0)
b1dca6
-#define bit_arch_INVARIANT_TSC_Usable		(1u << 0)
b1dca6
-#define bit_arch_WBNOINVD_Usable		(1u << 0)
b1dca6
-
b1dca6
-/* Unused.  Compiler will optimize them out.  */
b1dca6
-#define index_arch_SSE3_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_PCLMULQDQ_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_SSSE3_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_CMPXCHG16B_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_SSE4_1_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_SSE4_2_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_MOVBE_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_POPCNT_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_AES_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_XSAVE_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_OSXSAVE_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_RDRAND_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_FPU_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_TSC_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_MSR_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_CX8_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_SEP_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_CMOV_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_CLFSH_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_MMX_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_FXSR_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_SSE_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_SSE2_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_FSGSBASE_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_BMI1_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_HLE_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_BMI2_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_ERMS_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_RTM_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_RDSEED_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_ADX_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_CLFLUSHOPT_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_CLWB_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_SHA_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_PREFETCHWT1_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_GFNI_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_RDPID_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_CLDEMOTE_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_MOVDIRI_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_MOVDIR64B_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_FSRM_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_LAHF64_SAHF64_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_LZCNT_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_SSE4A_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_PREFETCHW_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_TBM_Usable			FEATURE_INDEX_1
b1dca6
-#define index_arch_SYSCALL_SYSRET_Usable	FEATURE_INDEX_1
b1dca6
-#define index_arch_RDTSCP_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_XSAVEOPT_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_XGETBV_ECX_1_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_XSAVES_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_INVARIANT_TSC_Usable		FEATURE_INDEX_1
b1dca6
-#define index_arch_WBNOINVD_Usable		FEATURE_INDEX_1
b1dca6
-
b1dca6
-/* COMMON_CPUID_INDEX_1.  */
b1dca6
-
b1dca6
-/* ECX.  */
b1dca6
-#define	need_arch_feature_SSE3			0
b1dca6
-#define	need_arch_feature_PCLMULQDQ		0
b1dca6
-#define need_arch_feature_SSSE3			0
b1dca6
-#define need_arch_feature_FMA			1
b1dca6
-#define need_arch_feature_CMPXCHG16B		0
b1dca6
-#define need_arch_feature_SSE4_1		0
b1dca6
-#define need_arch_feature_SSE4_2		0
b1dca6
-#define need_arch_feature_MOVBE			0
b1dca6
-#define need_arch_feature_POPCNT		0
b1dca6
-#define need_arch_feature_AES			0
b1dca6
-#define need_arch_feature_XSAVE			0
b1dca6
-#define need_arch_feature_OSXSAVE		0
b1dca6
-#define need_arch_feature_AVX			1
b1dca6
-#define need_arch_feature_F16C			1
b1dca6
-#define need_arch_feature_RDRAND		0
b1dca6
-
b1dca6
-/* EDX.  */
b1dca6
-#define need_arch_feature_FPU			0
b1dca6
-#define need_arch_feature_TSC			0
b1dca6
-#define need_arch_feature_MSR			0
b1dca6
-#define need_arch_feature_CX8			0
b1dca6
-#define need_arch_feature_SEP			0
b1dca6
-#define need_arch_feature_CMOV			0
b1dca6
-#define need_arch_feature_CLFSH			0
b1dca6
-#define need_arch_feature_MMX			0
b1dca6
-#define need_arch_feature_FXSR			0
b1dca6
-#define need_arch_feature_SSE			0
b1dca6
-#define need_arch_feature_SSE2			0
b1dca6
-
b1dca6
-/* COMMON_CPUID_INDEX_7.  */
b1dca6
-
b1dca6
-/* EBX.  */
b1dca6
-#define need_arch_feature_FSGSBASE		0
b1dca6
-#define need_arch_feature_BMI1			0
b1dca6
-#define need_arch_feature_HLE			0
b1dca6
-#define need_arch_feature_AVX2			1
b1dca6
-#define need_arch_feature_BMI2			0
b1dca6
-#define need_arch_feature_ERMS			0
b1dca6
-#define need_arch_feature_RTM			0
b1dca6
-#define need_arch_feature_AVX512F		1
b1dca6
-#define need_arch_feature_AVX512DQ		1
b1dca6
-#define need_arch_feature_RDSEED		0
b1dca6
-#define need_arch_feature_ADX			0
b1dca6
-#define need_arch_feature_AVX512_IFMA		1
b1dca6
-#define need_arch_feature_CLFLUSHOPT		0
b1dca6
-#define need_arch_feature_CLWB			0
b1dca6
-#define need_arch_feature_AVX512PF		1
b1dca6
-#define need_arch_feature_AVX512ER		1
b1dca6
-#define need_arch_feature_AVX512CD		1
b1dca6
-#define need_arch_feature_SHA			0
b1dca6
-#define need_arch_feature_AVX512BW		1
b1dca6
-#define need_arch_feature_AVX512VL		1
b1dca6
-
b1dca6
-/* ECX.  */
b1dca6
-#define need_arch_feature_PREFETCHWT1		0
b1dca6
-#define need_arch_feature_AVX512_VBMI		1
b1dca6
-#define need_arch_feature_AVX512_VBMI2		1
b1dca6
-#define need_arch_feature_GFNI			0
b1dca6
-#define need_arch_feature_VAES			1
b1dca6
-#define need_arch_feature_VPCLMULQDQ		1
b1dca6
-#define need_arch_feature_AVX512_VNNI		1
b1dca6
-#define need_arch_feature_AVX512_BITALG		1
b1dca6
-#define need_arch_feature_AVX512_VPOPCNTDQ	1
b1dca6
-#define need_arch_feature_RDPID			0
b1dca6
-#define need_arch_feature_CLDEMOTE		0
b1dca6
-#define need_arch_feature_MOVDIRI		0
b1dca6
-#define need_arch_feature_MOVDIR64B		0
b1dca6
-
b1dca6
-/* EDX.  */
b1dca6
-#define need_arch_feature_AVX512_4VNNIW		1
b1dca6
-#define need_arch_feature_AVX512_4FMAPS		1
b1dca6
-#define need_arch_feature_FSRM			0
b1dca6
-
b1dca6
-/* COMMON_CPUID_INDEX_80000001.  */
b1dca6
-
b1dca6
-/* ECX.  */
b1dca6
-#define need_arch_feature_LAHF64_SAHF64		0
b1dca6
-#define need_arch_feature_LZCNT			0
b1dca6
-#define need_arch_feature_SSE4A			0
b1dca6
-#define need_arch_feature_PREFETCHW		0
b1dca6
-#define need_arch_feature_XOP			1
b1dca6
-#define need_arch_feature_FMA4			1
b1dca6
-#define need_arch_feature_TBM			0
b1dca6
-#define need_arch_feature_SYSCALL_SYSRET	0
b1dca6
-#define need_arch_feature_RDTSCP		0
b1dca6
-#define need_arch_feature_XSAVEOPT		0
b1dca6
-#define need_arch_feature_XSAVEC		1
b1dca6
-#define need_arch_feature_XGETBV_ECX_1		0
b1dca6
-#define need_arch_feature_XSAVES		0
b1dca6
-#define need_arch_feature_INVARIANT_TSC		0
b1dca6
-#define need_arch_feature_WBNOINVD		0
b1dca6
+#define bit_arch_AVX512_VP2INTERSECT_Usable	(1u << 24)
b1dca6
+#define bit_arch_AVX512_BF16_Usable		(1u << 25)
b1dca6
+#define bit_arch_PKU_Usable			(1u << 26)
b1dca6
+
b1dca6
+#define index_arch_AVX_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX2_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512F_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512CD_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512ER_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512PF_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512VL_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512BW_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512DQ_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_4FMAPS_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_4VNNIW_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_BITALG_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_IFMA_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_VBMI_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_VBMI2_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_VNNI_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_VPOPCNTDQ_Usable	USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_FMA_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_FMA4_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_VAES_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_VPCLMULQDQ_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_XOP_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_XSAVEC_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_F16C_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_VP2INTERSECT_Usable	USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX512_BF16_Usable		USABLE_FEATURE_INDEX_1
b1dca6
+#define index_arch_PKU_Usable			USABLE_FEATURE_INDEX_1
b1dca6
+
b1dca6
+#define feature_AVX_Usable			usable
b1dca6
+#define feature_AVX2_Usable			usable
b1dca6
+#define feature_AVX512F_Usable			usable
b1dca6
+#define feature_AVX512CD_Usable			usable
b1dca6
+#define feature_AVX512ER_Usable			usable
b1dca6
+#define feature_AVX512PF_Usable			usable
b1dca6
+#define feature_AVX512VL_Usable			usable
b1dca6
+#define feature_AVX512BW_Usable			usable
b1dca6
+#define feature_AVX512DQ_Usable			usable
b1dca6
+#define feature_AVX512_4FMAPS_Usable		usable
b1dca6
+#define feature_AVX512_4VNNIW_Usable		usable
b1dca6
+#define feature_AVX512_BITALG_Usable		usable
b1dca6
+#define feature_AVX512_IFMA_Usable		usable
b1dca6
+#define feature_AVX512_VBMI_Usable		usable
b1dca6
+#define feature_AVX512_VBMI2_Usable		usable
b1dca6
+#define feature_AVX512_VNNI_Usable		usable
b1dca6
+#define feature_AVX512_VPOPCNTDQ_Usable		usable
b1dca6
+#define feature_FMA_Usable			usable
b1dca6
+#define feature_FMA4_Usable			usable
b1dca6
+#define feature_VAES_Usable			usable
b1dca6
+#define feature_VPCLMULQDQ_Usable		usable
b1dca6
+#define feature_XOP_Usable			usable
b1dca6
+#define feature_XSAVEC_Usable			usable
b1dca6
+#define feature_F16C_Usable			usable
b1dca6
+#define feature_AVX512_VP2INTERSECT_Usable	usable
b1dca6
+#define feature_AVX512_BF16_Usable		usable
b1dca6
+#define feature_PKU_Usable			usable
b1dca6
 
b1dca6
 /* CPU features.  */
b1dca6
 
b1dca6
@@ -494,17 +332,26 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 #define bit_cpu_CLDEMOTE	(1u << 25)
b1dca6
 #define bit_cpu_MOVDIRI		(1u << 27)
b1dca6
 #define bit_cpu_MOVDIR64B	(1u << 28)
b1dca6
+#define bit_cpu_ENQCMD		(1u << 29)
b1dca6
 #define bit_cpu_SGX_LC		(1u << 30)
b1dca6
+#define bit_cpu_PKS		(1u << 31)
b1dca6
 
b1dca6
 /* EDX.  */
b1dca6
 #define bit_cpu_AVX512_4VNNIW	(1u << 2)
b1dca6
 #define bit_cpu_AVX512_4FMAPS	(1u << 3)
b1dca6
 #define bit_cpu_FSRM		(1u << 4)
b1dca6
+#define bit_cpu_AVX512_VP2INTERSECT (1u << 8)
b1dca6
+#define bit_cpu_MD_CLEAR	(1u << 10)
b1dca6
+#define bit_cpu_SERIALIZE	(1u << 14)
b1dca6
+#define bit_cpu_HYBRID		(1u << 15)
b1dca6
+#define bit_cpu_TSXLDTRK	(1u << 16)
b1dca6
 #define bit_cpu_PCONFIG		(1u << 18)
b1dca6
 #define bit_cpu_IBT		(1u << 20)
b1dca6
 #define bit_cpu_IBRS_IBPB	(1u << 26)
b1dca6
 #define bit_cpu_STIBP		(1u << 27)
b1dca6
-#define bit_cpu_CAPABILITIES	(1u << 29)
b1dca6
+#define bit_cpu_L1D_FLUSH	(1u << 28)
b1dca6
+#define bit_cpu_ARCH_CAPABILITIES (1u << 29)
b1dca6
+#define bit_cpu_CORE_CAPABILITIES (1u << 30)
b1dca6
 #define bit_cpu_SSBD		(1u << 31)
b1dca6
 
b1dca6
 /* COMMON_CPUID_INDEX_80000001.  */
b1dca6
@@ -545,6 +392,11 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 /* EBX.  */
b1dca6
 #define bit_cpu_WBNOINVD	(1u << 9)
b1dca6
 
b1dca6
+/* COMMON_CPUID_INDEX_7_ECX_1.  */
b1dca6
+
b1dca6
+/* EAX.  */
b1dca6
+#define bit_cpu_AVX512_BF16	(1u << 5)
b1dca6
+
b1dca6
 /* COMMON_CPUID_INDEX_1.  */
b1dca6
 
b1dca6
 /* ECX.  */
b1dca6
@@ -662,17 +514,26 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 #define index_cpu_CLDEMOTE	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_MOVDIRI	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_MOVDIR64B	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_ENQCMD	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_SGX_LC	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_PKS		COMMON_CPUID_INDEX_7
b1dca6
 
b1dca6
 /* EDX.  */
b1dca6
 #define index_cpu_AVX512_4VNNIW COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_AVX512_4FMAPS	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_FSRM		COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_AVX512_VP2INTERSECT COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_MD_CLEAR	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_SERIALIZE	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_HYBRID	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_TSXLDTRK	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_PCONFIG	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_IBT		COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_IBRS_IBPB	COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_STIBP		COMMON_CPUID_INDEX_7
b1dca6
-#define index_cpu_CAPABILITIES	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_L1D_FLUSH	COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_ARCH_CAPABILITIES COMMON_CPUID_INDEX_7
b1dca6
+#define index_cpu_CORE_CAPABILITIES COMMON_CPUID_INDEX_7
b1dca6
 #define index_cpu_SSBD		COMMON_CPUID_INDEX_7
b1dca6
 
b1dca6
 /* COMMON_CPUID_INDEX_80000001.  */
b1dca6
@@ -713,6 +574,11 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 /* EBX.  */
b1dca6
 #define index_cpu_WBNOINVD	COMMON_CPUID_INDEX_80000008
b1dca6
 
b1dca6
+/* COMMON_CPUID_INDEX_7_ECX_1.  */
b1dca6
+
b1dca6
+/* EAX.  */
b1dca6
+#define index_cpu_AVX512_BF16	COMMON_CPUID_INDEX_7_ECX_1
b1dca6
+
b1dca6
 /* COMMON_CPUID_INDEX_1.  */
b1dca6
 
b1dca6
 /* ECX.  */
b1dca6
@@ -830,17 +696,26 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 #define reg_CLDEMOTE		ecx
b1dca6
 #define reg_MOVDIRI		ecx
b1dca6
 #define reg_MOVDIR64B		ecx
b1dca6
+#define reg_ENQCMD		ecx
b1dca6
 #define reg_SGX_LC		ecx
b1dca6
+#define reg_PKS			ecx
b1dca6
 
b1dca6
 /* EDX.  */
b1dca6
 #define reg_AVX512_4VNNIW	edx
b1dca6
 #define reg_AVX512_4FMAPS	edx
b1dca6
 #define reg_FSRM		edx
b1dca6
+#define reg_AVX512_VP2INTERSECT	edx
b1dca6
+#define reg_MD_CLEAR		edx
b1dca6
+#define reg_SERIALIZE		edx
b1dca6
+#define reg_HYBRID		edx
b1dca6
+#define reg_TSXLDTRK		edx
b1dca6
 #define reg_PCONFIG		edx
b1dca6
 #define reg_IBT			edx
b1dca6
 #define reg_IBRS_IBPB		edx
b1dca6
 #define reg_STIBP		edx
b1dca6
-#define reg_CAPABILITIES	edx
b1dca6
+#define reg_L1D_FLUSH		edx
b1dca6
+#define reg_ARCH_CAPABILITIES	edx
b1dca6
+#define reg_CORE_CAPABILITIES	edx
b1dca6
 #define reg_SSBD		edx
b1dca6
 
b1dca6
 /* COMMON_CPUID_INDEX_80000001.  */
b1dca6
@@ -881,6 +756,11 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 /* EBX.  */
b1dca6
 #define reg_WBNOINVD		ebx
b1dca6
 
b1dca6
+/* COMMON_CPUID_INDEX_7_ECX_1.  */
b1dca6
+
b1dca6
+/* EAX.  */
b1dca6
+#define reg_AVX512_BF16		eax
b1dca6
+
b1dca6
 /* FEATURE_INDEX_2.  */
b1dca6
 #define bit_arch_I586				(1u << 0)
b1dca6
 #define bit_arch_I686				(1u << 1)
b1dca6
@@ -899,22 +779,39 @@ extern const struct cpu_features *__get_cpu_features (void)
b1dca6
 #define bit_arch_Prefer_No_AVX512		(1u << 14)
b1dca6
 #define bit_arch_MathVec_Prefer_No_AVX512	(1u << 15)
b1dca6
 
b1dca6
-#define index_arch_Fast_Rep_String		FEATURE_INDEX_2
b1dca6
-#define index_arch_Fast_Copy_Backward		FEATURE_INDEX_2
b1dca6
-#define index_arch_Slow_BSF			FEATURE_INDEX_2
b1dca6
-#define index_arch_Fast_Unaligned_Load		FEATURE_INDEX_2
b1dca6
-#define index_arch_Prefer_PMINUB_for_stringop 	FEATURE_INDEX_2
b1dca6
-#define index_arch_Fast_Unaligned_Copy		FEATURE_INDEX_2
b1dca6
-#define index_arch_I586				FEATURE_INDEX_2
b1dca6
-#define index_arch_I686				FEATURE_INDEX_2
b1dca6
-#define index_arch_Slow_SSE4_2			FEATURE_INDEX_2
b1dca6
-#define index_arch_AVX_Fast_Unaligned_Load	FEATURE_INDEX_2
b1dca6
-#define index_arch_Prefer_MAP_32BIT_EXEC	FEATURE_INDEX_2
b1dca6
-#define index_arch_Prefer_No_VZEROUPPER		FEATURE_INDEX_2
b1dca6
-#define index_arch_Prefer_ERMS			FEATURE_INDEX_2
b1dca6
-#define index_arch_Prefer_No_AVX512		FEATURE_INDEX_2
b1dca6
-#define index_arch_MathVec_Prefer_No_AVX512	FEATURE_INDEX_2
b1dca6
-#define index_arch_Prefer_FSRM			FEATURE_INDEX_2
b1dca6
+#define index_arch_Fast_Rep_String		PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Fast_Copy_Backward		PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Slow_BSF			PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Fast_Unaligned_Load		PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Prefer_PMINUB_for_stringop 	PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Fast_Unaligned_Copy		PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_I586				PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_I686				PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Slow_SSE4_2			PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_AVX_Fast_Unaligned_Load	PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Prefer_MAP_32BIT_EXEC	PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Prefer_No_VZEROUPPER		PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Prefer_ERMS			PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Prefer_No_AVX512		PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_MathVec_Prefer_No_AVX512	PREFERRED_FEATURE_INDEX_1
b1dca6
+#define index_arch_Prefer_FSRM			PREFERRED_FEATURE_INDEX_1
b1dca6
+
b1dca6
+#define feature_Fast_Rep_String			preferred
b1dca6
+#define feature_Fast_Copy_Backward		preferred
b1dca6
+#define feature_Slow_BSF			preferred
b1dca6
+#define feature_Fast_Unaligned_Load		preferred
b1dca6
+#define feature_Prefer_PMINUB_for_stringop 	preferred
b1dca6
+#define feature_Fast_Unaligned_Copy		preferred
b1dca6
+#define feature_I586				preferred
b1dca6
+#define feature_I686				preferred
b1dca6
+#define feature_Slow_SSE4_2			preferred
b1dca6
+#define feature_AVX_Fast_Unaligned_Load		preferred
b1dca6
+#define feature_Prefer_MAP_32BIT_EXEC		preferred
b1dca6
+#define feature_Prefer_No_VZEROUPPER		preferred
b1dca6
+#define feature_Prefer_ERMS			preferred
b1dca6
+#define feature_Prefer_No_AVX512		preferred
b1dca6
+#define feature_MathVec_Prefer_No_AVX512	preferred
b1dca6
+#define feature_Prefer_FSRM			preferred
b1dca6
 
b1dca6
 /* XCR0 Feature flags.  */
b1dca6
 #define bit_XMM_state		(1u << 1)
b1dca6
diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c
b1dca6
index 2e5d37753713e975..012ae48933055eaa 100644
b1dca6
--- a/sysdeps/x86/cpu-tunables.c
b1dca6
+++ b/sysdeps/x86/cpu-tunables.c
b1dca6
@@ -54,7 +54,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
b1dca6
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
b1dca6
   if (!DEFAULT_MEMCMP (f, #name, len))					\
b1dca6
     {									\
b1dca6
-      cpu_features->feature[index_arch_##name]				\
b1dca6
+      cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	&= ~bit_arch_##name;						\
b1dca6
       break;								\
b1dca6
     }
b1dca6
@@ -66,10 +66,10 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
b1dca6
   if (!DEFAULT_MEMCMP (f, #name, len))					\
b1dca6
     {									\
b1dca6
       if (disable)							\
b1dca6
-	cpu_features->feature[index_arch_##name]			\
b1dca6
+	cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	  &= ~bit_arch_##name;						\
b1dca6
       else								\
b1dca6
-	cpu_features->feature[index_arch_##name]			\
b1dca6
+	cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	  |= bit_arch_##name;						\
b1dca6
       break;								\
b1dca6
     }
b1dca6
@@ -82,10 +82,10 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
b1dca6
   if (!DEFAULT_MEMCMP (f, #name, len))					\
b1dca6
     {									\
b1dca6
       if (disable)							\
b1dca6
-	cpu_features->feature[index_arch_##name]			\
b1dca6
+	cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	  &= ~bit_arch_##name;						\
b1dca6
       else if (CPU_FEATURES_ARCH_P (cpu_features, need))		\
b1dca6
-	cpu_features->feature[index_arch_##name]			\
b1dca6
+	cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	  |= bit_arch_##name;						\
b1dca6
       break;								\
b1dca6
     }
b1dca6
@@ -98,10 +98,10 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
b1dca6
   if (!DEFAULT_MEMCMP (f, #name, len))					\
b1dca6
     {									\
b1dca6
       if (disable)							\
b1dca6
-	cpu_features->feature[index_arch_##name]			\
b1dca6
+	cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	  &= ~bit_arch_##name;						\
b1dca6
       else if (CPU_FEATURES_CPU_P (cpu_features, need))			\
b1dca6
-	cpu_features->feature[index_arch_##name]			\
b1dca6
+	cpu_features->feature_##name[index_arch_##name]			\
b1dca6
 	  |= bit_arch_##name;						\
b1dca6
       break;								\
b1dca6
     }
b1dca6
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
b1dca6
index 64a7fd6157242bdd..08688ace2a0ae35e 100644
b1dca6
--- a/sysdeps/x86/tst-get-cpu-features.c
b1dca6
+++ b/sysdeps/x86/tst-get-cpu-features.c
b1dca6
@@ -172,15 +172,24 @@ do_test (void)
b1dca6
   CHECK_CPU_FEATURE (CLDEMOTE);
b1dca6
   CHECK_CPU_FEATURE (MOVDIRI);
b1dca6
   CHECK_CPU_FEATURE (MOVDIR64B);
b1dca6
+  CHECK_CPU_FEATURE (ENQCMD);
b1dca6
   CHECK_CPU_FEATURE (SGX_LC);
b1dca6
+  CHECK_CPU_FEATURE (PKS);
b1dca6
   CHECK_CPU_FEATURE (AVX512_4VNNIW);
b1dca6
   CHECK_CPU_FEATURE (AVX512_4FMAPS);
b1dca6
   CHECK_CPU_FEATURE (FSRM);
b1dca6
+  CHECK_CPU_FEATURE (AVX512_VP2INTERSECT);
b1dca6
+  CHECK_CPU_FEATURE (MD_CLEAR);
b1dca6
+  CHECK_CPU_FEATURE (SERIALIZE);
b1dca6
+  CHECK_CPU_FEATURE (HYBRID);
b1dca6
+  CHECK_CPU_FEATURE (TSXLDTRK);
b1dca6
   CHECK_CPU_FEATURE (PCONFIG);
b1dca6
   CHECK_CPU_FEATURE (IBT);
b1dca6
   CHECK_CPU_FEATURE (IBRS_IBPB);
b1dca6
   CHECK_CPU_FEATURE (STIBP);
b1dca6
-  CHECK_CPU_FEATURE (CAPABILITIES);
b1dca6
+  CHECK_CPU_FEATURE (L1D_FLUSH);
b1dca6
+  CHECK_CPU_FEATURE (ARCH_CAPABILITIES);
b1dca6
+  CHECK_CPU_FEATURE (CORE_CAPABILITIES);
b1dca6
   CHECK_CPU_FEATURE (SSBD);
b1dca6
   CHECK_CPU_FEATURE (LAHF64_SAHF64);
b1dca6
   CHECK_CPU_FEATURE (SVM);
b1dca6
@@ -202,84 +211,36 @@ do_test (void)
b1dca6
   CHECK_CPU_FEATURE (XSAVES);
b1dca6
   CHECK_CPU_FEATURE (INVARIANT_TSC);
b1dca6
   CHECK_CPU_FEATURE (WBNOINVD);
b1dca6
+  CHECK_CPU_FEATURE (AVX512_BF16);
b1dca6
 
b1dca6
   printf ("Usable CPU features:\n");
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSE3);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (PCLMULQDQ);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSSE3);
b1dca6
   CHECK_CPU_FEATURE_USABLE (FMA);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CMPXCHG16B);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSE4_1);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSE4_2);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (MOVBE);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (POPCNT);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (AES);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (XSAVE);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (OSXSAVE);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX);
b1dca6
   CHECK_CPU_FEATURE_USABLE (F16C);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (RDRAND);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (FPU);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (TSC);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (MSR);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CX8);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SEP);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CMOV);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CLFSH);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (MMX);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (FXSR);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSE);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSE2);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (FSGSBASE);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (BMI1);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (HLE);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX2);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (BMI2);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (ERMS);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512F);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512DQ);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (RDSEED);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (ADX);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_IFMA);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CLFLUSHOPT);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CLWB);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512PF);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512ER);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512CD);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SHA);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512BW);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512VL);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (PREFETCHWT1);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_VBMI);
b1dca6
+  CHECK_CPU_FEATURE_USABLE (PKU);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_VBMI2);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (GFNI);
b1dca6
   CHECK_CPU_FEATURE_USABLE (VAES);
b1dca6
   CHECK_CPU_FEATURE_USABLE (VPCLMULQDQ);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_VNNI);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_BITALG);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_VPOPCNTDQ);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (RDPID);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (CLDEMOTE);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (MOVDIRI);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (MOVDIR64B);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_4VNNIW);
b1dca6
   CHECK_CPU_FEATURE_USABLE (AVX512_4FMAPS);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (FSRM);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (LAHF64_SAHF64);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (LZCNT);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SSE4A);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (PREFETCHW);
b1dca6
+  CHECK_CPU_FEATURE_USABLE (AVX512_VP2INTERSECT);
b1dca6
   CHECK_CPU_FEATURE_USABLE (XOP);
b1dca6
   CHECK_CPU_FEATURE_USABLE (FMA4);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (TBM);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (SYSCALL_SYSRET);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (RDTSCP);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (XSAVEOPT);
b1dca6
   CHECK_CPU_FEATURE_USABLE (XSAVEC);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (XGETBV_ECX_1);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (XSAVES);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (INVARIANT_TSC);
b1dca6
-  CHECK_CPU_FEATURE_USABLE (WBNOINVD);
b1dca6
+  CHECK_CPU_FEATURE_USABLE (AVX512_BF16);
b1dca6
 
b1dca6
   return 0;
b1dca6
 }