summaryrefslogtreecommitdiff
path: root/src/instructions/rvi.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-23 18:42:50 +0100
committertaitep <taitep@taitep.se>2025-12-23 18:42:50 +0100
commit0c6a540a85f3ac07e4354fc567e27b89d3584c14 (patch)
treea2ae2b7b58ec819db364c9eb07b0ab41d6b10bf9 /src/instructions/rvi.rs
parent23392a55dff889bad89dcb495390fde88e3bfb69 (diff)
Implement SRLI
Diffstat (limited to 'src/instructions/rvi.rs')
-rw-r--r--src/instructions/rvi.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs
index 7ca9acc..6766fdf 100644
--- a/src/instructions/rvi.rs
+++ b/src/instructions/rvi.rs
@@ -79,6 +79,12 @@ pub fn slli(core: &mut Core, instr: Instruction) -> InstructionResult {
InstructionResult::Normal
}
+pub fn srli(core: &mut Core, instr: Instruction) -> InstructionResult {
+ core.reg_write(instr.rd(), core.reg_read(instr.rs1()) >> instr.imm_shamt());
+ core.advance_pc();
+ InstructionResult::Normal
+}
+
pub fn lui(core: &mut Core, instr: Instruction) -> InstructionResult {
core.reg_write(instr.rd(), instr.imm_u());
core.advance_pc();