rvcpp simulator: fix bad regnum decode for c.slli outside of x8..x15
This commit is contained in:
parent
54f0a593c8
commit
26d699e18c
|
@ -508,7 +508,7 @@ struct RVCore {
|
|||
}
|
||||
// RVC Quadrant 10:
|
||||
} else if (RVOPC_MATCH(instr, C_SLLI)) {
|
||||
regnum_rd = c_rs1_s(instr);
|
||||
regnum_rd = c_rs1_l(instr);
|
||||
rd_wdata = regs[regnum_rd] << GETBITS(instr, 6, 2);
|
||||
} else if (RVOPC_MATCH(instr, C_MV)) {
|
||||
if (c_rs2_l(instr) == 0) {
|
||||
|
@ -587,7 +587,7 @@ struct RVCore {
|
|||
} else {
|
||||
printf(" %04x : ", instr & 0xffffu);
|
||||
}
|
||||
if (regnum_rd != 0) {
|
||||
if (regnum_rd != 0 && rd_wdata) {
|
||||
printf("%-3s <- %08x ", friendly_reg_names[regnum_rd], *rd_wdata);
|
||||
} else {
|
||||
printf(" ");
|
||||
|
|
|
@ -334,7 +334,7 @@
|
|||
#define RVOPC_CM_MVA01S_BITS 0b1010110001100010
|
||||
#define RVOPC_CM_MVA01S_MASK 0b1111110001100011
|
||||
|
||||
#define _RVOPC_MATCH(x, instr_mask, instr_bits) ((x & instr_mask) == instr_bits)
|
||||
#define _RVOPC_MATCH(x, instr_mask, instr_bits) (((x) & (instr_mask)) == (instr_bits))
|
||||
#define RVOPC_MATCH(x, instr) _RVOPC_MATCH(x, RVOPC_ ## instr ## _MASK, RVOPC_ ## instr ## _BITS)
|
||||
|
||||
static const char *friendly_reg_names[32] = {
|
||||
|
|
Loading…
Reference in New Issue