Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/lib/Target/RISCV/RISCVSystemOperands.td
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def : SysReg<"hip", 0x644>;
def : SysReg<"hvip", 0x645>;
def : SysReg<"htinst", 0x64A>;
def : SysReg<"hgeip", 0xE12>;
def : SysReg<"hedelegh", 0x612>;
Copy link
Collaborator

@topperc topperc Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need let isRV32Only = 1 in

Should this be in the "Hypervisor Trap Setup" section with hedeleg.

Copy link
Collaborator

@topperc topperc Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to move to the "Hypervisor Trap Setup" section instead of "Hypervisor Trap Handling". It belongs in the same group as "hedeleg"


//===----------------------------------------------------------------------===//
// Hypervisor Configuration
Expand Down Expand Up @@ -239,6 +240,7 @@ def : SysReg<"mbadaddr", 0x343>;
def : SysReg<"mip", 0x344>;
def : SysReg<"mtinst", 0x34A>;
def : SysReg<"mtval2", 0x34B>;
def : SysReg<"medelegh", 0x312>;

//===----------------------------------------------------------------------===//
// Machine Configuration
Expand Down
18 changes: 18 additions & 0 deletions llvm/test/MC/RISCV/rv32-hypervisor-csr-names.s
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,21 @@ csrrs t2, 0x214, zero
csrrs t1, vsiph, zero
# uimm12
csrrs t2, 0x254, zero

##################################
# Hypervisor Trap Setup
##################################

# hedelegh
# name
# CHECK-INST: csrrs t1, hedelegh, zero
# CHECK-ENC: encoding: [0x73,0x23,0x20,0x61]
# CHECK-INST-ALIAS: csrr t1, hedelegh
# uimm12
# CHECK-INST: csrrs t2, hedelegh, zero
# CHECK-ENC: encoding: [0xf3,0x23,0x20,0x61]
# CHECK-INST-ALIAS: csrr t2, hedelegh
# name
csrrs t1, hedelegh, zero
# uimm12
csrrs t2, 0x612, zero
14 changes: 14 additions & 0 deletions llvm/test/MC/RISCV/rv32-machine-csr-names.s
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ csrrs t1, mstatush, zero
# uimm12
csrrs t2, 0x310, zero

# medelegh
# name
# CHECK-INST: csrrs t1, medelegh, zero
# CHECK-ENC: encoding: [0x73,0x23,0x20,0x31]
# CHECK-INST-ALIAS: csrr t1, medelegh
# uimm12
# CHECK-INST: csrrs t2, medelegh, zero
# CHECK-ENC: encoding: [0xf3,0x23,0x20,0x31]
# CHECK-INST-ALIAS: csrr t2, medelegh
# name
csrrs t1, medelegh, zero
# uimm12
csrrs t2, 0x312, zero

#########################
# Machine Configuration
#########################
Expand Down
Loading