summaryrefslogtreecommitdiff
path: root/src/instructions/rvi.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-10-14 18:21:28 +0200
committertaitep <taitep@taitep.se>2025-10-14 18:21:28 +0200
commit7a519924cb15f16a683782391e70a6e34700612a (patch)
treee53218460f0a357f3e1ceb7d524258999b0802d4 /src/instructions/rvi.rs
parent6bd31e73fb910d59066adeb11b9d85411e2c743e (diff)
Move funct3 values to rvi.rs instead of being in opcodes.rs
Diffstat (limited to 'src/instructions/rvi.rs')
-rw-r--r--src/instructions/rvi.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs
index e3c0e09..24d45a1 100644
--- a/src/instructions/rvi.rs
+++ b/src/instructions/rvi.rs
@@ -5,18 +5,17 @@ use crate::{
instructions::{
OpcodeHandler,
gen_tools::insert_funct3_splitter,
- opcodes::{FUNCT3_ADDI, FUNCT3_SD, OP_IMM, STORE},
+ opcodes::{OP_IMM, STORE},
},
mem::PageNum,
};
pub(super) fn add_instrs(list: &mut [OpcodeHandler; 32]) {
let funct3_split_op_imm = insert_funct3_splitter(&mut list[OP_IMM as usize].splitter);
- funct3_split_op_imm[FUNCT3_ADDI as usize].handler =
- Some(super::InstructionHandler { runner: addi });
+ funct3_split_op_imm[0b000].handler = Some(super::InstructionHandler { runner: addi }); // ADDI
let funct3_split_store = insert_funct3_splitter(&mut list[STORE as usize].splitter);
- funct3_split_store[FUNCT3_SD as usize].handler = Some(super::InstructionHandler { runner: sd })
+ funct3_split_store[0b011].handler = Some(super::InstructionHandler { runner: sd }) // SD
}
fn addi(core: &mut Core, instr: Instruction) -> InstructionResult {