diff options
Diffstat (limited to 'src/arch/riscv/isa/base.isa')
-rw-r--r-- | src/arch/riscv/isa/base.isa | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/arch/riscv/isa/base.isa b/src/arch/riscv/isa/base.isa index dafccc981..a7e2fc954 100644 --- a/src/arch/riscv/isa/base.isa +++ b/src/arch/riscv/isa/base.isa @@ -70,13 +70,12 @@ output decoder {{ std::string RiscvStaticInst::regName(RegId reg) const { - switch (reg.regClass) { - case IntRegClass: - return std::string(RegisterNames[reg.regIdx]); - case FloatRegClass: - return std::string("f") + std::to_string(reg.regIdx); - default: - return csprintf("unknown[%i/%i]", reg.regClass, reg.regIdx); + if (reg.isIntReg()) { + return std::string(RegisterNames[reg.index()]); + } else if (reg.isFloatReg()) { + return std::string("f") + std::to_string(reg.index()); + } else { + return csprintf("%s{%i}", reg.className(), reg.index()); } } }}; |