diff options
| author | taitep <taitep@taitep.se> | 2025-12-22 20:08:16 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-22 20:08:16 +0100 |
| commit | 5cbaf2dc66f6d2c48a6b319506e921d6aa6aef9d (patch) | |
| tree | 84fdfae2c92cd8b8f2ca84880ad1dcedcb0a9bb4 /src/instructions/rvi.rs | |
| parent | ae57cdc69164b4426edc03564d32c0b8ecc72612 (diff) | |
Implement BGEU
Diffstat (limited to 'src/instructions/rvi.rs')
| -rw-r--r-- | src/instructions/rvi.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs index ea1c40d..6f7dfd2 100644 --- a/src/instructions/rvi.rs +++ b/src/instructions/rvi.rs @@ -122,3 +122,13 @@ pub fn bne(core: &mut Core, instr: Instruction) -> InstructionResult { InstructionResult::Normal } + +pub fn bgeu(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 +} |
