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