Skip to content

Commit 70160e0

Browse files
committed
Remove 3dnow from X86TargetParser.
This should've been part of PR llvm#96246, but was missed. This addresses the spurious inclusion of (now unsupported) target features '-3dnow' and '-3dnowa', when disabling mmx.
1 parent daab6fc commit 70160e0

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

clang/test/CodeGen/attr-target-x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void __attribute__((target("avx10.1-512"))) avx10_1_512(void) {}
6464
// CHECK: #4 = {{.*}}"target-cpu"="i686" "target-features"="+cmov,+cx8,+x87,-avx,-avx10.1-256,-avx10.1-512,-avx2,-avx512bf16,-avx512bitalg,-avx512bw,-avx512cd,-avx512dq,-avx512f,-avx512fp16,-avx512ifma,-avx512vbmi,-avx512vbmi2,-avx512vl,-avx512vnni,-avx512vp2intersect,-avx512vpopcntdq,-avxifma,-avxneconvert,-avxvnni,-avxvnniint16,-avxvnniint8,-f16c,-fma,-fma4,-sha512,-sm3,-sm4,-sse4.1,-sse4.2,-vaes,-vpclmulqdq,-xop" "tune-cpu"="i686"
6565
// CHECK: #5 = {{.*}}"target-cpu"="ivybridge" "target-features"="+avx,+cmov,+crc32,+cx16,+cx8,+f16c,+fsgsbase,+fxsr,+mmx,+pclmul,+popcnt,+rdrnd,+sahf,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+xsaveopt,-aes,-avx10.1-256,-avx10.1-512,-vaes"
6666
// CHECK-NOT: tune-cpu
67-
// CHECK: #6 = {{.*}}"target-cpu"="i686" "target-features"="+cmov,+cx8,+x87,-3dnow,-3dnowa,-mmx"
67+
// CHECK: #6 = {{.*}}"target-cpu"="i686" "target-features"="+cmov,+cx8,+x87,-mmx"
6868
// CHECK: #7 = {{.*}}"target-cpu"="lakemont" "target-features"="+cx8,+mmx"
6969
// CHECK-NOT: tune-cpu
7070
// CHECK: #8 = {{.*}}"target-cpu"="i686" "target-features"="+cmov,+cx8,+x87" "tune-cpu"="sandybridge"

llvm/include/llvm/TargetParser/X86TargetParser.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ X86_FEATURE_COMPAT(AVX512BF16, "avx512bf16", 34)
175175
X86_FEATURE_COMPAT(AVX512VP2INTERSECT, "avx512vp2intersect", 35)
176176
// Below Features has some missings comparing to gcc, it's because gcc has some
177177
// not one-to-one mapped in llvm.
178-
X86_FEATURE_COMPAT(3DNOW, "3dnow", 0)
179-
X86_FEATURE (3DNOWA, "3dnowa")
180178
X86_FEATURE_COMPAT(ADX, "adx", 0)
181179
X86_FEATURE (64BIT, "64bit")
182180
X86_FEATURE_COMPAT(CLDEMOTE, "cldemote", 0)

llvm/lib/TargetParser/X86TargetParser.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ constexpr FeatureBitset FeaturesClearwaterforest =
171171

172172
// Geode Processor.
173173
constexpr FeatureBitset FeaturesGeode =
174-
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | Feature3DNOW | Feature3DNOWA;
174+
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
175175

176176
// K6 processor.
177177
constexpr FeatureBitset FeaturesK6 = FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
178178

179179
// K7 and K8 architecture processors.
180180
constexpr FeatureBitset FeaturesAthlon =
181-
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | Feature3DNOW | Feature3DNOWA;
181+
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
182182
constexpr FeatureBitset FeaturesAthlonXP =
183183
FeaturesAthlon | FeatureFXSR | FeatureSSE;
184184
constexpr FeatureBitset FeaturesK8 =
@@ -256,8 +256,8 @@ constexpr ProcInfo Processors[] = {
256256
// i486-generation processors.
257257
{ {"i486"}, CK_i486, ~0U, FeatureX87, '\0', false },
258258
{ {"winchip-c6"}, CK_WinChipC6, ~0U, FeaturesPentiumMMX, '\0', false },
259-
{ {"winchip2"}, CK_WinChip2, ~0U, FeaturesPentiumMMX | Feature3DNOW, '\0', false },
260-
{ {"c3"}, CK_C3, ~0U, FeaturesPentiumMMX | Feature3DNOW, '\0', false },
259+
{ {"winchip2"}, CK_WinChip2, ~0U, FeaturesPentiumMMX, '\0', false },
260+
{ {"c3"}, CK_C3, ~0U, FeaturesPentiumMMX, '\0', false },
261261
// i586-generation processors, P5 microarchitecture based.
262262
{ {"i586"}, CK_i586, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false },
263263
{ {"pentium"}, CK_Pentium, ~0U, FeatureX87 | FeatureCMPXCHG8B, 'B', false },
@@ -386,8 +386,8 @@ constexpr ProcInfo Processors[] = {
386386
{ {"lakemont"}, CK_Lakemont, ~0U, FeatureCMPXCHG8B, '\0', false },
387387
// K6 architecture processors.
388388
{ {"k6"}, CK_K6, ~0U, FeaturesK6, '\0', false },
389-
{ {"k6-2"}, CK_K6_2, ~0U, FeaturesK6 | Feature3DNOW, '\0', false },
390-
{ {"k6-3"}, CK_K6_3, ~0U, FeaturesK6 | Feature3DNOW, '\0', false },
389+
{ {"k6-2"}, CK_K6_2, ~0U, FeaturesK6, '\0', false },
390+
{ {"k6-3"}, CK_K6_3, ~0U, FeaturesK6, '\0', false },
391391
// K7 architecture processors.
392392
{ {"athlon"}, CK_Athlon, ~0U, FeaturesAthlon, '\0', false },
393393
{ {"athlon-tbird"}, CK_Athlon, ~0U, FeaturesAthlon, '\0', false },
@@ -493,6 +493,7 @@ constexpr FeatureBitset ImpliedFeaturesFXSR = {};
493493
constexpr FeatureBitset ImpliedFeaturesINVPCID = {};
494494
constexpr FeatureBitset ImpliedFeaturesLWP = {};
495495
constexpr FeatureBitset ImpliedFeaturesLZCNT = {};
496+
constexpr FeatureBitset ImpliedFeaturesMMX = {};
496497
constexpr FeatureBitset ImpliedFeaturesMWAITX = {};
497498
constexpr FeatureBitset ImpliedFeaturesMOVBE = {};
498499
constexpr FeatureBitset ImpliedFeaturesMOVDIR64B = {};
@@ -534,11 +535,6 @@ constexpr FeatureBitset ImpliedFeaturesXSAVEC = FeatureXSAVE;
534535
constexpr FeatureBitset ImpliedFeaturesXSAVEOPT = FeatureXSAVE;
535536
constexpr FeatureBitset ImpliedFeaturesXSAVES = FeatureXSAVE;
536537

537-
// MMX->3DNOW->3DNOWA chain.
538-
constexpr FeatureBitset ImpliedFeaturesMMX = {};
539-
constexpr FeatureBitset ImpliedFeatures3DNOW = FeatureMMX;
540-
constexpr FeatureBitset ImpliedFeatures3DNOWA = Feature3DNOW;
541-
542538
// SSE/AVX/AVX512F chain.
543539
constexpr FeatureBitset ImpliedFeaturesSSE = {};
544540
constexpr FeatureBitset ImpliedFeaturesSSE2 = FeatureSSE;

0 commit comments

Comments
 (0)