Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Support/RISCVISAInfo.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | |||||
static const RISCVSupportedExtension SupportedExperimentalExtensions[] = { | static const RISCVSupportedExtension SupportedExperimentalExtensions[] = { | ||||
{"zbe", RISCVExtensionVersion{0, 93}}, | {"zbe", RISCVExtensionVersion{0, 93}}, | ||||
{"zbf", RISCVExtensionVersion{0, 93}}, | {"zbf", RISCVExtensionVersion{0, 93}}, | ||||
{"zbm", RISCVExtensionVersion{0, 93}}, | {"zbm", RISCVExtensionVersion{0, 93}}, | ||||
{"zbp", RISCVExtensionVersion{0, 93}}, | {"zbp", RISCVExtensionVersion{0, 93}}, | ||||
{"zbr", RISCVExtensionVersion{0, 93}}, | {"zbr", RISCVExtensionVersion{0, 93}}, | ||||
{"zbt", RISCVExtensionVersion{0, 93}}, | {"zbt", RISCVExtensionVersion{0, 93}}, | ||||
{"zbpbo", RISCVExtensionVersion{0, 911}}, | |||||
{"zvfh", RISCVExtensionVersion{0, 1}}, | {"zvfh", RISCVExtensionVersion{0, 1}}, | ||||
}; | }; | ||||
static bool stripExperimentalPrefix(StringRef &Ext) { | static bool stripExperimentalPrefix(StringRef &Ext) { | ||||
return Ext.consume_front("experimental-"); | return Ext.consume_front("experimental-"); | ||||
} | } | ||||
// This function finds the first character that doesn't belong to a version | // This function finds the first character that doesn't belong to a version | ||||
▲ Show 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | static Error getExtensionVersion(StringRef Ext, StringRef In, unsigned &Major, | ||||
Major = 0; | Major = 0; | ||||
Minor = 0; | Minor = 0; | ||||
ConsumeLength = 0; | ConsumeLength = 0; | ||||
MajorStr = In.take_while(isDigit); | MajorStr = In.take_while(isDigit); | ||||
In = In.substr(MajorStr.size()); | In = In.substr(MajorStr.size()); | ||||
if (!MajorStr.empty() && In.consume_front("p")) { | if (!MajorStr.empty() && In.consume_front("p")) { | ||||
MinorStr = In.take_while(isDigit); | MinorStr = In.take_while(isDigit); | ||||
In = In.substr(MajorStr.size() + MinorStr.size() - 1); | In = In.substr(MajorStr.size() + MinorStr.size() - 1); | ||||
sunshaoce: Modifications here have been submitted separately in D128644. | |||||
// Expected 'p' to be followed by minor version number. | // Expected 'p' to be followed by minor version number. | ||||
if (MinorStr.empty()) { | if (MinorStr.empty()) { | ||||
return createStringError( | return createStringError( | ||||
errc::invalid_argument, | errc::invalid_argument, | ||||
"minor version number missing after 'p' for extension '" + Ext + "'"); | "minor version number missing after 'p' for extension '" + Ext + "'"); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 619 Lines • Show Last 20 Lines |
Modifications here have been submitted separately in D128644.