@@ -150,12 +150,12 @@ std::string SubtargetFeatures::getString() const {
150
150
// / feature, set it.
151
151
// /
152
152
static
153
- void SetImpliedBits (FeatureBitset &Bits, const SubtargetFeatureKV *FeatureEntry,
153
+ void SetImpliedBits (uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry,
154
154
ArrayRef<SubtargetFeatureKV> FeatureTable) {
155
155
for (auto &FE : FeatureTable) {
156
156
if (FeatureEntry->Value == FE.Value ) continue ;
157
157
158
- if (( FeatureEntry->Implies & FE.Value ). any () ) {
158
+ if (FeatureEntry->Implies & FE.Value ) {
159
159
Bits |= FE.Value ;
160
160
SetImpliedBits (Bits, &FE, FeatureTable);
161
161
}
@@ -166,13 +166,12 @@ void SetImpliedBits(FeatureBitset &Bits, const SubtargetFeatureKV *FeatureEntry,
166
166
// / feature, clear it.
167
167
// /
168
168
static
169
- void ClearImpliedBits (FeatureBitset &Bits,
170
- const SubtargetFeatureKV *FeatureEntry,
169
+ void ClearImpliedBits (uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry,
171
170
ArrayRef<SubtargetFeatureKV> FeatureTable) {
172
171
for (auto &FE : FeatureTable) {
173
172
if (FeatureEntry->Value == FE.Value ) continue ;
174
173
175
- if (( FE.Implies & FeatureEntry->Value ). any () ) {
174
+ if (FE.Implies & FeatureEntry->Value ) {
176
175
Bits &= ~FE.Value ;
177
176
ClearImpliedBits (Bits, &FE, FeatureTable);
178
177
}
@@ -181,8 +180,8 @@ void ClearImpliedBits(FeatureBitset &Bits,
181
180
182
181
// / ToggleFeature - Toggle a feature and returns the newly updated feature
183
182
// / bits.
184
- FeatureBitset
185
- SubtargetFeatures::ToggleFeature (FeatureBitset Bits, StringRef Feature,
183
+ uint64_t
184
+ SubtargetFeatures::ToggleFeature (uint64_t Bits, StringRef Feature,
186
185
ArrayRef<SubtargetFeatureKV> FeatureTable) {
187
186
188
187
// Find feature in table.
@@ -192,6 +191,7 @@ SubtargetFeatures::ToggleFeature(FeatureBitset Bits, StringRef Feature,
192
191
if (FeatureEntry) {
193
192
if ((Bits & FeatureEntry->Value ) == FeatureEntry->Value ) {
194
193
Bits &= ~FeatureEntry->Value ;
194
+
195
195
// For each feature that implies this, clear it.
196
196
ClearImpliedBits (Bits, FeatureEntry, FeatureTable);
197
197
} else {
@@ -212,13 +212,13 @@ SubtargetFeatures::ToggleFeature(FeatureBitset Bits, StringRef Feature,
212
212
213
213
// / getFeatureBits - Get feature bits a CPU.
214
214
// /
215
- FeatureBitset
215
+ uint64_t
216
216
SubtargetFeatures::getFeatureBits (StringRef CPU,
217
217
ArrayRef<SubtargetFeatureKV> CPUTable,
218
218
ArrayRef<SubtargetFeatureKV> FeatureTable) {
219
219
220
220
if (CPUTable.empty () || FeatureTable.empty ())
221
- return FeatureBitset () ;
221
+ return 0 ;
222
222
223
223
#ifndef NDEBUG
224
224
for (size_t i = 1 , e = CPUTable.size (); i != e; ++i) {
@@ -230,8 +230,7 @@ SubtargetFeatures::getFeatureBits(StringRef CPU,
230
230
" CPU features table is not sorted" );
231
231
}
232
232
#endif
233
- // Resulting bits
234
- FeatureBitset Bits;
233
+ uint64_t Bits = 0 ; // Resulting bits
235
234
236
235
// Check if help is needed
237
236
if (CPU == " help" )
@@ -248,7 +247,7 @@ SubtargetFeatures::getFeatureBits(StringRef CPU,
248
247
249
248
// Set the feature implied by this CPU feature, if any.
250
249
for (auto &FE : FeatureTable) {
251
- if (( CPUEntry->Value & FE.Value ). any () )
250
+ if (CPUEntry->Value & FE.Value )
252
251
SetImpliedBits (Bits, &FE, FeatureTable);
253
252
}
254
253
} else {
0 commit comments