Skip to content

Commit 7fe0630

Browse files
a4lgkito-cheng
authored andcommitted
[RISCV] 'K'-extension ordering
This commit adds 'K' to supported extension list (before 'J'). It makes "Zk*" extensions correctly placed before "Zv*" extensions. Multi-letter "Z*" extensions are first ordered with the most closely related alphabetical extension category ("IMAF..."). This is represented in LLVM as `AllStdExts' variable in `llvm/lib/Support/RISCVISAInfo.cpp'. However, it did not have 'k' making "Zk*" extensions not correctly ordered. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D124340
1 parent 814b605 commit 7fe0630

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/Support/RISCVISAInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct RISCVSupportedExtension {
3737

3838
} // end anonymous namespace
3939

40-
static constexpr StringLiteral AllStdExts = "mafdqlcbjtpvn";
40+
static constexpr StringLiteral AllStdExts = "mafdqlcbkjtpvn";
4141

4242
static const RISCVSupportedExtension SupportedExtensions[] = {
4343
{"i", RISCVExtensionVersion{2, 0}},

llvm/test/MC/RISCV/attribute-arch.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,6 @@
175175

176176
.attribute arch, "rv32i_zk1p0"
177177
# CHECK: attribute 5, "rv32i2p0_zbkb1p0_zbkc1p0_zbkx1p0_zk1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0_zkr1p0_zkt1p0"
178+
179+
.attribute arch, "rv32if_zkt1p0_zve32f1p0_zve32x1p0_zvl32b1p0"
180+
# CHECK: attribute 5, "rv32i2p0_f2p0_zkt1p0_zve32f1p0_zve32x1p0_zvl32b1p0"

0 commit comments

Comments
 (0)