From 2b5eb96187c8aa67b5d43abf1917e7158620f2f8 Mon Sep 17 00:00:00 2001 From: taitep Date: Mon, 22 Dec 2025 21:17:38 +0100 Subject: Implement BLTU --- src/instructions/rvi.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/instructions/rvi.rs') diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs index 6f7dfd2..7d57ce6 100644 --- a/src/instructions/rvi.rs +++ b/src/instructions/rvi.rs @@ -132,3 +132,13 @@ pub fn bgeu(core: &mut Core, instr: Instruction) -> InstructionResult { InstructionResult::Normal } + +pub fn bltu(core: &mut Core, instr: Instruction) -> InstructionResult { + if core.reg_read(instr.rs1()) < core.reg_read(instr.rs2()) { + core.pc = core.pc.wrapping_add(instr.imm_b()); + } else { + core.advance_pc(); + } + + InstructionResult::Normal +} -- cgit v1.2.3