Skip to content

Commit d898761

Browse files
authored
[RISCV] FeatureVendorXwchc should imply FeatureStdExtZca. (llvm#130817)
If we don't do this the binary emission won't set the compressed flag in the ELF header and won't emit alignment NOPs for R_RISCV_ALIGN correctly to support the existence of 2 byte instructions in the stream.
1 parent 7257261 commit d898761

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,8 @@ def HasVendorXMIPSLSP
12811281

12821282
def FeatureVendorXwchc
12831283
: RISCVExtension<2, 2,
1284-
"WCH/QingKe additional compressed opcodes">;
1284+
"WCH/QingKe additional compressed opcodes",
1285+
[FeatureStdExtZca]>;
12851286
def HasVendorXwchc
12861287
: Predicate<"Subtarget->hasVendorXwchc()">,
12871288
AssemblerPredicate<(all_of FeatureVendorXwchc),

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@
402402
; RV32XTHEADMEMIDX: .attribute 5, "rv32i2p1_xtheadmemidx1p0"
403403
; RV32XTHEADMEMPAIR: .attribute 5, "rv32i2p1_xtheadmempair1p0"
404404
; RV32XTHEADSYNC: .attribute 5, "rv32i2p1_xtheadsync1p0"
405-
; RV32XWCHC: .attribute 5, "rv32i2p1_xwchc2p2"
405+
; RV32XWCHC: .attribute 5, "rv32i2p1_zca1p0_xwchc2p2"
406406
; RV32XQCCMP: .attribute 5, "rv32i2p1_zca1p0_xqccmp0p1"
407407
; RV32XQCIA: .attribute 5, "rv32i2p1_xqcia0p4"
408408
; RV32XQCIAC: .attribute 5, "rv32i2p1_zca1p0_xqciac0p3"

0 commit comments

Comments
 (0)