diff options
| author | Craig Topper <craig.topper@intel.com> | 2017-11-15 06:02:42 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2017-11-15 06:02:42 +0000 |
| commit | 0749186a70defaefda30c2e14a7150335097374d (patch) | |
| tree | 7a34bf0b0227d4d2d2494876334ea23bb4a29f1e | |
| parent | 72c8fad4270a9810e7868892910b8029e8a92b1c (diff) | |
| download | bcm5719-llvm-0749186a70defaefda30c2e14a7150335097374d.tar.gz bcm5719-llvm-0749186a70defaefda30c2e14a7150335097374d.zip | |
[X86] Add getHostCPUName support for cannonlake.
This adds an explicit model number check and fallback path to the unknown family 6 detection.
llvm-svn: 318270
| -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; |

