aboutsummaryrefslogtreecommitdiff
path: root/riscv
diff options
context:
space:
mode:
authorYenHaoChen <howard25336284@gmail.com>2024-02-16 10:32:52 +0800
committerYenHaoChen <howard25336284@gmail.com>2024-02-16 10:32:55 +0800
commitd16f8b06dd000d243c9ff29c374abc17124ae5a1 (patch)
treec4e6484098344f8081d4c18ae88de2b3b432de54 /riscv
parent7c890632ec91104fe6ccd9f16f70842c4412a1fd (diff)
downloadspike-d16f8b06dd000d243c9ff29c374abc17124ae5a1.zip
spike-d16f8b06dd000d243c9ff29c374abc17124ae5a1.tar.gz
spike-d16f8b06dd000d243c9ff29c374abc17124ae5a1.tar.bz2
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}.
Diffstat (limited to 'riscv')
-rw-r--r--riscv/insns/c_lui.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/insns/c_lui.h b/riscv/insns/c_lui.h
index 3e0e02f..7a82c13 100644
--- a/riscv/insns/c_lui.h
+++ b/riscv/insns/c_lui.h
@@ -4,7 +4,7 @@ if (insn.rvc_rd() == 2) { // c.addi16sp
WRITE_REG(X_SP, sext_xlen(RVC_SP + insn.rvc_addi16sp_imm()));
} else if (insn.rvc_imm() != 0) { // c.lui
WRITE_RD(insn.rvc_imm() << 12);
-} else if ((insn.rvc_rd() & 1) != 0) { // c.mop.N
+} else if ((insn.rvc_rd() & 0x11) == 1) { // c.mop.N
#include "c_mop_N.h"
} else {
require(false);