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);
44 for (
const auto *
A : AArch64::ArchInfos)
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)
83 return IsNegated ? AE->NegFeature : AE->Feature;
98 return TT.isAndroid() || TT.isOSDarwin() || TT.isOSFuchsia() ||
99 TT.isOSWindows() || TT.isOHOSFamily();
109 for (
const auto *
A : ArchInfos) {
110 if (
A->Name.ends_with(Syn))
116std::optional<AArch64::ExtensionInfo>
119 if (ArchExt ==
A.Name || ArchExt ==
A.Alias)
138 outs() <<
"All available -march extensions for AArch64\n\n"
140 << (DescMap.
empty() ?
"\n" :
"Description\n");
143 if (!Ext.Feature.empty()) {
144 std::string Description = DescMap[Ext.Name].str();
146 <<
format(Description.empty() ?
"%s\n" :
"%-20s%s\n",
147 Ext.Name.str().c_str(), Description.c_str());
154 for (
const auto &E : llvm::AArch64::Extensions)
180 if (E == AEK_FP16 && BaseArch->is_superset(ARMV8_4A) &&
181 !BaseArch->is_superset(ARMV9A))
185 if (E == AEK_CRYPTO) {
191 if (E == AEK_CRYPTO && BaseArch->is_superset(ARMV8_4A)) {
201 if (E == AEK_CRYPTO) {
218 if (E == Dep.Earlier)
223 std::vector<StringRef> &Features)
const {
224 if (BaseArch && !BaseArch->ArchFeature.empty())
225 Features.push_back(BaseArch->ArchFeature);
228 if (E.Feature.empty() || !Touched.test(E.ID))
231 Features.push_back(E.Feature);
233 Features.push_back(E.NegFeature);
239 BaseArch = &CPU.
Arch;
243 if (CPUExtensions.
test(E.ID))
263 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")
static cl::opt< std::set< SPIRV::Extension::Extension >, false, SPIRVExtensionsParser > Extensions("spirv-ext", cl::desc("Specify list of enabled SPIR-V extensions"))
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)
uint64_t getCpuSupportsMask(ArrayRef< StringRef > FeatureStrs)
const ArchInfo * parseArch(StringRef Arch)
const ArchInfo * getArchForCpu(StringRef CPU)
void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values)
constexpr ExtensionDependency ExtensionDependencies[]
const ExtensionInfo & getExtensionByID(ArchExtKind(ExtID))
constexpr Alias CpuAliases[]
StringRef resolveCPUAlias(StringRef CPU)
bool getExtensionFeatures(const AArch64::ExtensionBitset &Extensions, std::vector< StringRef > &Features)
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)