From 047491581cd6437620a19b51594a35c158a53466 Mon Sep 17 00:00:00 2001 From: Weiwei Li Date: Fri, 2 Jun 2023 23:41:49 +0800 Subject: Fix bugs in disassembling code for cm.mva01s/mvsa01 instructions. (Resolved issue #1370) --- disasm/disasm.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'disasm') diff --git a/disasm/disasm.cc b/disasm/disasm.cc index fef9fac..2fce1a1 100644 --- a/disasm/disasm.cc +++ b/disasm/disasm.cc @@ -238,6 +238,18 @@ struct : public arg_t { struct : public arg_t { std::string to_string(insn_t insn) const { + return xpr_name[RVC_R1S]; + } +} rvc_r1s; + +struct : public arg_t { + std::string to_string(insn_t insn) const { + return xpr_name[RVC_R2S]; + } +} rvc_r2s; + +struct : public arg_t { + std::string to_string(insn_t insn) const { return fpr_name[insn.rvc_rs2s()]; } } rvc_fp_rs2s; @@ -1347,8 +1359,8 @@ void disassembler_t::add_instructions(const isa_parser_t* isa) DISASM_INSN("cm.popretz", cm_popretz, 0, {&rvcm_pushpop_rlist, &rvcm_pop_stack_adj_64}); } - DISASM_INSN("cm.mva01s", cm_mva01s, 0, {&rvc_rs1s, &rvc_rs2s}); - DISASM_INSN("cm.mvsa01", cm_mvsa01, 0, {&rvc_rs1s, &rvc_rs2s}); + DISASM_INSN("cm.mva01s", cm_mva01s, 0, {&rvc_r1s, &rvc_r2s}); + DISASM_INSN("cm.mvsa01", cm_mvsa01, 0, {&rvc_r1s, &rvc_r2s}); } if (isa->extension_enabled(EXT_ZCMT)) { -- cgit v1.1