diff options
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Support/X86TargetParser.def | 1 | ||||
-rw-r--r-- | llvm/lib/Support/Host.cpp | 28 |
2 files changed, 22 insertions, 7 deletions
diff --git a/llvm/include/llvm/Support/X86TargetParser.def b/llvm/include/llvm/Support/X86TargetParser.def index a71761a271c..63439b75961 100644 --- a/llvm/include/llvm/Support/X86TargetParser.def +++ b/llvm/include/llvm/Support/X86TargetParser.def @@ -94,6 +94,7 @@ X86_CPU_SUBTYPE_COMPAT("haswell", INTEL_COREI7_HASWELL, "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) diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index 63a2117dff9..a7f1133465e 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -637,6 +637,12 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model, *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 Family, unsigned Model, 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; |