Skip to content

Commit

Permalink
Merge pull request #1395 from o1-labs/feature/jr
Browse files Browse the repository at this point in the history
Add implementation of `jr` instruction
  • Loading branch information
dannywillems authored Dec 5, 2023
2 parents bee4aa7 + ebae720 commit b301b8a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions optimism/src/mips/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ pub fn interpret_rtype<Env: InterpreterEnv>(env: &mut Env, instr: RTypeInstructi
let pos = env.alloc_scratch();
unsafe { env.bitmask(&instruction, 32, 26, pos) }
};
let _rs = {
let rs = {
// FIXME: Requires a range check
let pos = env.alloc_scratch();
unsafe { env.bitmask(&instruction, 26, 21, pos) }
Expand Down Expand Up @@ -509,7 +509,12 @@ pub fn interpret_rtype<Env: InterpreterEnv>(env: &mut Env, instr: RTypeInstructi
RTypeInstruction::ShiftLeftLogicalVariable => (),
RTypeInstruction::ShiftRightLogicalVariable => (),
RTypeInstruction::ShiftRightArithmeticVariable => (),
RTypeInstruction::JumpRegister => (),
RTypeInstruction::JumpRegister => {
let addr = env.read_register(&rs);
env.set_instruction_pointer(next_instruction_pointer.clone());
env.set_next_instruction_pointer(addr);
return;
}
RTypeInstruction::JumpAndLinkRegister => (),
RTypeInstruction::SyscallMmap => (),
RTypeInstruction::SyscallExitGroup => (),
Expand Down

0 comments on commit b301b8a

Please sign in to comment.