Skip to content

Commit

Permalink
Merge pull request #1432 from o1-labs/feature/mips/andi
Browse files Browse the repository at this point in the history
Implement `andi`
  • Loading branch information
dannywillems authored Dec 6, 2023
2 parents 4d86711 + a1ac48f commit a78dc73
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion optimism/src/mips/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,19 @@ pub fn interpret_itype<Env: InterpreterEnv>(env: &mut Env, instr: ITypeInstructi
env.set_next_instruction_pointer(next_instruction_pointer + Env::constant(4u32));
return;
}
ITypeInstruction::AndImmediate => (),
ITypeInstruction::AndImmediate => {
let rs = env.read_register(&rs);
let res = {
// FIXME: Constraint
let pos = env.alloc_scratch();
unsafe { env.and_witness(&rs, &immediate, pos) }
};
env.write_register(&rt, res);
env.set_instruction_pointer(next_instruction_pointer.clone());
env.set_next_instruction_pointer(next_instruction_pointer + Env::constant(4u32));
// REMOVEME: when all itype instructions are implemented.
return;
}
ITypeInstruction::OrImmediate => (),
ITypeInstruction::XorImmediate => {
let rs = env.read_register(&rs);
Expand Down

0 comments on commit a78dc73

Please sign in to comment.