From 7f746b7c2f27f6271640efaeb2cde86fd1b86957 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Thu, 10 Aug 2017 15:50:30 -0700 Subject: [PATCH] Correct c.li and c.lui disassembly (#118) I currently get this disassembly 00004881 jr a7 but if I understand that's incorrect and I want 00004881 li a7, 0 If I'm reading the ISA manual correctly, the disassembler was just wrong here. --- spike_main/disasm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spike_main/disasm.cc b/spike_main/disasm.cc index 56c6fe6..eedc6b8 100644 --- a/spike_main/disasm.cc +++ b/spike_main/disasm.cc @@ -500,8 +500,8 @@ disassembler_t::disassembler_t(int xlen) DISASM_INSN("ebreak", c_add, mask_rd | mask_rvc_rs2, {}); add_insn(new disasm_insn_t("ret", match_c_li | match_rd_ra, mask_c_li | mask_rd | mask_rvc_imm, {})); - DISASM_INSN("jr", c_li, mask_rvc_imm, {&rvc_rs1}); - DISASM_INSN("jalr", c_lui, mask_rvc_imm, {&rvc_rs1}); + DISASM_INSN("jr", c_jr, mask_rvc_imm, {&rvc_rs1}); + DISASM_INSN("jalr", c_jalr, mask_rvc_imm, {&rvc_rs1}); DISASM_INSN("nop", c_addi, mask_rd | mask_rvc_imm, {}); DISASM_INSN("addi", c_addi16sp, mask_rd, {&rvc_sp, &rvc_sp, &rvc_addi16sp_imm}); DISASM_INSN("addi", c_addi4spn, 0, {&rvc_rs1s, &rvc_sp, &rvc_addi4spn_imm}); -- 2.30.2