Skip to content

Commit d16f8b0

Browse files
committed
Fix c.mop.N decoding
The c.mop.N only accepts rd={x1, x3, x5, x7, x9, x11, x13, x15}. The previous implemention incorrectly accepts additional rd={x17, x19, x21, x23, x25, x27, x29, x31}.
1 parent 7c89063 commit d16f8b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv/insns/c_lui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if (insn.rvc_rd() == 2) { // c.addi16sp
44
WRITE_REG(X_SP, sext_xlen(RVC_SP + insn.rvc_addi16sp_imm()));
55
} else if (insn.rvc_imm() != 0) { // c.lui
66
WRITE_RD(insn.rvc_imm() << 12);
7-
} else if ((insn.rvc_rd() & 1) != 0) { // c.mop.N
7+
} else if ((insn.rvc_rd() & 0x11) == 1) { // c.mop.N
88
#include "c_mop_N.h"
99
} else {
1010
require(false);

0 commit comments

Comments
 (0)