[clang] bb1d8bf - [X86] Add CLWB to Tremont CPU. Remove CLDEMOTE, MOVDIRI, MOVDIR64B, and WAITPKG to match gcc.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 2 22:42:29 PDT 2020
Author: Craig Topper
Date: 2020-06-02T22:38:51-07:00
New Revision: bb1d8bf2707bdca89c1f5e719057f1000232ccc3
URL: https://github.com/llvm/llvm-project/commit/bb1d8bf2707bdca89c1f5e719057f1000232ccc3
DIFF: https://github.com/llvm/llvm-project/commit/bb1d8bf2707bdca89c1f5e719057f1000232ccc3.diff
LOG: [X86] Add CLWB to Tremont CPU. Remove CLDEMOTE, MOVDIRI, MOVDIR64B, and WAITPKG to match gcc.
Added:
Modified:
clang/lib/Basic/Targets/X86.cpp
clang/test/Preprocessor/predefined-arch-macros.c
llvm/lib/Target/X86/X86.td
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index f4fd5c5835d9..e47cb178792b 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -257,11 +257,8 @@ bool X86TargetInfo::initFeatureMap(
break;
case CK_Tremont:
- setFeatureEnabledImpl(Features, "cldemote", true);
- setFeatureEnabledImpl(Features, "movdiri", true);
- setFeatureEnabledImpl(Features, "movdir64b", true);
+ setFeatureEnabledImpl(Features, "clwb", true);
setFeatureEnabledImpl(Features, "gfni", true);
- setFeatureEnabledImpl(Features, "waitpkg", true);
LLVM_FALLTHROUGH;
case CK_GoldmontPlus:
setFeatureEnabledImpl(Features, "ptwrite", true);
diff --git a/clang/test/Preprocessor/predefined-arch-macros.c b/clang/test/Preprocessor/predefined-arch-macros.c
index ab36e98beb71..f7de81028327 100644
--- a/clang/test/Preprocessor/predefined-arch-macros.c
+++ b/clang/test/Preprocessor/predefined-arch-macros.c
@@ -1802,15 +1802,16 @@
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_TRM_M32
// CHECK_TRM_M32: #define __AES__ 1
-// CHECK_TRM_M32: #define __CLDEMOTE__ 1
+// CHECK_TRM_M32-NOT: #define __CLDEMOTE__ 1
// CHECK_TRM_M32: #define __CLFLUSHOPT__ 1
+// CHECK_TRM_M32: #define __CLWB__ 1
// CHECK_TRM_M32: #define __FSGSBASE__ 1
// CHECK_TRM_M32: #define __FXSR__ 1
// CHECK_TRM_M32: #define __GFNI__ 1
// CHECK_TRM_M32: #define __MMX__ 1
// CHECK_TRM_M32: #define __MOVBE__ 1
-// CHECK_TRM_M32: #define __MOVDIR64B__ 1
-// CHECK_TRM_M32: #define __MOVDIRI__ 1
+// CHECK_TRM_M32-NOT: #define __MOVDIR64B__ 1
+// CHECK_TRM_M32-NOT: #define __MOVDIRI__ 1
// CHECK_TRM_M32: #define __PCLMUL__ 1
// CHECK_TRM_M32: #define __POPCNT__ 1
// CHECK_TRM_M32: #define __PRFCHW__ 1
@@ -1827,7 +1828,7 @@
// CHECK_TRM_M32: #define __SSE_MATH__ 1
// CHECK_TRM_M32: #define __SSE__ 1
// CHECK_TRM_M32: #define __SSSE3__ 1
-// CHECK_TRM_M32: #define __WAITPKG__ 1
+// CHECK_TRM_M32-NOT: #define __WAITPKG__ 1
// CHECK_TRM_M32: #define __XSAVEC__ 1
// CHECK_TRM_M32: #define __XSAVEOPT__ 1
// CHECK_TRM_M32: #define __XSAVES__ 1
@@ -1843,15 +1844,16 @@
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_TRM_M64
// CHECK_TRM_M64: #define __AES__ 1
-// CHECK_TRM_M64: #define __CLDEMOTE__ 1
+// CHECK_TRM_M64-NOT: #define __CLDEMOTE__ 1
// CHECK_TRM_M64: #define __CLFLUSHOPT__ 1
+// CHECK_TRM_M64: #define __CLWB__ 1
// CHECK_TRM_M64: #define __FSGSBASE__ 1
// CHECK_TRM_M64: #define __FXSR__ 1
// CHECK_TRM_M64: #define __GFNI__ 1
// CHECK_TRM_M64: #define __MMX__ 1
// CHECK_TRM_M64: #define __MOVBE__ 1
-// CHECK_TRM_M64: #define __MOVDIR64B__ 1
-// CHECK_TRM_M64: #define __MOVDIRI__ 1
+// CHECK_TRM_M64-NOT: #define __MOVDIR64B__ 1
+// CHECK_TRM_M64-NOT: #define __MOVDIRI__ 1
// CHECK_TRM_M64: #define __PCLMUL__ 1
// CHECK_TRM_M64: #define __POPCNT__ 1
// CHECK_TRM_M64: #define __PRFCHW__ 1
@@ -1867,7 +1869,7 @@
// CHECK_TRM_M64: #define __SSE4_2__ 1
// CHECK_TRM_M64: #define __SSE__ 1
// CHECK_TRM_M64: #define __SSSE3__ 1
-// CHECK_TRM_M64: #define __WAITPKG__ 1
+// CHECK_TRM_M64-NOT: #define __WAITPKG__ 1
// CHECK_TRM_M64: #define __XSAVEC__ 1
// CHECK_TRM_M64: #define __XSAVEOPT__ 1
// CHECK_TRM_M64: #define __XSAVES__ 1
diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td
index e897d65174eb..bcbc1ae492b2 100644
--- a/llvm/lib/Target/X86/X86.td
+++ b/llvm/lib/Target/X86/X86.td
@@ -789,15 +789,13 @@ def ProcessorFeatures {
!listconcat(GLPInheritableFeatures, GLPSpecificFeatures);
// Tremont
- list<SubtargetFeature> TRMAdditionalFeatures = [FeatureCLDEMOTE,
- FeatureGFNI,
- FeatureMOVDIRI,
- FeatureMOVDIR64B,
- FeatureWAITPKG];
+ list<SubtargetFeature> TRMAdditionalFeatures = [FeatureCLWB,
+ FeatureGFNI];
list<SubtargetFeature> TRMSpecificFeatures = [FeatureUseGLMDivSqrtCosts];
+ list<SubtargetFeature> TRMInheritableFeatures =
+ !listconcat(GLPInheritableFeatures, TRMAdditionalFeatures);
list<SubtargetFeature> TRMFeatures =
- !listconcat(GLPInheritableFeatures, TRMAdditionalFeatures,
- TRMSpecificFeatures);
+ !listconcat(TRMInheritableFeatures, TRMSpecificFeatures);
// Knights Landing
list<SubtargetFeature> KNLFeatures = [FeatureX87,
More information about the cfe-commits
mailing list