Skip to content

Commit 3ef1b07

Browse files
authored
[RISCV] add Double Trap extension requires Zicsr (#141016)
- The double trap extension requires `mtval2' register, so add Zicsr as required extension Signed-off-by: Jerry Zhang Jian <[email protected]>
1 parent 398a1ac commit 3ef1b07

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,9 @@ def FeatureStdExtSscsrind
922922
: RISCVExtension<1, 0, "Indirect CSR Access Supervisor Level">;
923923

924924
def FeatureStdExtSmdbltrp
925-
: RISCVExtension<1, 0, "Double Trap Machine Level">;
925+
: RISCVExtension<1, 0, "Double Trap Machine Level", [FeatureStdExtZicsr]>;
926926
def FeatureStdExtSsdbltrp
927-
: RISCVExtension<1, 0, "Double Trap Supervisor Level">;
927+
: RISCVExtension<1, 0, "Double Trap Supervisor Level", [FeatureStdExtZicsr]>;
928928

929929
def FeatureStdExtSmepmp
930930
: RISCVExtension<1, 0, "Enhanced Physical Memory Protection">;

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,8 @@
496496
; RV32SSAIA: .attribute 5, "rv32i2p1_ssaia1p0"
497497
; RV32SMCSRIND: .attribute 5, "rv32i2p1_smcsrind1p0"
498498
; RV32SSCSRIND: .attribute 5, "rv32i2p1_sscsrind1p0"
499-
; RV32SMDBLTRP: .attribute 5, "rv32i2p1_smdbltrp1p0"
500-
; RV32SSDBLTRP: .attribute 5, "rv32i2p1_ssdbltrp1p0"
499+
; RV32SMDBLTRP: .attribute 5, "rv32i2p1_zicsr2p0_smdbltrp1p0"
500+
; RV32SSDBLTRP: .attribute 5, "rv32i2p1_zicsr2p0_ssdbltrp1p0"
501501
; RV32SSQOSID: .attribute 5, "rv32i2p1_ssqosid1p0"
502502
; RV32SMCDELEG: .attribute 5, "rv32i2p1_smcdeleg1p0"
503503
; RV32SMCNTRPMF: .attribute 5, "rv32i2p1_smcntrpmf1p0"
@@ -653,8 +653,8 @@
653653
; RV64SSAIA: .attribute 5, "rv64i2p1_ssaia1p0"
654654
; RV64SMCSRIND: .attribute 5, "rv64i2p1_smcsrind1p0"
655655
; RV64SSCSRIND: .attribute 5, "rv64i2p1_sscsrind1p0"
656-
; RV64SMDBLTRP: .attribute 5, "rv64i2p1_smdbltrp1p0"
657-
; RV64SSDBLTRP: .attribute 5, "rv64i2p1_ssdbltrp1p0"
656+
; RV64SMDBLTRP: .attribute 5, "rv64i2p1_zicsr2p0_smdbltrp1p0"
657+
; RV64SSDBLTRP: .attribute 5, "rv64i2p1_zicsr2p0_ssdbltrp1p0"
658658
; RV64SSQOSID: .attribute 5, "rv64i2p1_ssqosid1p0"
659659
; RV64SMCDELEG: .attribute 5, "rv64i2p1_smcdeleg1p0"
660660
; RV64SMCNTRPMF: .attribute 5, "rv64i2p1_smcntrpmf1p0"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@
331331
# CHECK: attribute 5, "rv32i2p1_sscsrind1p0"
332332

333333
.attribute arch, "rv32i_smdbltrp1p0"
334-
# CHECK: attribute 5, "rv32i2p1_smdbltrp1p0"
334+
# CHECK: attribute 5, "rv32i2p1_zicsr2p0_smdbltrp1p0"
335335

336336
.attribute arch, "rv32i_ssdbltrp1p0"
337-
# CHECK: attribute 5, "rv32i2p1_ssdbltrp1p0"
337+
# CHECK: attribute 5, "rv32i2p1_zicsr2p0_ssdbltrp1p0"
338338

339339
.attribute arch, "rv32i_smcdeleg1p0"
340340
# CHECK: attribute 5, "rv32i2p1_smcdeleg1p0"

0 commit comments

Comments
 (0)