Skip to content

Commit

Permalink
o1vm/riscv32im: simplify mul_lo_signed implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Nov 25, 2024
1 parent ebcd6bb commit 95098af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions o1vm/src/interpreters/riscv32im/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ impl<Fp: Field> InterpreterEnv for Env<Fp> {
y: &Self::Variable,
position: Self::Position,
) -> Self::Variable {
let x: u32 = (*x).try_into().unwrap();
let y: u32 = (*y).try_into().unwrap();
let res = (((x as i32) as i64) * ((y as i32) as i64)) as u64;
let x: i32 = (*x).try_into().unwrap();
let y: i32 = (*y).try_into().unwrap();
let res = ((x as i64) * (y as i64)) as u64;
let res = (res & ((1 << 32) - 1)) as u32;
let res = res as u64;
self.write_column(position, res);
Expand Down

0 comments on commit 95098af

Please sign in to comment.