Lines Matching refs:Feature
30 /// hasFlag - Determine if a feature has a flag; '+' or '-'
32 static inline bool hasFlag(StringRef Feature) {
33 assert(!Feature.empty() && "Empty string");
35 char Ch = Feature[0];
42 static inline std::string StripFlag(StringRef Feature) {
43 return hasFlag(Feature) ? Feature.substr(1) : Feature;
48 static inline bool isEnabled(StringRef Feature) {
49 assert(!Feature.empty() && "Empty string");
51 char Ch = Feature[0];
93 /// Display help for feature choices.
97 // Determine the length of the longest CPU and Feature entries.
107 // Print the Feature table.
109 for (auto &Feature : FeatTable)
110 errs() << format(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc);
113 errs() << "Use +feature to enable a feature, or -feature to disable it.\n"
131 /// SetImpliedBits - For each feature that is (transitively) implied by this
132 /// feature, set it.
147 /// ClearImpliedBits - For each feature that (transitively) implies this
148 /// feature, clear it.
164 /// ToggleFeature - Toggle a feature and update the feature bits.
166 SubtargetFeatures::ToggleFeature(FeatureBitset &Bits, StringRef Feature,
169 // Find feature in table.
171 Find(StripFlag(Feature), FeatureTable);
176 // For each feature that implies this, clear it.
181 // For each feature that this implies, set it.
185 errs() << "'" << Feature
186 << "' is not a recognized feature for this target"
187 << " (ignoring feature)\n";
191 void SubtargetFeatures::ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature,
194 assert(hasFlag(Feature));
196 // Find feature in table.
198 Find(StripFlag(Feature), FeatureTable);
201 // Enable/disable feature in bits
202 if (isEnabled(Feature)) {
205 // For each feature that this implies, set it.
210 // For each feature that implies this, clear it.
214 errs() << "'" << Feature
215 << "' is not a recognized feature for this target"
216 << " (ignoring feature)\n";
221 /// getFeatureBits - Get feature bits a CPU.
250 // Set base feature bits
253 // Set the feature implied by this CPU feature, if any.
265 // Iterate through each feature
266 for (auto &Feature : Features) {
268 if (Feature == "+help")
271 ApplyFeatureFlag(Bits, Feature, FeatureTable);
277 /// print - Print feature string.
286 /// dump - Dump feature info.