25 .
Case(
"thumb,arm",
"arm,thumb")
34 if (
A.Name.ends_with(Syn))
37 return ArchKind::INVALID;
45 case ArchKind::ARMV4T:
47 case ArchKind::ARMV5T:
48 case ArchKind::ARMV5TE:
49 case ArchKind::IWMMXT:
50 case ArchKind::IWMMXT2:
51 case ArchKind::XSCALE:
52 case ArchKind::ARMV5TEJ:
55 case ArchKind::ARMV6K:
56 case ArchKind::ARMV6T2:
57 case ArchKind::ARMV6KZ:
58 case ArchKind::ARMV6M:
60 case ArchKind::ARMV7A:
61 case ArchKind::ARMV7VE:
62 case ArchKind::ARMV7R:
63 case ArchKind::ARMV7M:
64 case ArchKind::ARMV7S:
65 case ArchKind::ARMV7EM:
66 case ArchKind::ARMV7K:
68 case ArchKind::ARMV8A:
69 case ArchKind::ARMV8_1A:
70 case ArchKind::ARMV8_2A:
71 case ArchKind::ARMV8_3A:
72 case ArchKind::ARMV8_4A:
73 case ArchKind::ARMV8_5A:
74 case ArchKind::ARMV8_6A:
75 case ArchKind::ARMV8_7A:
76 case ArchKind::ARMV8_8A:
77 case ArchKind::ARMV8_9A:
78 case ArchKind::ARMV8R:
79 case ArchKind::ARMV8MBaseline:
80 case ArchKind::ARMV8MMainline:
81 case ArchKind::ARMV8_1MMainline:
83 case ArchKind::ARMV9A:
84 case ArchKind::ARMV9_1A:
85 case ArchKind::ARMV9_2A:
86 case ArchKind::ARMV9_3A:
87 case ArchKind::ARMV9_4A:
88 case ArchKind::ARMV9_5A:
89 case ArchKind::ARMV9_6A:
90 case ArchKind::ARMV9_7A:
91 case ArchKind::ARMV9_8A:
93 case ArchKind::INVALID:
101 case ARM::ArchKind::ARMV6M:
102 case ARM::ArchKind::ARMV7M:
103 case ARM::ArchKind::ARMV7EM:
104 case ARM::ArchKind::ARMV8MMainline:
105 case ARM::ArchKind::ARMV8MBaseline:
106 case ARM::ArchKind::ARMV8_1MMainline:
108 case ARM::ArchKind::ARMV7R:
109 case ARM::ArchKind::ARMV8R:
111 case ARM::ArchKind::ARMV7A:
112 case ARM::ArchKind::ARMV7VE:
113 case ARM::ArchKind::ARMV7K:
114 case ARM::ArchKind::ARMV8A:
115 case ARM::ArchKind::ARMV8_1A:
116 case ARM::ArchKind::ARMV8_2A:
117 case ARM::ArchKind::ARMV8_3A:
118 case ARM::ArchKind::ARMV8_4A:
119 case ARM::ArchKind::ARMV8_5A:
120 case ARM::ArchKind::ARMV8_6A:
121 case ARM::ArchKind::ARMV8_7A:
122 case ARM::ArchKind::ARMV8_8A:
123 case ARM::ArchKind::ARMV8_9A:
124 case ARM::ArchKind::ARMV9A:
125 case ARM::ArchKind::ARMV9_1A:
126 case ARM::ArchKind::ARMV9_2A:
127 case ARM::ArchKind::ARMV9_3A:
128 case ARM::ArchKind::ARMV9_4A:
129 case ARM::ArchKind::ARMV9_5A:
130 case ARM::ArchKind::ARMV9_6A:
131 case ARM::ArchKind::ARMV9_7A:
132 case ARM::ArchKind::ARMV9_8A:
134 case ARM::ArchKind::ARMV4:
135 case ARM::ArchKind::ARMV4T:
136 case ARM::ArchKind::ARMV5T:
137 case ARM::ArchKind::ARMV5TE:
138 case ARM::ArchKind::ARMV5TEJ:
139 case ARM::ArchKind::ARMV6:
140 case ARM::ArchKind::ARMV6K:
141 case ARM::ArchKind::ARMV6T2:
142 case ARM::ArchKind::ARMV6KZ:
143 case ARM::ArchKind::ARMV7S:
144 case ARM::ArchKind::IWMMXT:
145 case ARM::ArchKind::IWMMXT2:
146 case ARM::ArchKind::XSCALE:
147 case ARM::ArchKind::INVALID:
160 std::vector<StringRef> &Features) {
165 static const struct FPUFeatureNameInfo {
166 const char *PlusName, *MinusName;
169 } FPUFeatureInfoList[] = {
197 for (
const auto &Info: FPUFeatureInfoList) {
200 Features.push_back(Info.PlusName);
202 Features.push_back(Info.MinusName);
205 static const struct NeonFeatureNameInfo {
206 const char *PlusName, *MinusName;
208 } NeonFeatureInfoList[] = {
214 for (
const auto &Info: NeonFeatureInfoList) {
216 Features.push_back(Info.PlusName);
218 Features.push_back(Info.MinusName);
241 .
Cases({
"fpa",
"fpe2",
"fpe3",
"maverick"},
"invalid")
242 .Case(
"vfp2",
"vfpv2")
243 .
Case(
"vfp3",
"vfpv3")
244 .
Case(
"vfp4",
"vfpv4")
245 .
Case(
"vfp3-d16",
"vfpv3-d16")
246 .
Case(
"vfp4-d16",
"vfpv4-d16")
247 .
Cases({
"fp4-sp-d16",
"vfpv4-sp-d16"},
"fpv4-sp-d16")
248 .Cases({
"fp4-dp-d16",
"fpv4-dp-d16"},
"vfpv4-d16")
249 .Case(
"fp5-sp-d16",
"fpv5-sp-d16")
250 .
Cases({
"fp5-dp-d16",
"fpv5-dp-d16"},
"fpv5-d16")
252 .Case(
"neon-vfpv3",
"neon")
275 if (CPU ==
"generic")
279#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
280 .Case(NAME, DEFAULT_FPU)
281#include "llvm/TargetParser/ARMTargetParser.def"
286 if (CPU ==
"generic")
290#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
292 ARMArchNames[static_cast<unsigned>(ArchKind::ID)].ArchBaseExtensions | \
294#include "llvm/TargetParser/ARMTargetParser.def"
299 std::vector<StringRef> &Features) {
305 Features.push_back(
"+hwdiv-arm");
307 Features.push_back(
"-hwdiv-arm");
310 Features.push_back(
"+hwdiv");
312 Features.push_back(
"-hwdiv");
318 std::vector<StringRef> &Features) {
324 if ((
Extensions & AE.ID) == AE.ID && !AE.Feature.empty())
325 Features.push_back(AE.Feature);
326 else if (!AE.NegFeature.empty())
327 Features.push_back(AE.NegFeature);
346 return ARMArchNames[
static_cast<unsigned>(AK)].ArchAttr;
358 return Name.consume_front(
"no");
364 if (!AE.Feature.empty() && ArchExt == AE.Name)
365 return StringRef(Negated ? AE.NegFeature : AE.Feature);
372 if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE)
373 return ARM::FK_INVALID;
385 if (CandidateFPU.FPUVer == InputFPU.
FPUVer &&
386 CandidateFPU.NeonSupport == InputFPU.
NeonSupport &&
390 return CandidateFPU.ID;
395 return ARM::FK_INVALID;
399 if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE)
400 return ARM::FK_INVALID;
414 if (CandidateFPU.FPUVer == InputFPU.
FPUVer &&
416 return CandidateFPU.ID;
421 return ARM::FK_INVALID;
426 std::vector<StringRef> &Features,
429 size_t StartingNumFeatures = Features.size();
438 if ((AE.ID &
ID) ==
ID && !AE.NegFeature.empty())
439 Features.push_back(AE.NegFeature);
441 if ((AE.ID &
ID) == AE.ID && !AE.Feature.empty())
442 Features.push_back(AE.Feature);
449 if (ArchExt ==
"fp" || ArchExt ==
"fp.dp") {
452 if (ArchExt ==
"fp.dp") {
453 const bool IsDP = ArgFPUKind != ARM::FK_INVALID &&
454 ArgFPUKind != ARM::FK_NONE &&
460 if (ArgFPUKind != ARM::FK_INVALID && !IsDP)
463 if (
FPUKind == ARM::FK_INVALID)
469 if (
FPUKind == ARM::FK_INVALID)
472 }
else if (Negated) {
480 return StartingNumFeatures != Features.size();
485 return ARM::ArchKind::INVALID;
486 if (AK < ARM::ArchKind::ARMV9A || AK > ARM::ArchKind::ARMV9_3A)
487 return ARM::ArchKind::INVALID;
488 unsigned AK_v8 =
static_cast<unsigned>(ARM::ArchKind::ARMV8_5A);
489 AK_v8 +=
static_cast<unsigned>(AK) -
490 static_cast<unsigned>(ARM::ArchKind::ARMV9A);
496 if (AK == ArchKind::INVALID)
501 if (CPU.ArchID == AK && CPU.Default)
520 if (ArchExt ==
A.Name)
531 return ArchKind::INVALID;
536 if (Arch.ArchID != ArchKind::INVALID)
537 Values.push_back(Arch.Name);
544 if (
TT.isOSBinFormatMachO()) {
552 }
else if (
TT.isOSWindows())
557 switch (
TT.getEnvironment()) {
566 return "aapcs-linux";
573 if (
TT.isOSFreeBSD() ||
TT.isOSFuchsia() ||
TT.isOSOpenBSD() ||
574 TT.isOSHaiku() ||
TT.isOHOSFamily())
575 return "aapcs-linux";
584 if (ABIName ==
"aapcs16")
607 if (!MArch.
empty() && MArch ==
"v6")
608 return "arm1176jzf-s";
609 if (!MArch.
empty() && MArch ==
"v7")
634 if (!CPU.empty() && CPU !=
"invalid")
641 return "arm1176jzf-s";
662 return "arm1176jzf-s";
672 outs() <<
"All available -march extensions for ARM\n\n"
674 << (DescMap.
empty() ?
"\n" :
"Description\n");
677 if (!Ext.Feature.empty()) {
678 std::string Description = DescMap[Ext.Name].str();
681 if (Ext.Name ==
"simd")
682 Description = DescMap[
"neon"].str();
684 <<
format(Description.empty() ?
"%s\n" :
"%-20s%s\n",
685 Ext.Name.str().c_str(), Description.c_str());
static ARM::FPUKind findSinglePrecisionFPU(ARM::FPUKind InputFPUKind)
static StringRef getHWDivSynonym(StringRef HWDiv)
static bool stripNegationPrefix(StringRef &Name)
static ARM::ProfileKind getProfileKind(ARM::ArchKind AK)
static ARM::FPUKind findDoublePrecisionFPU(ARM::FPUKind InputFPUKind)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static cl::opt< ExtensionSet, false, SPIRVExtensionsParser > Extensions("spirv-ext", cl::desc("Specify list of enabled SPIR-V extensions"))
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
Triple - Helper class for working with autoconf configuration names.
OSType getOS() const
Get the parsed operating system type of this triple.
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
LLVM_ABI StringRef getArchName() const
Get the architecture (first) component of the triple.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr struct llvm::ARM::@324103115345140202011004052154345301224214323271 HWDivNames[]
LLVM_ABI StringRef getArchExtName(uint64_t ArchExtKind)
LLVM_ABI StringRef getFPUSynonym(StringRef FPU)
LLVM_ABI bool getFPUFeatures(FPUKind FPUKind, std::vector< StringRef > &Features)
LLVM_ABI StringRef getCanonicalArchName(StringRef Arch)
MArch is expected to be of the form (arm|thumb)?(eb)?(v.
LLVM_ABI uint64_t parseHWDiv(StringRef HWDiv)
LLVM_ABI StringRef getCPUAttr(ArchKind AK)
LLVM_ABI StringRef getArchName(ArchKind AK)
LLVM_ABI void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values)
LLVM_ABI LLVM_READONLY ARMABI computeTargetABI(const Triple &TT, StringRef ABIName="")
LLVM_ABI uint64_t parseArchExt(StringRef ArchExt)
LLVM_ABI ArchKind convertV9toV8(ArchKind AK)
LLVM_ABI LLVM_READONLY StringRef computeDefaultTargetABI(const Triple &TT)
@ Crypto
Neon with Crypto.
LLVM_ABI ArchKind parseArch(StringRef Arch)
LLVM_ABI FPURestriction getFPURestriction(FPUKind FPUKind)
LLVM_ABI bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt, std::vector< StringRef > &Features, FPUKind &ArgFPUKind)
LLVM_ABI StringRef getArchSynonym(StringRef Arch)
Converts e.g. "armv8" -> "armv8-a".
static constexpr FPUName FPUNames[]
LLVM_ABI StringRef getDefaultCPU(StringRef Arch)
LLVM_ABI StringRef getArchExtFeature(StringRef ArchExt)
LLVM_ABI ProfileKind parseArchProfile(StringRef Arch)
LLVM_ABI FPUKind parseFPU(StringRef FPU)
LLVM_ABI StringRef getSubArch(ArchKind AK)
LLVM_ABI StringRef getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch={})
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
LLVM_ABI unsigned parseArchVersion(StringRef Arch)
bool has32Regs(const FPURestriction restriction)
LLVM_ABI NeonSupportLevel getFPUNeonSupportLevel(FPUKind FPUKind)
LLVM_ABI ArchKind parseCPUArch(StringRef CPU)
bool isDoublePrecision(const FPURestriction restriction)
constexpr ExtName ARCHExtNames[]
LLVM_ABI unsigned getArchAttr(ArchKind AK)
LLVM_ABI StringRef getFPUName(FPUKind FPUKind)
LLVM_ABI FPUVersion getFPUVersion(FPUKind FPUKind)
LLVM_ABI bool getHWDivFeatures(uint64_t HWDivKind, std::vector< StringRef > &Features)
@ SP_D16
Only single-precision instructions, with 16 D registers.
@ D16
Only 16 D registers.
LLVM_ABI uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK)
LLVM_ABI FPUKind getDefaultFPU(StringRef CPU, ArchKind AK)
LLVM_ABI bool getExtensionFeatures(uint64_t Extensions, std::vector< StringRef > &Features)
static constexpr ArchNames ARMArchNames[]
constexpr CpuNames CPUNames[]
LLVM_ABI void PrintSupportedExtensions(StringMap< StringRef > DescMap)
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr Values
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
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.
FPURestriction Restriction
NeonSupportLevel NeonSupport