aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorJun Sha (Joshua) <cooper.joshua@linux.alibaba.com>2023-04-18 16:20:08 +0800
committerJun Sha (Joshua) <cooper.joshua@linux.alibaba.com>2023-04-18 16:20:08 +0800
commitf98ca363bed7405a23ad4b77167e39505a1ca9dd (patch)
treeac2ec9e2bf55a66f499d9e71e34f372057c8be46 /llvm/lib
parent9984cfc86ed6d5c1558d8dd82d82448e50d704ad (diff)
downloadllvm-f98ca363bed7405a23ad4b77167e39505a1ca9dd.zip
llvm-f98ca363bed7405a23ad4b77167e39505a1ca9dd.tar.gz
llvm-f98ca363bed7405a23ad4b77167e39505a1ca9dd.tar.bz2
[RISCV] Modify arch string parsing order according to latest riscv spec
According to latest risc-v spec, the canonical order in which extension names must appear in the name string specified in Table 29.1 is different from before. In the latest table, non-standard extensions must be listed after all standard extensions. To keep consistent, we now change the parsing order in parseArchString(). Reviewed By: asb Differential Revision: https://reviews.llvm.org/D148315
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/RISCVISAInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp
index 9adcd92..85386df 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -758,7 +758,7 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
// Parse the ISA string containing non-standard user-level
// extensions, standard supervisor-level extensions and
// non-standard supervisor-level extensions.
- // These extensions start with 'z', 'x', 's', 'sx' prefixes, follow a
+ // These extensions start with 'z', 's', 's', 'sx' prefixes, follow a
// canonical order, might have a version number (major, minor)
// and are separated by a single underscore '_'.
// Set the hardware features for the extensions that are supported.
@@ -769,7 +769,7 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
OtherExts.split(Split, '_');
SmallVector<StringRef, 8> AllExts;
- std::array<StringRef, 4> Prefix{"z", "x", "s", "sx"};
+ std::array<StringRef, 4> Prefix{"z", "s", "x", "sx"};
auto I = Prefix.begin();
auto E = Prefix.end();
if (Split.size() > 1 || Split[0] != "") {