summaryrefslogtreecommitdiff
path: root/src/instructions
diff options
context:
space:
mode:
Diffstat (limited to 'src/instructions')
-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();