23 .Case(
"thumb,arm",
"arm,thumb")
32 if (A.getName().endswith(Syn))
35 return ArchKind::INVALID;
43 case ArchKind::ARMV2A:
46 case ArchKind::ARMV3M:
49 case ArchKind::ARMV4T:
51 case ArchKind::ARMV5T:
52 case ArchKind::ARMV5TE:
53 case ArchKind::IWMMXT:
54 case ArchKind::IWMMXT2:
55 case ArchKind::XSCALE:
56 case ArchKind::ARMV5TEJ:
59 case ArchKind::ARMV6K:
60 case ArchKind::ARMV6T2:
61 case ArchKind::ARMV6KZ:
62 case ArchKind::ARMV6M:
64 case ArchKind::ARMV7A:
65 case ArchKind::ARMV7VE:
66 case ArchKind::ARMV7R:
67 case ArchKind::ARMV7M:
68 case ArchKind::ARMV7S:
69 case ArchKind::ARMV7EM:
70 case ArchKind::ARMV7K:
72 case ArchKind::ARMV8A:
73 case ArchKind::ARMV8_1A:
74 case ArchKind::ARMV8_2A:
75 case ArchKind::ARMV8_3A:
76 case ArchKind::ARMV8_4A:
77 case ArchKind::ARMV8_5A:
78 case ArchKind::ARMV8R:
79 case ArchKind::ARMV8MBaseline:
80 case ArchKind::ARMV8MMainline:
82 case ArchKind::INVALID:
92 case ArchKind::ARMV6M:
93 case ArchKind::ARMV7M:
94 case ArchKind::ARMV7EM:
95 case ArchKind::ARMV8MMainline:
96 case ArchKind::ARMV8MBaseline:
97 return ProfileKind::M;
98 case ArchKind::ARMV7R:
99 case ArchKind::ARMV8R:
101 case ArchKind::ARMV7A:
102 case ArchKind::ARMV7VE:
103 case ArchKind::ARMV7K:
104 case ArchKind::ARMV8A:
105 case ArchKind::ARMV8_1A:
106 case ArchKind::ARMV8_2A:
107 case ArchKind::ARMV8_3A:
108 case ArchKind::ARMV8_4A:
109 case ArchKind::ARMV8_5A:
111 case ArchKind::ARMV2:
112 case ArchKind::ARMV2A:
113 case ArchKind::ARMV3:
114 case ArchKind::ARMV3M:
115 case ArchKind::ARMV4:
116 case ArchKind::ARMV4T:
117 case ArchKind::ARMV5T:
118 case ArchKind::ARMV5TE:
119 case ArchKind::ARMV5TEJ:
120 case ArchKind::ARMV6:
121 case ArchKind::ARMV6K:
122 case ArchKind::ARMV6T2:
123 case ArchKind::ARMV6KZ:
124 case ArchKind::ARMV7S:
125 case ArchKind::IWMMXT:
126 case ArchKind::IWMMXT2:
127 case ArchKind::XSCALE:
128 case ArchKind::INVALID:
129 return ProfileKind::INVALID;
140 .
Cases(
"v6m",
"v6sm",
"v6s-m",
"v6-m")
141 .
Cases(
"v6z",
"v6zk",
"v6kz")
142 .
Cases(
"v7",
"v7a",
"v7hl",
"v7l",
"v7-a")
145 .
Case(
"v7em",
"v7e-m")
146 .
Cases(
"v8",
"v8a",
"v8l",
"aarch64",
"arm64",
"v8-a")
147 .
Case(
"v8.1a",
"v8.1-a")
148 .
Case(
"v8.2a",
"v8.2-a")
149 .
Case(
"v8.3a",
"v8.3-a")
150 .
Case(
"v8.4a",
"v8.4-a")
151 .
Case(
"v8.5a",
"v8.5-a")
153 .
Case(
"v8m.base",
"v8-m.base")
154 .
Case(
"v8m.main",
"v8-m.main")
160 if (FPUKind >= FK_LAST || FPUKind == FK_INVALID)
165 switch (
FPUNames[FPUKind].Restriction) {
166 case FPURestriction::SP_D16:
167 Features.push_back(
"+fp-only-sp");
168 Features.push_back(
"+d16");
170 case FPURestriction::D16:
171 Features.push_back(
"-fp-only-sp");
172 Features.push_back(
"+d16");
175 Features.push_back(
"-fp-only-sp");
176 Features.push_back(
"-d16");
185 case FPUVersion::VFPV5:
186 Features.push_back(
"+fp-armv8");
188 case FPUVersion::VFPV4:
189 Features.push_back(
"+vfp4");
190 Features.push_back(
"-fp-armv8");
192 case FPUVersion::VFPV3_FP16:
193 Features.push_back(
"+vfp3");
194 Features.push_back(
"+fp16");
195 Features.push_back(
"-vfp4");
196 Features.push_back(
"-fp-armv8");
198 case FPUVersion::VFPV3:
199 Features.push_back(
"+vfp3");
200 Features.push_back(
"-fp16");
201 Features.push_back(
"-vfp4");
202 Features.push_back(
"-fp-armv8");
204 case FPUVersion::VFPV2:
205 Features.push_back(
"+vfp2");
206 Features.push_back(
"-vfp3");
207 Features.push_back(
"-fp16");
208 Features.push_back(
"-vfp4");
209 Features.push_back(
"-fp-armv8");
212 Features.push_back(
"-vfp2");
213 Features.push_back(
"-vfp3");
214 Features.push_back(
"-fp16");
215 Features.push_back(
"-vfp4");
216 Features.push_back(
"-fp-armv8");
221 switch (
FPUNames[FPUKind].NeonSupport) {
222 case NeonSupportLevel::Crypto:
223 Features.push_back(
"+neon");
224 Features.push_back(
"+crypto");
226 case NeonSupportLevel::Neon:
227 Features.push_back(
"+neon");
228 Features.push_back(
"-crypto");
231 Features.push_back(
"-neon");
232 Features.push_back(
"-crypto");
243 return EndianKind::BIG;
247 return EndianKind::BIG;
249 return EndianKind::LITTLE;
253 return EndianKind::LITTLE;
255 return EndianKind::INVALID;
261 .StartsWith(
"aarch64", ISAKind::AARCH64)
271 if (Syn ==
F.getName())
278 if (FPUKind >= FK_LAST)
304 if (A.
substr(offset, 3) ==
"_be")
325 if (A.
size() >= 2 && (A[0] !=
'v' || !std::isdigit(A[1])))
338 .Cases(
"fpa",
"fpe2",
"fpe3",
"maverick",
"invalid")
339 .
Case(
"vfp2",
"vfpv2")
340 .
Case(
"vfp3",
"vfpv3")
341 .
Case(
"vfp4",
"vfpv4")
342 .
Case(
"vfp3-d16",
"vfpv3-d16")
343 .
Case(
"vfp4-d16",
"vfpv4-d16")
344 .
Cases(
"fp4-sp-d16",
"vfpv4-sp-d16",
"fpv4-sp-d16")
345 .
Cases(
"fp4-dp-d16",
"fpv4-dp-d16",
"vfpv4-d16")
346 .
Case(
"fp5-sp-d16",
"fpv5-sp-d16")
347 .
Cases(
"fp5-dp-d16",
"fpv5-dp-d16",
"fpv5-d16")
349 .
Case(
"neon-vfpv3",
"neon")
354 if (FPUKind >= FK_LAST)
360 if (FPUKind >= FK_LAST)
366 if (FPUKind >= FK_LAST)
372 if (CPU ==
"generic")
376 #define
ARM_CPU_NAME(NAME,
ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
377 .Case(NAME, DEFAULT_FPU)
378 #include "llvm/Support/ARMTargetParser.def" 379 .Default(ARM::FK_INVALID);
383 if (CPU ==
"generic")
384 return ARM::ARCHNames[
static_cast<unsigned>(AK)].ArchBaseExtensions;
387 #define
ARM_CPU_NAME(NAME,
ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
391 #include "llvm/Support/ARMTargetParser.def" 402 Features.push_back(
"+hwdiv-arm");
404 Features.push_back(
"-hwdiv-arm");
407 Features.push_back(
"+hwdiv");
409 Features.push_back(
"-hwdiv");
421 Features.push_back(
"+crc");
423 Features.push_back(
"-crc");
426 Features.push_back(
"+dsp");
428 Features.push_back(
"-dsp");
431 Features.push_back(
"+fp16fml");
433 Features.push_back(
"-fp16fml");
436 Features.push_back(
"+ras");
438 Features.push_back(
"-ras");
441 Features.push_back(
"+dotprod");
443 Features.push_back(
"-dotprod");
461 return ARCHNames[
static_cast<unsigned>(AK)].ArchAttr;
466 if (ArchExtKind == AE.ID)
476 if (AE.NegFeature && ArchExtBase == AE.getName())
481 if (AE.Feature && ArchExt == AE.getName())
490 if (HWDivKind ==
D.ID)
498 if (AK == ArchKind::INVALID)
503 if (CPU.ArchID == AK && CPU.Default)
504 return CPU.getName();
514 if (Syn ==
D.getName())
522 if (ArchExt == A.getName())
533 return ArchKind::INVALID;
538 if (Arch.ArchID != ArchKind::INVALID)
566 return "aapcs-linux";
574 return "aapcs-linux";
StringRef getName() const
ISAKind parseArchISA(StringRef Arch)
FPUVersion getFPUVersion(unsigned FPUKind)
This class represents lattice values for constants.
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
void push_back(const T &Elt)
StringRef getArchExtFeature(StringRef ArchExt)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
const FeatureBitset Features
setjmp/longjmp based exceptions
StringRef getCPUAttr(ArchKind AK)
StringRef getCPUAttr(ArchKind AK)
static const FPUName FPUNames[]
unsigned getDefaultFPU(StringRef CPU, ArchKind AK)
bool getHWDivFeatures(unsigned HWDivKind, std::vector< StringRef > &Features)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
NeonSupportLevel NeonSupport
StringRef getArchName(ArchKind AK)
static StringRef getName(Value *V)
StringRef getCanonicalArchName(StringRef Arch)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
NeonSupportLevel getFPUNeonSupportLevel(unsigned FPUKind)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
static StringRef getHWDivSynonym(StringRef HWDiv)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
StringRef getArchName(ArchKind AK)
bool isOSWindows() const
Tests whether the OS is Windows.
A switch()-like statement whose cases are string literals.
StringRef getDefaultCPU(StringRef Arch)
EndianKind parseArchEndian(StringRef Arch)
static const struct @395 Extensions[]
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
StringRef getFPUSynonym(StringRef FPU)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & StartsWith(StringLiteral S, T Value)
unsigned parseArchVersion(StringRef Arch)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
FPURestriction getFPURestriction(unsigned FPUKind)
Triple - Helper class for working with autoconf configuration names.
const struct llvm::ARM::@296 HWDivNames[]
static const ArchNames< ArchKind > ARCHNames[]
StringRef getArchSynonym(StringRef Arch)
StringRef getArchName() const
getArchName - Get the architecture (first) component of the triple.
StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU)
ArchKind parseArch(StringRef Arch)
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
StringRef getHWDivName(unsigned HWDivKind)
#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
StringRef getArchExtName(unsigned ArchExtKind)
void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values)
ProfileKind parseArchProfile(StringRef Arch)
bool getExtensionFeatures(unsigned Extensions, std::vector< StringRef > &Features)
ArchKind parseCPUArch(StringRef CPU)
FPURestriction Restriction
unsigned parseArchExt(StringRef ArchExt)
StringRef getName() const
Return a constant reference to the value's name.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
StringRef getFPUName(unsigned FPUKind)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
unsigned getDefaultExtensions(StringRef CPU, ArchKind AK)
ArchKind parseCPUArch(StringRef CPU)
static Triple::ArchType parseArch(StringRef ArchName)
StringRef getSubArch(ArchKind AK)
StringRef getSubArch(ArchKind AK)
bool getFPUFeatures(unsigned FPUKind, std::vector< StringRef > &Features)
const ExtName ARCHExtNames[]
Lightweight error class with error context and mandatory checking.
unsigned parseHWDiv(StringRef HWDiv)
unsigned parseFPU(StringRef FPU)
StringRef - Represent a constant reference to a string, i.e.
unsigned getArchAttr(ArchKind AK)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
const CpuNames< ArchKind > CPUNames[]