diff --git a/llvm/lib/Target/RISCV/RISCVSystemOperands.td b/llvm/lib/Target/RISCV/RISCVSystemOperands.td index 8e75647bd4a9..16399fea150e 100644 --- a/llvm/lib/Target/RISCV/RISCVSystemOperands.td +++ b/llvm/lib/Target/RISCV/RISCVSystemOperands.td @@ -310,7 +310,9 @@ def: SysReg<"mhpmcounter31h", 0xB9F>; //===-------------------------- // Machine Counter Setup //===-------------------------- +let AltName = "mucounteren" in // Privileged spec v1.9.1 Name def : SysReg<"mcountinhibit", 0x320>; + def : SysReg<"mhpmevent3", 0x323>; def : SysReg<"mhpmevent4", 0x324>; def : SysReg<"mhpmevent5", 0x325>; diff --git a/llvm/test/MC/RISCV/machine-csr-names.s b/llvm/test/MC/RISCV/machine-csr-names.s index 93ecd7e173ff..dbc4f5fcb824 100644 --- a/llvm/test/MC/RISCV/machine-csr-names.s +++ b/llvm/test/MC/RISCV/machine-csr-names.s @@ -863,6 +863,20 @@ csrrs t1, mcountinhibit, zero # uimm12 csrrs t2, 0x320, zero +# mucounteren +# name +# CHECK-INST: csrrs t1, mcountinhibit, zero +# CHECK-ENC: encoding: [0x73,0x23,0x00,0x32] +# CHECK-INST-ALIAS: csrr t1, mcountinhibit +# uimm12 +# CHECK-INST: csrrs t2, mcountinhibit, zero +# CHECK-ENC: encoding: [0xf3,0x23,0x00,0x32] +# CHECK-INST-ALIAS: csrr t2, mcountinhibit +# name +csrrs t1, mucounteren, zero +# uimm12 +csrrs t2, 0x320, zero + # mhpmevent3 # name # CHECK-INST: csrrs t1, mhpmevent3, zero