19#define ATTRIBUTE_HANDLER(attr) \
20 { ARMBuildAttrs::attr, &ARMAttributeParser::attr }
22const ARMAttributeParser::DisplayHandler ARMAttributeParser::displayRoutines[] =
70#undef ATTRIBUTE_HANDLER
88 "Pre-v4",
"ARM v4",
"ARM v4T",
"ARM v5T",
"ARM v5TE",
"ARM v5TEJ",
89 "ARM v6",
"ARM v6KZ",
"ARM v6T2",
"ARM v6K",
"ARM v7",
"ARM v6-M",
90 "ARM v6S-M",
"ARM v7E-M",
"ARM v8-A",
"ARM v8-R",
"ARM v8-M Baseline",
91 "ARM v8-M Mainline",
nullptr,
nullptr,
nullptr,
"ARM v8.1-M Mainline",
103 default: profile =
"Unknown";
break;
104 case 'A': profile =
"Application";
break;
105 case 'R': profile =
"Real-time";
break;
106 case 'M': profile =
"Microcontroller";
break;
107 case 'S': profile =
"Classic";
break;
108 case 0: profile =
"None";
break;
116 static const char *strings[] = {
"Not Permitted",
"Permitted"};
121 static const char *strings[] = {
"Not Permitted",
"Thumb-1",
"Thumb-2",
"Permitted"};
126 static const char *strings[] = {
127 "Not Permitted",
"VFPv1",
"VFPv2",
"VFPv3",
"VFPv3-D16",
128 "VFPv4",
"VFPv4-D16",
"ARMv8-a FP",
"ARMv8-a FP-D16"};
133 static const char *strings[] = {
"Not Permitted",
"WMMXv1",
"WMMXv2"};
138 static const char *strings[] = {
"Not Permitted",
"NEONv1",
"NEONv2+FMA",
139 "ARMv8-a NEON",
"ARMv8.1-a NEON"};
144 static const char *strings[] = {
"Not Permitted",
"MVE integer",
145 "MVE integer and float"};
150 static const char *strings[] = {
151 "None",
"Bare Platform",
"Linux Application",
"Linux DSO",
"Palm OS 2004",
152 "Reserved (Palm OS)",
"Symbian OS 2004",
"Reserved (Symbian OS)"};
157 static const char *strings[] = {
"v6",
"Static Base",
"TLS",
"Unused"};
162 static const char *strings[] = {
"Absolute",
"PC-relative",
"SB-relative",
168 static const char *strings[] = {
"Absolute",
"PC-relative",
"Not Permitted"};
173 static const char *strings[] = {
"Not Permitted",
"Direct",
"GOT-Indirect"};
178 static const char *strings[] = {
"Not Permitted",
"Unknown",
"2-byte",
179 "Unknown",
"4-byte"};
184 static const char *strings[] = {
"IEEE-754",
"Runtime"};
189 static const char *strings[] = {
"Unsupported",
"IEEE-754",
"Sign Only"};
194 static const char *strings[] = {
"Not Permitted",
"IEEE-754"};
197Error ARMAttributeParser::ABI_FP_user_exceptions(
AttrType tag) {
198 static const char *strings[] = {
"Not Permitted",
"IEEE-754"};
203 static const char *strings[] = {
"Not Permitted",
"Finite Only",
"RTABI",
209 static const char *strings[] = {
"Not Permitted",
"8-byte alignment",
210 "4-byte alignment",
"Reserved"};
214 std::string description;
215 if (
value < std::size(strings))
216 description = strings[
value];
217 else if (
value <= 12)
218 description =
"8-byte alignment, " + utostr(1ULL <<
value) +
219 "-byte extended alignment";
221 description =
"Invalid";
228 static const char *strings[] = {
"Not Required",
"8-byte data alignment",
229 "8-byte data and code alignment",
"Reserved"};
233 std::string description;
234 if (
value < std::size(strings))
235 description = std::string(strings[
value]);
236 else if (
value <= 12)
237 description = std::string(
"8-byte stack alignment, ") +
238 utostr(1ULL <<
value) + std::string(
"-byte data alignment");
240 description =
"Invalid";
247 static const char *strings[] = {
"Not Permitted",
"Packed",
"Int32",
253 static const char *strings[] = {
"Tag_FP_arch",
"Single-Precision",
"Reserved",
254 "Tag_FP_arch (deprecated)"};
259 static const char *strings[] = {
"AAPCS",
"AAPCS VFP",
"Custom",
265 static const char *strings[] = {
"AAPCS",
"iWMMX",
"Custom"};
269Error ARMAttributeParser::ABI_optimization_goals(
AttrType tag) {
270 static const char *strings[] = {
271 "None",
"Speed",
"Aggressive Speed",
"Size",
"Aggressive Size",
"Debugging",
277Error ARMAttributeParser::ABI_FP_optimization_goals(
AttrType tag) {
278 static const char *strings[] = {
279 "None",
"Speed",
"Aggressive Speed",
"Size",
"Aggressive Size",
280 "Accuracy",
"Best Accuracy"};
292 sw->
startLine() <<
"Value: " << integer <<
", " <<
string <<
'\n';
311Error ARMAttributeParser::CPU_unaligned_access(
AttrType tag) {
312 static const char *strings[] = {
"Not Permitted",
"v6-style"};
317 static const char *strings[] = {
"If Available",
"Permitted"};
322 static const char *strings[] = {
"Not Permitted",
"IEEE-754",
"VFPv3"};
327 static const char *strings[] = {
"Not Permitted",
"Permitted"};
332 static const char *strings[] = {
"If Available",
"Not Permitted",
"Permitted"};
337 static const char *strings[] = {
"Not Permitted",
"Permitted"};
342 static const char *strings[] = {
"Not Permitted",
"Permitted"};
347 static const char *strings[] = {
"Not Permitted",
"TrustZone",
348 "Virtualization Extensions",
349 "TrustZone + Virtualization Extensions"};
354 static const char *strings[] = {
"Not Permitted",
"Permitted in NOP space",
360 static const char *strings[] = {
"Not Permitted",
"Permitted in NOP space",
366 static const char *strings[] = {
"Not Used",
"Used"};
371 static const char *strings[] = {
"Not Used",
"Used"};
381Error ARMAttributeParser::also_compatible_with(
AttrType tag) {
384 std::optional<Error> returnValue;
397 return Item.
attr == InnerTag;
400 if (!ValidInnerTag) {
403 Twine(InnerTag) +
" is not a valid tag number");
409 if (InnerValue >= strings.size()) {
412 Twine(InnerValue) +
" is not a valid " +
417 <<
" = " << InnerValue;
418 if (strings[InnerValue])
419 DescStream <<
" (" << strings[InnerValue] <<
')';
427 " cannot be recursively defined");
435 <<
" = " << InnerValue;
441 <<
" = " << InnerValue;
453 if (!Description.
empty()) {
460 return returnValue ? std::move(*returnValue) :
Error::
success();
463Error ARMAttributeParser::handler(
uint64_t tag,
bool &handled) {
465 for (
const auto &AH : displayRoutines) {
466 if (
uint64_t(AH.attribute) == tag) {
467 if (
Error e = (this->*AH.routine)(
static_cast<AttrType>(tag)))
static const char * CPU_arch_strings[]
#define ATTRIBUTE_HANDLER(attr)
Given that RA is a live value
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void setAttributeString(unsigned tag, StringRef value)
DataExtractor::Cursor cursor
Error parseStringAttribute(const char *name, unsigned tag, ArrayRef< const char * > strings)
void printAttribute(unsigned tag, unsigned value, StringRef valueDesc)
TagNameMap tagToStringMap
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
virtual void printString(StringRef Value)
void printStringEscaped(StringRef Label, StringRef Value)
virtual raw_ostream & startLine()
virtual void printNumber(StringRef Label, char Value)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A raw_ostream that writes to an SmallVector or SmallString.
@ ABI_FP_optimization_goals
StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap, bool hasTagPrefix=true)
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.