Skip to content

Commit 9e8b5a2

Browse files
committed
[X86] Add MOVBE and RDRND features to BDVER4.
Only 6 years behind gcc. https://gcc.gnu.org/legacy-ml/gcc-patches/2014-08/msg00231.html Found while working on improving how we define CPU features for clang and auditing for correctness.
1 parent 82b8236 commit 9e8b5a2

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

clang/lib/Basic/Targets/X86.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ bool X86TargetInfo::initFeatureMap(
414414
case CK_BDVER4:
415415
setFeatureEnabledImpl(Features, "avx2", true);
416416
setFeatureEnabledImpl(Features, "bmi2", true);
417+
setFeatureEnabledImpl(Features, "movbe", true);
418+
setFeatureEnabledImpl(Features, "rdrnd", true);
417419
setFeatureEnabledImpl(Features, "mwaitx", true);
418420
LLVM_FALLTHROUGH;
419421
case CK_BDVER3:

clang/test/Preprocessor/predefined-arch-macros.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,9 +2753,11 @@
27532753
// CHECK_BDVER4_M32: #define __LWP__ 1
27542754
// CHECK_BDVER4_M32: #define __LZCNT__ 1
27552755
// CHECK_BDVER4_M32: #define __MMX__ 1
2756+
// CHECK_BDVER4_M32: #define __MOVBE__ 1
27562757
// CHECK_BDVER4_M32: #define __PCLMUL__ 1
27572758
// CHECK_BDVER4_M32: #define __POPCNT__ 1
27582759
// CHECK_BDVER4_M32: #define __PRFCHW__ 1
2760+
// CHECK_BDVER4_M32: #define __RDRND__ 1
27592761
// CHECK_BDVER4_M32: #define __SSE2_MATH__ 1
27602762
// CHECK_BDVER4_M32: #define __SSE2__ 1
27612763
// CHECK_BDVER4_M32: #define __SSE3__ 1
@@ -2791,9 +2793,11 @@
27912793
// CHECK_BDVER4_M64: #define __LWP__ 1
27922794
// CHECK_BDVER4_M64: #define __LZCNT__ 1
27932795
// CHECK_BDVER4_M64: #define __MMX__ 1
2796+
// CHECK_BDVER4_M64: #define __MOVBE__ 1
27942797
// CHECK_BDVER4_M64: #define __PCLMUL__ 1
27952798
// CHECK_BDVER4_M64: #define __POPCNT__ 1
27962799
// CHECK_BDVER4_M64: #define __PRFCHW__ 1
2800+
// CHECK_BDVER4_M64: #define __RDRND__ 1
27972801
// CHECK_BDVER4_M64: #define __SSE2_MATH__ 1
27982802
// CHECK_BDVER4_M64: #define __SSE2__ 1
27992803
// CHECK_BDVER4_M64: #define __SSE3__ 1

llvm/lib/Target/X86/X86.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,8 @@ def ProcessorFeatures {
946946
// Excavator
947947
list<SubtargetFeature> BdVer4AdditionalFeatures = [FeatureAVX2,
948948
FeatureBMI2,
949+
FeatureMOVBE,
950+
FeatureRDRAND,
949951
FeatureMWAITX];
950952
list<SubtargetFeature> BdVer4InheritableFeatures =
951953
!listconcat(BdVer3InheritableFeatures, BdVer4AdditionalFeatures);

0 commit comments

Comments
 (0)