[llvm] 5cc4b10 - [X86] Update features for sierraforest, grandridge
Freddy Ye via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 24 20:00:54 PDT 2023
Author: Freddy Ye
Date: 2023-07-25T11:00:41+08:00
New Revision: 5cc4b1059b2842418514a54599a37900b8c608a0
URL: https://github.com/llvm/llvm-project/commit/5cc4b1059b2842418514a54599a37900b8c608a0
DIFF: https://github.com/llvm/llvm-project/commit/5cc4b1059b2842418514a54599a37900b8c608a0.diff
LOG: [X86] Update features for sierraforest, grandridge
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D155784
Added:
Modified:
clang/test/Preprocessor/predefined-arch-macros.c
llvm/lib/Target/X86/X86.td
llvm/lib/TargetParser/X86TargetParser.cpp
Removed:
################################################################################
diff --git a/clang/test/Preprocessor/predefined-arch-macros.c b/clang/test/Preprocessor/predefined-arch-macros.c
index 03d60c528e8e5f..17ea99f91e9ffb 100644
--- a/clang/test/Preprocessor/predefined-arch-macros.c
+++ b/clang/test/Preprocessor/predefined-arch-macros.c
@@ -2455,6 +2455,9 @@
// RUN: %clang -march=sierraforest -m32 -E -dM %s -o - 2>&1 \
// RUN: --target=i386 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SRF_M32
+// RUN: %clang -march=grandridge -m32 -E -dM %s -o - 2>&1 \
+// RUN: --target=i386 \
+// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_GRR_M32
// CHECK_SRF_M32: #define __ADX__ 1
// CHECK_SRF_M32: #define __AES__ 1
// CHECK_SRF_M32: #define __AVX2__ 1
@@ -2470,6 +2473,7 @@
// CHECK_SRF_M32: #define __CLFLUSHOPT__ 1
// CHECK_SRF_M32: #define __CLWB__ 1
// CHECK_SRF_M32: #define __CMPCCXADD__ 1
+// CHECK_SRF_M32: #define __ENQCMD__ 1
// CHECK_SRF_M32: #define __F16C__ 1
// CHECK_SRF_M32: #define __FMA__ 1
// CHECK_SRF_M32: #define __FSGSBASE__ 1
@@ -2489,6 +2493,8 @@
// CHECK_SRF_M32: #define __POPCNT__ 1
// CHECK_SRF_M32: #define __PRFCHW__ 1
// CHECK_SRF_M32: #define __PTWRITE__ 1
+// CHECK_SRF_M32-NOT: #define __RAOINT__ 1
+// CHECK_GRR_M32: #define __RAOINT__ 1
// CHECK_SRF_M32: #define __RDPID__ 1
// CHECK_SRF_M32: #define __RDRND__ 1
// CHECK_SRF_M32: #define __RDSEED__ 1
@@ -2503,6 +2509,7 @@
// CHECK_SRF_M32: #define __SSE_MATH__ 1
// CHECK_SRF_M32: #define __SSE__ 1
// CHECK_SRF_M32: #define __SSSE3__ 1
+// CHECK_SRF_M32: #define __UINTR__ 1
// CHECK_SRF_M32: #define __VAES__ 1
// CHECK_SRF_M32: #define __VPCLMULQDQ__ 1
// CHECK_SRF_M32: #define __WAITPKG__ 1
@@ -2521,6 +2528,9 @@
// RUN: %clang -march=sierraforest -m64 -E -dM %s -o - 2>&1 \
// RUN: --target=i386 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SRF_M64
+// RUN: %clang -march=grandridge -m64 -E -dM %s -o - 2>&1 \
+// RUN: --target=i386 \
+// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M64,CHECK_GRR_M64
// CHECK_SRF_M64: #define __ADX__ 1
// CHECK_SRF_M64: #define __AES__ 1
// CHECK_SRF_M64: #define __AVX2__ 1
@@ -2536,6 +2546,7 @@
// CHECK_SRF_M64: #define __CLFLUSHOPT__ 1
// CHECK_SRF_M64: #define __CLWB__ 1
// CHECK_SRF_M64: #define __CMPCCXADD__ 1
+// CHECK_SRF_M64: #define __ENQCMD__ 1
// CHECK_SRF_M64: #define __F16C__ 1
// CHECK_SRF_M64: #define __FMA__ 1
// CHECK_SRF_M64: #define __FSGSBASE__ 1
@@ -2555,6 +2566,8 @@
// CHECK_SRF_M64: #define __POPCNT__ 1
// CHECK_SRF_M64: #define __PRFCHW__ 1
// CHECK_SRF_M64: #define __PTWRITE__ 1
+// CHECK_SRF_M64-NOT: #define __RAOINT__ 1
+// CHECK_GRR_M64: #define __RAOINT__ 1
// CHECK_SRF_M64: #define __RDPID__ 1
// CHECK_SRF_M64: #define __RDRND__ 1
// CHECK_SRF_M64: #define __RDSEED__ 1
@@ -2570,6 +2583,7 @@
// CHECK_SRF_M64: #define __SSE_MATH__ 1
// CHECK_SRF_M64: #define __SSE__ 1
// CHECK_SRF_M64: #define __SSSE3__ 1
+// CHECK_SRF_M64: #define __UINTR__ 1
// CHECK_SRF_M64: #define __VAES__ 1
// CHECK_SRF_M64: #define __VPCLMULQDQ__ 1
// CHECK_SRF_M64: #define __WAITPKG__ 1
@@ -2586,142 +2600,6 @@
// CHECK_SRF_M64: #define __x86_64 1
// CHECK_SRF_M64: #define __x86_64__ 1
-// RUN: %clang -march=grandridge -m32 -E -dM %s -o - 2>&1 \
-// RUN: --target=i386 \
-// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_GRR_M32
-// CHECK_GRR_M32: #define __ADX__ 1
-// CHECK_GRR_M32: #define __AES__ 1
-// CHECK_GRR_M32: #define __AVX2__ 1
-// CHECK_GRR_M32-NOT: AVX512
-// CHECK_GRR_M32: #define __AVXIFMA__ 1
-// CHECK_GRR_M32: #define __AVXNECONVERT__ 1
-// CHECK_GRR_M32: #define __AVXVNNIINT8__ 1
-// CHECK_GRR_M32: #define __AVXVNNI__ 1
-// CHECK_GRR_M32: #define __AVX__ 1
-// CHECK_GRR_M32: #define __BMI2__ 1
-// CHECK_GRR_M32: #define __BMI__ 1
-// CHECK_GRR_M32: #define __CLDEMOTE__ 1
-// CHECK_GRR_M32: #define __CLFLUSHOPT__ 1
-// CHECK_GRR_M32: #define __CLWB__ 1
-// CHECK_GRR_M32: #define __CMPCCXADD__ 1
-// CHECK_GRR_M32: #define __F16C__ 1
-// CHECK_GRR_M32: #define __FMA__ 1
-// CHECK_GRR_M32: #define __FSGSBASE__ 1
-// CHECK_GRR_M32: #define __FXSR__ 1
-// CHECK_GRR_M32: #define __GFNI__ 1
-// CHECK_GRR_M32: #define __HRESET__ 1
-// CHECK_GRR_M32: #define __INVPCID__ 1
-// CHECK_GRR_M32: #define __KL__ 1
-// CHECK_GRR_M32: #define __LZCNT__ 1
-// CHECK_GRR_M32: #define __MMX__ 1
-// CHECK_GRR_M32: #define __MOVBE__ 1
-// CHECK_GRR_M32: #define __MOVDIR64B__ 1
-// CHECK_GRR_M32: #define __MOVDIRI__ 1
-// CHECK_GRR_M32: #define __PCLMUL__ 1
-// CHECK_GRR_M32: #define __PCONFIG__ 1
-// CHECK_GRR_M32: #define __PKU__ 1
-// CHECK_GRR_M32: #define __POPCNT__ 1
-// CHECK_GRR_M32: #define __PRFCHW__ 1
-// CHECK_GRR_M32: #define __PTWRITE__ 1
-// CHECK_GRR_M32: #define __RAOINT__ 1
-// CHECK_GRR_M32: #define __RDPID__ 1
-// CHECK_GRR_M32: #define __RDRND__ 1
-// CHECK_GRR_M32: #define __RDSEED__ 1
-// CHECK_GRR_M32: #define __SERIALIZE__ 1
-// CHECK_GRR_M32: #define __SGX__ 1
-// CHECK_GRR_M32: #define __SHA__ 1
-// CHECK_GRR_M32: #define __SHSTK__ 1
-// CHECK_GRR_M32: #define __SSE2__ 1
-// CHECK_GRR_M32: #define __SSE3__ 1
-// CHECK_GRR_M32: #define __SSE4_1__ 1
-// CHECK_GRR_M32: #define __SSE4_2__ 1
-// CHECK_GRR_M32: #define __SSE_MATH__ 1
-// CHECK_GRR_M32: #define __SSE__ 1
-// CHECK_GRR_M32: #define __SSSE3__ 1
-// CHECK_GRR_M32: #define __VAES__ 1
-// CHECK_GRR_M32: #define __VPCLMULQDQ__ 1
-// CHECK_GRR_M32: #define __WAITPKG__ 1
-// CHECK_GRR_M32: #define __WIDEKL__ 1
-// CHECK_GRR_M32: #define __XSAVEC__ 1
-// CHECK_GRR_M32: #define __XSAVEOPT__ 1
-// CHECK_GRR_M32: #define __XSAVES__ 1
-// CHECK_GRR_M32: #define __XSAVE__ 1
-// CHECK_GRR_M32: #define __corei7 1
-// CHECK_GRR_M32: #define __corei7__ 1
-// CHECK_GRR_M32: #define __i386 1
-// CHECK_GRR_M32: #define __i386__ 1
-// CHECK_GRR_M32: #define __tune_corei7__ 1
-// CHECK_GRR_M32: #define i386 1
-
-// RUN: %clang -march=grandridge -m64 -E -dM %s -o - 2>&1 \
-// RUN: --target=x86_64 \
-// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_GRR_M64
-// CHECK_GRR_M64: #define __ADX__ 1
-// CHECK_GRR_M64: #define __AES__ 1
-// CHECK_GRR_M64: #define __AVX2__ 1
-// CHECK_GRR_M64-NOT: AVX512
-// CHECK_GRR_M64: #define __AVXIFMA__ 1
-// CHECK_GRR_M64: #define __AVXNECONVERT__ 1
-// CHECK_GRR_M64: #define __AVXVNNIINT8__ 1
-// CHECK_GRR_M64: #define __AVXVNNI__ 1
-// CHECK_GRR_M64: #define __AVX__ 1
-// CHECK_GRR_M64: #define __BMI2__ 1
-// CHECK_GRR_M64: #define __BMI__ 1
-// CHECK_GRR_M64: #define __CLDEMOTE__ 1
-// CHECK_GRR_M64: #define __CLFLUSHOPT__ 1
-// CHECK_GRR_M64: #define __CLWB__ 1
-// CHECK_GRR_M64: #define __CMPCCXADD__ 1
-// CHECK_GRR_M64: #define __F16C__ 1
-// CHECK_GRR_M64: #define __FMA__ 1
-// CHECK_GRR_M64: #define __FSGSBASE__ 1
-// CHECK_GRR_M64: #define __FXSR__ 1
-// CHECK_GRR_M64: #define __GFNI__ 1
-// CHECK_GRR_M64: #define __HRESET__ 1
-// CHECK_GRR_M64: #define __INVPCID__ 1
-// CHECK_GRR_M64: #define __KL__ 1
-// CHECK_GRR_M64: #define __LZCNT__ 1
-// CHECK_GRR_M64: #define __MMX__ 1
-// CHECK_GRR_M64: #define __MOVBE__ 1
-// CHECK_GRR_M64: #define __MOVDIR64B__ 1
-// CHECK_GRR_M64: #define __MOVDIRI__ 1
-// CHECK_GRR_M64: #define __PCLMUL__ 1
-// CHECK_GRR_M64: #define __PCONFIG__ 1
-// CHECK_GRR_M64: #define __PKU__ 1
-// CHECK_GRR_M64: #define __POPCNT__ 1
-// CHECK_GRR_M64: #define __PRFCHW__ 1
-// CHECK_GRR_M64: #define __PTWRITE__ 1
-// CHECK_GRR_M64: #define __RAOINT__ 1
-// CHECK_GRR_M64: #define __RDPID__ 1
-// CHECK_GRR_M64: #define __RDRND__ 1
-// CHECK_GRR_M64: #define __RDSEED__ 1
-// CHECK_GRR_M64: #define __SERIALIZE__ 1
-// CHECK_GRR_M64: #define __SGX__ 1
-// CHECK_GRR_M64: #define __SHA__ 1
-// CHECK_GRR_M64: #define __SHSTK__ 1
-// CHECK_GRR_M64: #define __SSE2_MATH__ 1
-// CHECK_GRR_M64: #define __SSE2__ 1
-// CHECK_GRR_M64: #define __SSE3__ 1
-// CHECK_GRR_M64: #define __SSE4_1__ 1
-// CHECK_GRR_M64: #define __SSE4_2__ 1
-// CHECK_GRR_M64: #define __SSE_MATH__ 1
-// CHECK_GRR_M64: #define __SSE__ 1
-// CHECK_GRR_M64: #define __SSSE3__ 1
-// CHECK_GRR_M64: #define __VAES__ 1
-// CHECK_GRR_M64: #define __VPCLMULQDQ__ 1
-// CHECK_GRR_M64: #define __WAITPKG__ 1
-// CHECK_GRR_M64: #define __WIDEKL__ 1
-// CHECK_GRR_M64: #define __XSAVEC__ 1
-// CHECK_GRR_M64: #define __XSAVEOPT__ 1
-// CHECK_GRR_M64: #define __XSAVES__ 1
-// CHECK_GRR_M64: #define __XSAVE__ 1
-// CHECK_GRR_M64: #define __amd64 1
-// CHECK_GRR_M64: #define __amd64__ 1
-// CHECK_GRR_M64: #define __corei7 1
-// CHECK_GRR_M64: #define __corei7__ 1
-// CHECK_GRR_M64: #define __tune_corei7__ 1
-// CHECK_GRR_M64: #define __x86_64 1
-// CHECK_GRR_M64: #define __x86_64__ 1
-
// RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_GEODE_M32
diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td
index 6f67561a6fb8b2..cc88af17ab55c6 100644
--- a/llvm/lib/Target/X86/X86.td
+++ b/llvm/lib/Target/X86/X86.td
@@ -1200,6 +1200,8 @@ def ProcessorFeatures {
list<SubtargetFeature> SRFAdditionalFeatures = [FeatureCMPCCXADD,
FeatureAVXIFMA,
FeatureAVXNECONVERT,
+ FeatureENQCMD,
+ FeatureUINTR,
FeatureAVXVNNIINT8];
list<SubtargetFeature> SRFFeatures =
!listconcat(ADLFeatures, SRFAdditionalFeatures);
diff --git a/llvm/lib/TargetParser/X86TargetParser.cpp b/llvm/lib/TargetParser/X86TargetParser.cpp
index 606370bfe57dc6..6d2c9033fa68da 100644
--- a/llvm/lib/TargetParser/X86TargetParser.cpp
+++ b/llvm/lib/TargetParser/X86TargetParser.cpp
@@ -234,8 +234,8 @@ constexpr FeatureBitset FeaturesAlderlake =
FeatureCLDEMOTE | FeatureMOVDIR64B | FeatureMOVDIRI | FeatureWAITPKG |
FeatureAVXVNNI | FeatureHRESET | FeatureWIDEKL;
constexpr FeatureBitset FeaturesSierraforest =
- FeaturesAlderlake | FeatureCMPCCXADD | FeatureAVXIFMA |
- FeatureAVXNECONVERT | FeatureAVXVNNIINT8;
+ FeaturesAlderlake | FeatureCMPCCXADD | FeatureAVXIFMA | FeatureUINTR |
+ FeatureENQCMD | FeatureAVXNECONVERT | FeatureAVXVNNIINT8;
constexpr FeatureBitset FeaturesGrandridge =
FeaturesSierraforest | FeatureRAOINT;
More information about the llvm-commits
mailing list