Skip to content

Commit

Permalink
moving scratch into less-than-variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
svv232 authored and dannywillems committed Dec 24, 2024
1 parent fa494c3 commit 7751170
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions o1vm/src/interpreters/riscv32im/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2271,10 +2271,10 @@ pub fn interpret_sbtype<Env: InterpreterEnv>(env: &mut Env, instr: SBInstruction
let local_rs1 = env.read_register(&rs1);
let local_rs2 = env.read_register(&rs2);

let rd_scratch = env.alloc_scratch();

let less_than =
unsafe { env.test_less_than_signed(&local_rs1, &local_rs2, rd_scratch) };
let less_than = {
let rd_scratch = env.alloc_scratch();
unsafe { env.test_less_than_signed(&local_rs1, &local_rs2, rd_scratch) }
};
let offset = (less_than.clone()) * imm0_12
+ (Env::constant(1) - less_than.clone()) * Env::constant(4);

Expand Down

0 comments on commit 7751170

Please sign in to comment.