Lines Matching +full:test +full:- +full:cpu
1 //===- MCSubtargetInfo.cpp - Subtarget Information ------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
30 if (F == A.end() || StringRef(F->Key) != S) return nullptr;
43 if (Implies.test(FE.Value))
52 if (FE.Implies.getAsBitset().test(Value)) {
62 "Feature flags should start with '+' or '-'");
71 Bits.set(FeatureEntry->Value);
74 SetImpliedBits(Bits, FeatureEntry->Implies.getAsBitset(), FeatureTable);
76 Bits.reset(FeatureEntry->Value);
79 ClearImpliedBits(Bits, FeatureEntry->Value, FeatureTable);
106 // Determine the length of the longest CPU and Feature entries.
110 // Print the CPU table.
112 for (auto &CPU : CPUTable)
113 errs() << format(" %-*s - Select the %s processor.\n", MaxCPULen, CPU.Key,
114 CPU.Key);
120 errs() << format(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc);
123 errs() << "Use +feature to enable a feature, or -feature to disable it.\n"
124 "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n";
138 // Print the CPU table.
140 for (auto &CPU : CPUTable)
141 errs() << "\t" << CPU.Key << "\n";
144 errs() << "Use -mcpu or -mtune to specify the target's processor.\n"
145 "For example, clang --target=aarch64-unknown-linux-gnu "
146 "-mcpu=cortex-a35\n";
151 static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS,
159 assert(llvm::is_sorted(ProcDesc) && "CPU table is not sorted");
160 assert(llvm::is_sorted(ProcFeatures) && "CPU features table is not sorted");
165 if (CPU == "help")
168 // Find CPU entry if CPU name is specified.
169 else if (!CPU.empty()) {
170 const SubtargetSubTypeKV *CPUEntry = Find(CPU, ProcDesc);
174 // Set the features implied by this CPU feature, if any.
175 SetImpliedBits(Bits, CPUEntry->Implies.getAsBitset(), ProcFeatures);
177 errs() << "'" << CPU << "' is not a recognized processor for this target"
187 // Set the features implied by this CPU feature, if any.
188 SetImpliedBits(Bits, CPUEntry->TuneImplies.getAsBitset(), ProcFeatures);
189 } else if (TuneCPU != CPU) {
209 void MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef TuneCPU,
211 FeatureBits = getFeatures(CPU, TuneCPU, FS, ProcDesc, ProcFeatures);
220 void MCSubtargetInfo::setDefaultFeatures(StringRef CPU, StringRef TuneCPU,
222 FeatureBits = getFeatures(CPU, TuneCPU, FS, ProcDesc, ProcFeatures);
234 : TargetTriple(TT), CPU(std::string(C)), TuneCPU(std::string(TC)),
238 InitMCProcessorInfo(CPU, TuneCPU, FS);
274 if (FeatureBits.test(FeatureEntry->Value)) {
275 FeatureBits.reset(FeatureEntry->Value);
277 ClearImpliedBits(FeatureBits, FeatureEntry->Value, ProcFeatures);
279 FeatureBits.set(FeatureEntry->Value);
282 SetImpliedBits(FeatureBits, FeatureEntry->Implies.getAsBitset(),
303 if (F[0] == '-')
310 const MCSchedModel &MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const {
315 const SubtargetSubTypeKV *CPUEntry = Find(CPU, ProcDesc);
318 if (CPU != "help") // Don't error if the user asked for help.
319 errs() << "'" << CPU
324 assert(CPUEntry->SchedModel && "Missing processor SchedModel value");
325 return *CPUEntry->SchedModel;
329 MCSubtargetInfo::getInstrItineraryForCPU(StringRef CPU) const {
330 const MCSchedModel &SchedModel = getSchedModelForCPU(CPU);
343 return FeatureBits.test(FeatureKV.Value);