22#define DEBUG_TYPE "target-parser"
27 if (Arch.
size() >= 2 && Arch[0] ==
'v' && std::isdigit(Arch[1]))
28 return (Arch[1] - 48);
37 std::optional<CpuInfo> Cpu =
parseCpu(CPU);
45 if (
A->getSubArch() == SubArch)
52 for (
const StringRef &FeatureStr : FeatureStrs) {
54 FeaturesMask |= (1ULL << Ext->CPUFeature);
61 std::vector<StringRef> &Features) {
64 if (InputExts.
test(E.ID) && !E.Feature.empty())
65 Features.push_back(E.Feature);
72 if (
A.AltName ==
Name)
79 if (
A.AltName ==
Name)
90 return IsNegated ? AE->NegFeature : AE->Feature;
105 return TT.isAndroid() || TT.isOSDarwin() || TT.isOSFuchsia() ||
106 TT.isOSWindows() || TT.isOHOSFamily();
117 if (
A->Name.ends_with(Syn))
129 if (ArchExt ==
A.Name)
148 outs() <<
"All available -march extensions for AArch64\n\n"
150 << (DescMap.
empty() ?
"\n" :
"Description\n");
153 if (!Ext.Feature.empty()) {
154 std::string Description = DescMap[Ext.Name].str();
156 <<
format(Description.empty() ?
"%s\n" :
"%-20s%s\n",
157 Ext.Name.str().c_str(), Description.c_str());
191 !BaseArch->is_superset(
ARMV9A))
228 if (E == Dep.Earlier)
233 std::vector<StringRef> &Features)
const {
234 if (BaseArch && !BaseArch->ArchFeature.empty())
235 Features.push_back(BaseArch->ArchFeature);
238 if (E.Feature.empty() || !Touched.test(E.ID))
241 Features.push_back(E.Feature);
243 Features.push_back(E.NegFeature);
249 BaseArch = &CPU.
Arch;
253 if (CPUExtensions.
test(E.ID))
273 if (AE->Feature.empty() || AE->NegFeature.empty())
static unsigned checkArchVersion(llvm::StringRef Arch)
const llvm::AArch64::ExtensionInfo & lookupExtensionByID(llvm::AArch64::ArchExtKind ExtID)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
constexpr bool test(unsigned I) const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
constexpr size_t size() const
size - Get the string size.
Triple - Helper class for working with autoconf configuration names.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void PrintSupportedExtensions(StringMap< StringRef > DescMap)
bool isX18ReservedByDefault(const Triple &TT)
StringRef getArchExtFeature(StringRef ArchExt)
std::optional< ExtensionInfo > parseArchExtension(StringRef Extension)
constexpr CpuInfo CpuInfos[]
std::optional< CpuInfo > parseCpu(StringRef Name)
constexpr ArchInfo ARMV8_4A
uint64_t getCpuSupportsMask(ArrayRef< StringRef > FeatureStrs)
const ArchInfo * parseArch(StringRef Arch)
const ArchInfo * getArchForCpu(StringRef CPU)
constexpr ArchInfo ARMV8A
constexpr ArchInfo ARMV9A
void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values)
StringRef resolveExtAlias(StringRef ArchExt)
constexpr ExtensionDependency ExtensionDependencies[]
constexpr Alias CpuAliases[]
static constexpr std::array< const ArchInfo *, 17 > ArchInfos
constexpr Alias ExtAliases[]
StringRef resolveCPUAlias(StringRef CPU)
bool getExtensionFeatures(const AArch64::ExtensionBitset &Extensions, std::vector< StringRef > &Features)
constexpr ExtensionInfo Extensions[]
StringRef getCanonicalArchName(StringRef Arch)
MArch is expected to be of the form (arm|thumb)?(eb)?(v.
StringRef getArchSynonym(StringRef Arch)
Converts e.g. "armv8" -> "armv8-a".
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
FormattedString left_justify(StringRef Str, unsigned Width)
left_justify - append spaces after string so total output is Width characters.
AArch64::ExtensionBitset DefaultExts
static std::optional< ArchInfo > findBySubArch(StringRef SubArch)
AArch64::ExtensionBitset getImpliedExtensions() const
void addCPUDefaults(const CpuInfo &CPU)
void enable(ArchExtKind E)
void disable(ArchExtKind E)
void toLLVMFeatureList(std::vector< StringRef > &Features) const
bool parseModifier(StringRef Modifier)
void addArchDefaults(const ArchInfo &Arch)