[llvm] r318270 - [X86] Add getHostCPUName support for cannonlake.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 22:02:42 PST 2017


Author: ctopper
Date: Tue Nov 14 22:02:42 2017
New Revision: 318270

URL: http://llvm.org/viewvc/llvm-project?rev=318270&view=rev
Log:
[X86] Add getHostCPUName support for cannonlake.

This adds an explicit model number check and fallback path to the unknown family 6 detection.

Modified:
    llvm/trunk/include/llvm/Support/X86TargetParser.def
    llvm/trunk/lib/Support/Host.cpp

Modified: llvm/trunk/include/llvm/Support/X86TargetParser.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/X86TargetParser.def?rev=318270&r1=318269&r2=318270&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/X86TargetParser.def (original)
+++ llvm/trunk/include/llvm/Support/X86TargetParser.def Tue Nov 14 22:02:42 2017
@@ -94,6 +94,7 @@ X86_CPU_SUBTYPE_COMPAT("haswell",
 X86_CPU_SUBTYPE_COMPAT("broadwell",      INTEL_COREI7_BROADWELL,      "broadwell")
 X86_CPU_SUBTYPE_COMPAT("skylake",        INTEL_COREI7_SKYLAKE,        "skylake")
 X86_CPU_SUBTYPE_COMPAT("skylake-avx512", INTEL_COREI7_SKYLAKE_AVX512, "skylake-avx512")
+X86_CPU_SUBTYPE_COMPAT("cannonlake",     INTEL_COREI7_CANNONLAKE,     "cannonlake")
 // Entries below this are not in libgcc/compiler-rt.
 X86_CPU_SUBTYPE       ("core2",          INTEL_CORE2_65)
 X86_CPU_SUBTYPE       ("penryn",         INTEL_CORE2_45)

Modified: llvm/trunk/lib/Support/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Host.cpp?rev=318270&r1=318269&r2=318270&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Host.cpp (original)
+++ llvm/trunk/lib/Support/Host.cpp Tue Nov 14 22:02:42 2017
@@ -637,6 +637,12 @@ getIntelProcessorTypeAndSubtype(unsigned
       *Subtype = X86::INTEL_COREI7_SKYLAKE_AVX512; // "skylake-avx512"
       break;
 
+    // Cannonlake:
+    case 0x66:
+      *Type = X86::INTEL_COREI7;
+      *Subtype = X86::INTEL_COREI7_CANNONLAKE; // "cannonlake"
+      break;
+
     case 0x1c: // Most 45 nm Intel Atom processors
     case 0x26: // 45 nm Atom Lincroft
     case 0x27: // 32 nm Atom Medfield
@@ -667,15 +673,23 @@ getIntelProcessorTypeAndSubtype(unsigned
       break;
 
     default: // Unknown family 6 CPU, try to guess.
-      if (Features & (1 << FEATURE_AVX512F)) {
-        if (Features & (1 << FEATURE_AVX512VL)) {
-          *Type = X86::INTEL_COREI7;
-          *Subtype = X86::INTEL_COREI7_SKYLAKE_AVX512;
-        } else {
-          *Type = X86::INTEL_KNL; // knl
-        }
+      if (Features & (1 << FEATURE_AVX512VBMI)) {
+        *Type = X86::INTEL_COREI7;
+        *Subtype = X86::INTEL_COREI7_CANNONLAKE;
+        break;
+      }
+
+      if (Features & (1 << FEATURE_AVX512VL)) {
+        *Type = X86::INTEL_COREI7;
+        *Subtype = X86::INTEL_COREI7_SKYLAKE_AVX512;
         break;
       }
+
+      if (Features & (1 << FEATURE_AVX512ER)) {
+        *Type = X86::INTEL_KNL; // knl
+        break;
+      }
+
       if (Features2 & (1 << (FEATURE_CLFLUSHOPT - 32))) {
         if (Features2 & (1 << (FEATURE_SHA - 32))) {
           *Type = X86::INTEL_GOLDMONT;




More information about the llvm-commits mailing list