summaryrefslogtreecommitdiff
path: root/src/arch/riscv/isa/base.isa
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/riscv/isa/base.isa')
-rw-r--r--src/arch/riscv/isa/base.isa15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/arch/riscv/isa/base.isa b/src/arch/riscv/isa/base.isa
index 18233e37a..dafccc981 100644
--- a/src/arch/riscv/isa/base.isa
+++ b/src/arch/riscv/isa/base.isa
@@ -51,7 +51,7 @@ output header {{
{}
std::string
- regName(RegIndex reg) const;
+ regName(RegId reg) const;
virtual std::string
generateDisassembly(Addr pc, const SymbolTable *symtab) const = 0;
@@ -68,12 +68,15 @@ output header {{
//Ouputs to decoder.cc
output decoder {{
std::string
- RiscvStaticInst::regName(RegIndex reg) const
+ RiscvStaticInst::regName(RegId reg) const
{
- if (reg < FP_Reg_Base) {
- return std::string(RegisterNames[reg]);
- } else {
- return std::string("f") + std::to_string(reg - FP_Reg_Base);
+ 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);
}
}
}};