[X86] Add cooperlake detection to _cpu_indicator_init.
authorCraig Topper <craig.topper@intel.com>
Sun, 21 Jun 2020 07:03:44 +0000 (00:03 -0700)
committerCraig Topper <craig.topper@intel.com>
Sun, 21 Jun 2020 20:02:33 +0000 (13:02 -0700)
libgcc has this enum encoding defined for a while, but their
detection code is missing. I've raised a bug with them so that
should get fixed soon.

compiler-rt/lib/builtins/cpu_model.c

index c9aa42b..ce25227 100644 (file)
@@ -353,7 +353,9 @@ static void getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model,
     // Skylake Xeon:
     case 0x55:
       *Type = INTEL_COREI7;
-      if (testFeature(FEATURE_AVX512VNNI))
+      if (testFeature(FEATURE_AVX512BF16))
+        *Subtype = INTEL_COREI7_COOPERLAKE; // "cooperlake"
+      else if (testFeature(FEATURE_AVX512VNNI))
         *Subtype = INTEL_COREI7_CASCADELAKE; // "cascadelake"
       else
         *Subtype = INTEL_COREI7_SKYLAKE_AVX512; // "skylake-avx512"