summaryrefslogtreecommitdiff
path: root/src/instructions/rvi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/instructions/rvi.rs')
-rw-r--r--src/instructions/rvi.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs
index 2d342df..2eb48f9 100644
--- a/src/instructions/rvi.rs
+++ b/src/instructions/rvi.rs
@@ -64,3 +64,18 @@ pub fn jal(core: &mut Core, instr: Instruction) -> InstructionResult {
core.pc = core.pc.wrapping_add(instr.imm_j());
InstructionResult::Normal
}
+
+pub fn slli(core: &mut Core, instr: Instruction) -> InstructionResult {
+ core.reg_write(instr.rd(), core.reg_read(instr.rs1()) << instr.imm_shamt());
+
+ eprintln!(
+ "slli x{}, x{}, {}",
+ instr.rd(),
+ instr.rs1(),
+ instr.imm_shamt()
+ );
+
+ core.pc = core.pc.wrapping_add(4);
+
+ InstructionResult::Normal
+}