Skip to content

Commit 98c6c37

Browse files
authored
[RISCV] Xqccmp v0.3 (#137854)
All the changes for v0.2 and v0.3 are either already implemented, or irrelevant to the compiler implementation.
1 parent c0ac951 commit 98c6c37

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
// CHECK-NEXT: smctr 1.0 'Smctr' (Control Transfer Records Machine Level)
214214
// CHECK-NEXT: ssctr 1.0 'Ssctr' (Control Transfer Records Supervisor Level)
215215
// CHECK-NEXT: svukte 0.3 'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)
216-
// CHECK-NEXT: xqccmp 0.1 'Xqccmp' (Qualcomm 16-bit Push/Pop and Double Moves)
216+
// CHECK-NEXT: xqccmp 0.3 'Xqccmp' (Qualcomm 16-bit Push/Pop and Double Moves)
217217
// CHECK-NEXT: xqcia 0.7 'Xqcia' (Qualcomm uC Arithmetic Extension)
218218
// CHECK-NEXT: xqciac 0.3 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)
219219
// CHECK-NEXT: xqcibi 0.2 'Xqcibi' (Qualcomm uC Branch Immediate Extension)

llvm/docs/RISCVUsage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ The current vendor extensions supported are:
442442
LLVM implements `the custom compressed opcodes present in some QingKe cores` by WCH / Nanjing Qinheng Microelectronics. The vendor refers to these opcodes by the name "XW".
443443

444444
``experimental-Xqccmp``
445-
LLVM implements `version 0.1 of the 16-bit Push/Pop instructions and double-moves extension specification <https://github.com/quic/riscv-unified-db/releases/tag/Xqccmp_extension-0.1.0>`__ by Qualcomm. All instructions are prefixed with `qc.` as described in the specification.
445+
LLVM implements `version 0.3 of the 16-bit Push/Pop instructions and double-moves extension specification <https://github.com/quic/riscv-unified-db/releases/tag/Xqccmp_extension-0.3.0>`__ by Qualcomm. All instructions are prefixed with `qc.` as described in the specification.
446446

447447
``experimental-Xqcia``
448448
LLVM implements `version 0.7 of the Qualcomm uC Arithmetic extension specification <https://github.com/quic/riscv-unified-db/releases/tag/Xqci-0.13.0>`__ by Qualcomm. These instructions are only available for riscv32.

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,8 @@ def HasVendorXwchc
14261426
// Qualcomm Extensions
14271427

14281428
def FeatureVendorXqccmp
1429-
: RISCVExperimentalExtension<0, 1, "Qualcomm 16-bit Push/Pop and Double Moves",
1429+
: RISCVExperimentalExtension<0, 3,
1430+
"Qualcomm 16-bit Push/Pop and Double Moves",
14301431
[FeatureStdExtZca]>;
14311432
def HasVendorXqccmp
14321433
: Predicate<"Subtarget->hasVendorXqccmp()">,

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
; RV32XTHEADMEMPAIR: .attribute 5, "rv32i2p1_xtheadmempair1p0"
438438
; RV32XTHEADSYNC: .attribute 5, "rv32i2p1_xtheadsync1p0"
439439
; RV32XWCHC: .attribute 5, "rv32i2p1_zca1p0_xwchc2p2"
440-
; RV32XQCCMP: .attribute 5, "rv32i2p1_zca1p0_xqccmp0p1"
440+
; RV32XQCCMP: .attribute 5, "rv32i2p1_zca1p0_xqccmp0p3"
441441
; RV32XQCIA: .attribute 5, "rv32i2p1_xqcia0p7"
442442
; RV32XQCIAC: .attribute 5, "rv32i2p1_zca1p0_xqciac0p3"
443443
; RV32XQCIBI: .attribute 5, "rv32i2p1_zca1p0_xqcibi0p2"
@@ -683,7 +683,7 @@
683683
; RV64SSCTR: .attribute 5, "rv64i2p1_sscsrind1p0_ssctr1p0"
684684
; RV64SDEXT: .attribute 5, "rv64i2p1_sdext1p0"
685685
; RV64SDTRIG: .attribute 5, "rv64i2p1_sdtrig1p0"
686-
; RV64XQCCMP: .attribute 5, "rv64i2p1_zca1p0_xqccmp0p1"
686+
; RV64XQCCMP: .attribute 5, "rv64i2p1_zca1p0_xqccmp0p3"
687687

688688
; RVI20U32: .attribute 5, "rv32i2p1"
689689
; RVI20U64: .attribute 5, "rv64i2p1"

llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,13 +695,13 @@ TEST(ParseArchString, RejectsConflictingExtensions) {
695695

696696
for (StringRef Input :
697697
{"rv32idc_xqciac0p3", "rv32i_zcd_xqciac0p3", "rv32idc_xqcicm0p2",
698-
"rv32i_zcd_xqcicm0p2", "rv32idc_xqccmp0p1", "rv32i_zcd_xqccmp0p1"}) {
698+
"rv32i_zcd_xqcicm0p2", "rv32idc_xqccmp0p3", "rv32i_zcd_xqccmp0p3"}) {
699699
EXPECT_THAT(
700700
toString(RISCVISAInfo::parseArchString(Input, true).takeError()),
701701
::testing::EndsWith("extension when 'd' extension is enabled"));
702702
}
703703

704-
for (StringRef Input : {"rv32i_zcmp_xqccmp0p1", "rv64i_zcmp_xqccmp0p1"}) {
704+
for (StringRef Input : {"rv32i_zcmp_xqccmp0p3", "rv64i_zcmp_xqccmp0p3"}) {
705705
EXPECT_EQ(toString(RISCVISAInfo::parseArchString(Input, true).takeError()),
706706
"'zcmp' and 'xqccmp' extensions are incompatible");
707707
}
@@ -1184,7 +1184,7 @@ Experimental extensions
11841184
smctr 1.0
11851185
ssctr 1.0
11861186
svukte 0.3
1187-
xqccmp 0.1
1187+
xqccmp 0.3
11881188
xqcia 0.7
11891189
xqciac 0.3
11901190
xqcibi 0.2

0 commit comments

Comments
 (0)