Skip to content

Commit

Permalink
addresses review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mw2000 committed Nov 20, 2024
1 parent 459493f commit aed8c95
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions jolt-core/src/jolt/instruction/remu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,14 @@ impl<const WORD_SIZE: usize> VirtualInstructionSequence for REMUInstruction<WORD
}

fn sequence_output(x: u64, y: u64) -> u64 {
let quotient = if y == 0 {
match WORD_SIZE {
32 => u32::MAX as u64,
64 => u64::MAX,
_ => panic!("Unsupported WORD_SIZE: {}", WORD_SIZE),
}
} else {
x / y
};

if y == 0 {
x
} else {
x - quotient * y
match WORD_SIZE {
32 => (x as u32 % y as u32) as u64,
64 => x % y,
_ => panic!("Unsupported WORD_SIZE: {}", WORD_SIZE),
}
}
}
}
Expand Down

0 comments on commit aed8c95

Please sign in to comment.