[llvm] 42c176c - [X86] Add 'cooperlake' and 'tigerlake' to __builtin_cpu_is.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 21 13:03:49 PDT 2020
Author: Craig Topper
Date: 2020-06-21T13:03:18-07:00
New Revision: 42c176c32851833f32863412e74235f085adc801
URL: https://github.com/llvm/llvm-project/commit/42c176c32851833f32863412e74235f085adc801
DIFF: https://github.com/llvm/llvm-project/commit/42c176c32851833f32863412e74235f085adc801.diff
LOG: [X86] Add 'cooperlake' and 'tigerlake' to __builtin_cpu_is.
Cooperlake can be detect by compiler-rt now, but not libgcc yet.
Tigerlake can't be detected by either. Both names are accepted by
gcc. Hopefully the detection code will be in place soon.
Added:
Modified:
clang/test/CodeGen/target-builtin-noerror.c
llvm/include/llvm/Support/X86TargetParser.def
Removed:
################################################################################
diff --git a/clang/test/CodeGen/target-builtin-noerror.c b/clang/test/CodeGen/target-builtin-noerror.c
index 54c5a9b7f218..b2d18fa0b2c0 100644
--- a/clang/test/CodeGen/target-builtin-noerror.c
+++ b/clang/test/CodeGen/target-builtin-noerror.c
@@ -101,6 +101,7 @@ void verifycpustrings() {
(void)__builtin_cpu_is("btver2");
(void)__builtin_cpu_is("cannonlake");
(void)__builtin_cpu_is("cascadelake");
+ (void)__builtin_cpu_is("cooperlake");
(void)__builtin_cpu_is("core2");
(void)__builtin_cpu_is("corei7");
(void)__builtin_cpu_is("goldmont");
@@ -120,6 +121,7 @@ void verifycpustrings() {
(void)__builtin_cpu_is("skylake");
(void)__builtin_cpu_is("skylake-avx512");
(void)__builtin_cpu_is("slm");
+ (void)__builtin_cpu_is("tigerlake");
(void)__builtin_cpu_is("tremont");
(void)__builtin_cpu_is("westmere");
(void)__builtin_cpu_is("znver1");
diff --git a/llvm/include/llvm/Support/X86TargetParser.def b/llvm/include/llvm/Support/X86TargetParser.def
index 38d149851413..afbfd5d26ffe 100644
--- a/llvm/include/llvm/Support/X86TargetParser.def
+++ b/llvm/include/llvm/Support/X86TargetParser.def
@@ -110,6 +110,8 @@ X86_CPU_SUBTYPE_COMPAT("icelake-client", INTEL_COREI7_ICELAKE_CLIENT, "icelake-c
X86_CPU_SUBTYPE_COMPAT("icelake-server", INTEL_COREI7_ICELAKE_SERVER, "icelake-server")
X86_CPU_SUBTYPE_COMPAT("znver2", AMDFAM17H_ZNVER2, "znver2")
X86_CPU_SUBTYPE_COMPAT("cascadelake", INTEL_COREI7_CASCADELAKE, "cascadelake")
+X86_CPU_SUBTYPE_COMPAT("tigerlake", INTEL_COREI7_TIGERLAKE, "tigerlake")
+X86_CPU_SUBTYPE_COMPAT("cooperlake", INTEL_COREI7_COOPERLAKE, "cooperlake")
// Entries below this are not in libgcc/compiler-rt.
X86_CPU_SUBTYPE ("core2", INTEL_CORE2_65)
X86_CPU_SUBTYPE ("penryn", INTEL_CORE2_45)
@@ -117,8 +119,6 @@ X86_CPU_SUBTYPE ("k6", AMDPENTIUM_K6)
X86_CPU_SUBTYPE ("k6-2", AMDPENTIUM_K62)
X86_CPU_SUBTYPE ("k6-3", AMDPENTIUM_K63)
X86_CPU_SUBTYPE ("geode", AMDPENTIUM_GEODE)
-X86_CPU_SUBTYPE ("cooperlake", INTEL_COREI7_COOPERLAKE)
-X86_CPU_SUBTYPE ("tigerlake", INTEL_COREI7_TIGERLAKE)
#undef X86_CPU_SUBTYPE_COMPAT
#undef X86_CPU_SUBTYPE
More information about the llvm-commits
mailing list