@@ -48,14 +48,6 @@ class FeatureBitset {
48
48
return (Bits[I / 32 ] & Mask) != 0 ;
49
49
}
50
50
51
- constexpr FeatureBitset &operator &=(const FeatureBitset &RHS) {
52
- for (unsigned I = 0 , E = array_lengthof (Bits); I != E; ++I) {
53
- uint32_t NewBits = Bits[I] & RHS.Bits [I];
54
- Bits[I] = NewBits;
55
- }
56
- return *this ;
57
- }
58
-
59
51
constexpr FeatureBitset &operator |=(const FeatureBitset &RHS) {
60
52
for (unsigned I = 0 , E = array_lengthof (Bits); I != E; ++I) {
61
53
uint32_t NewBits = Bits[I] | RHS.Bits [I];
@@ -65,14 +57,16 @@ class FeatureBitset {
65
57
}
66
58
67
59
constexpr FeatureBitset operator &(const FeatureBitset &RHS) const {
68
- FeatureBitset Result = *this ;
69
- Result &= RHS;
60
+ FeatureBitset Result;
61
+ for (unsigned I = 0 , E = array_lengthof (Bits); I != E; ++I)
62
+ Result.Bits [I] = Bits[I] & RHS.Bits [I];
70
63
return Result;
71
64
}
72
65
73
66
constexpr FeatureBitset operator |(const FeatureBitset &RHS) const {
74
- FeatureBitset Result = *this ;
75
- Result |= RHS;
67
+ FeatureBitset Result;
68
+ for (unsigned I = 0 , E = array_lengthof (Bits); I != E; ++I)
69
+ Result.Bits [I] = Bits[I] | RHS.Bits [I];
76
70
return Result;
77
71
}
78
72
@@ -117,10 +111,10 @@ static constexpr FeatureBitset FeaturesPentium4 =
117
111
static constexpr FeatureBitset FeaturesPrescott =
118
112
FeaturesPentium4 | FeatureSSE3;
119
113
static constexpr FeatureBitset FeaturesNocona =
120
- FeaturesPrescott | Feature64BIT | FeatureCMPXCHG16B;
114
+ FeaturesPrescott | FeatureEM64T | FeatureCMPXCHG16B;
121
115
122
116
// Basic 64-bit capable CPU.
123
- static constexpr FeatureBitset FeaturesX86_64 = FeaturesPentium4 | Feature64BIT ;
117
+ static constexpr FeatureBitset FeaturesX86_64 = FeaturesPentium4 | FeatureEM64T ;
124
118
125
119
// Intel Core CPUs
126
120
static constexpr FeatureBitset FeaturesCore2 =
@@ -207,15 +201,15 @@ static constexpr FeatureBitset FeaturesAthlon =
207
201
static constexpr FeatureBitset FeaturesAthlonXP =
208
202
FeaturesAthlon | FeatureFXSR | FeatureSSE;
209
203
static constexpr FeatureBitset FeaturesK8 =
210
- FeaturesAthlonXP | FeatureSSE2 | Feature64BIT ;
204
+ FeaturesAthlonXP | FeatureSSE2 | FeatureEM64T ;
211
205
static constexpr FeatureBitset FeaturesK8SSE3 = FeaturesK8 | FeatureSSE3;
212
206
static constexpr FeatureBitset FeaturesAMDFAM10 =
213
207
FeaturesK8SSE3 | FeatureCMPXCHG16B | FeatureLZCNT | FeaturePOPCNT |
214
208
FeaturePRFCHW | FeatureSAHF | FeatureSSE4_A;
215
209
216
210
// Bobcat architecture processors.
217
211
static constexpr FeatureBitset FeaturesBTVER1 =
218
- FeatureX87 | FeatureCMPXCHG8B | FeatureCMPXCHG16B | Feature64BIT |
212
+ FeatureX87 | FeatureCMPXCHG8B | FeatureCMPXCHG16B | FeatureEM64T |
219
213
FeatureFXSR | FeatureLZCNT | FeatureMMX | FeaturePOPCNT | FeaturePRFCHW |
220
214
FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_A |
221
215
FeatureSAHF;
@@ -226,7 +220,7 @@ static constexpr FeatureBitset FeaturesBTVER2 =
226
220
// AMD Bulldozer architecture processors.
227
221
static constexpr FeatureBitset FeaturesBDVER1 =
228
222
FeatureX87 | FeatureAES | FeatureAVX | FeatureCMPXCHG8B |
229
- FeatureCMPXCHG16B | Feature64BIT | FeatureFMA4 | FeatureFXSR | FeatureLWP |
223
+ FeatureCMPXCHG16B | FeatureEM64T | FeatureFMA4 | FeatureFXSR | FeatureLWP |
230
224
FeatureLZCNT | FeatureMMX | FeaturePCLMUL | FeaturePOPCNT | FeaturePRFCHW |
231
225
FeatureSAHF | FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 |
232
226
FeatureSSE4_1 | FeatureSSE4_2 | FeatureSSE4_A | FeatureXOP | FeatureXSAVE;
@@ -242,7 +236,7 @@ static constexpr FeatureBitset FeaturesBDVER4 =
242
236
static constexpr FeatureBitset FeaturesZNVER1 =
243
237
FeatureX87 | FeatureADX | FeatureAES | FeatureAVX | FeatureAVX2 |
244
238
FeatureBMI | FeatureBMI2 | FeatureCLFLUSHOPT | FeatureCLZERO |
245
- FeatureCMPXCHG8B | FeatureCMPXCHG16B | Feature64BIT | FeatureF16C |
239
+ FeatureCMPXCHG8B | FeatureCMPXCHG16B | FeatureEM64T | FeatureF16C |
246
240
FeatureFMA | FeatureFSGSBASE | FeatureFXSR | FeatureLZCNT | FeatureMMX |
247
241
FeatureMOVBE | FeatureMWAITX | FeaturePCLMUL | FeaturePOPCNT |
248
242
FeaturePRFCHW | FeatureRDRND | FeatureRDSEED | FeatureSAHF | FeatureSHA |
@@ -369,7 +363,7 @@ static constexpr ProcInfo Processors[] = {
369
363
370
364
X86::CPUKind llvm::X86::parseArchX86 (StringRef CPU, bool Only64Bit) {
371
365
for (const auto &P : Processors)
372
- if (P.Name == CPU && (P.Features [FEATURE_64BIT ] || !Only64Bit))
366
+ if (P.Name == CPU && (P.Features [FEATURE_EM64T ] || !Only64Bit))
373
367
return P.Kind ;
374
368
375
369
return CK_None;
@@ -378,7 +372,7 @@ X86::CPUKind llvm::X86::parseArchX86(StringRef CPU, bool Only64Bit) {
378
372
void llvm::X86::fillValidCPUArchList (SmallVectorImpl<StringRef> &Values,
379
373
bool Only64Bit) {
380
374
for (const auto &P : Processors)
381
- if (!P.Name .empty () && (P.Features [FEATURE_64BIT ] || !Only64Bit))
375
+ if (!P.Name .empty () && (P.Features [FEATURE_EM64T ] || !Only64Bit))
382
376
Values.emplace_back (P.Name );
383
377
}
384
378
@@ -407,6 +401,7 @@ static constexpr FeatureBitset ImpliedFeaturesCLZERO = {};
407
401
static constexpr FeatureBitset ImpliedFeaturesCMOV = {};
408
402
static constexpr FeatureBitset ImpliedFeaturesCMPXCHG16B = {};
409
403
static constexpr FeatureBitset ImpliedFeaturesCMPXCHG8B = {};
404
+ static constexpr FeatureBitset ImpliedFeaturesEM64T = {};
410
405
static constexpr FeatureBitset ImpliedFeaturesENQCMD = {};
411
406
static constexpr FeatureBitset ImpliedFeaturesFSGSBASE = {};
412
407
static constexpr FeatureBitset ImpliedFeaturesFXSR = {};
@@ -533,14 +528,8 @@ void llvm::X86::getFeaturesForCPU(StringRef CPU,
533
528
[&](const ProcInfo &P) { return P.Name == CPU; });
534
529
assert (I != std::end (Processors) && " Processor not found!" );
535
530
536
- FeatureBitset Bits = I->Features ;
537
-
538
- // Remove the 64-bit feature which we only use to validate if a CPU can
539
- // be used with 64-bit mode.
540
- Bits &= ~Feature64BIT;
541
-
542
531
// Add the string version of all set bits.
543
- getFeatureBitsAsStrings (Bits , EnabledFeatures);
532
+ getFeatureBitsAsStrings (I-> Features , EnabledFeatures);
544
533
}
545
534
546
535
// For each feature that is (transitively) implied by this feature, set it.
0 commit comments