Skip to content

Commit

Permalink
o1vm/riscv32im: additional documentation when dividing by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Dec 23, 2024
1 parent 755b085 commit b32afd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions o1vm/src/interpreters/riscv32im/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,10 @@ pub trait InterpreterEnv {
/// There are no constraints on the returned values; callers must manually add constraints to
/// ensure that the pair of returned values correspond to the given values `x` and `y`, and
/// that they fall within the desired range.
///
/// Division by zero will create a panic! exception. The RISC-V
/// specification leaves the case unspecified, and therefore we prefer to
/// forbid this case while building the witness.
unsafe fn div_signed(
&mut self,
x: &Self::Variable,
Expand Down Expand Up @@ -1314,6 +1318,10 @@ pub trait InterpreterEnv {
/// There are no constraints on the returned values; callers must manually add constraints to
/// ensure that the pair of returned values correspond to the given values `x` and `y`, and
/// that they fall within the desired range.
///
/// Division by zero will create a panic! exception. The RISC-V
/// specification leaves the case unspecified, and therefore we prefer to
/// forbid this case while building the witness.
unsafe fn div(
&mut self,
x: &Self::Variable,
Expand Down

0 comments on commit b32afd0

Please sign in to comment.