From 96b2cfae65e2ebd7470abc7dd109049cd5d266d4 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 5 Dec 2023 22:08:05 +0000 Subject: [PATCH] Rename `equals_zero` to `test_zero` --- optimism/src/mips/interpreter.rs | 8 ++------ optimism/src/mips/witness.rs | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/optimism/src/mips/interpreter.rs b/optimism/src/mips/interpreter.rs index 3f0941f06a..302730b529 100644 --- a/optimism/src/mips/interpreter.rs +++ b/optimism/src/mips/interpreter.rs @@ -532,11 +532,7 @@ pub trait InterpreterEnv { /// /// There are no constraints on the returned value; callers must assert the relationship with /// `x`. - unsafe fn equals_zero( - &mut self, - x: &Self::Variable, - position: Self::Position, - ) -> Self::Variable; + unsafe fn test_zero(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable; fn copy(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable; @@ -763,7 +759,7 @@ pub fn interpret_itype(env: &mut Env, instr: ITypeInstructi let equals = { // FIXME: Requires constraints let pos = env.alloc_scratch(); - unsafe { env.equals_zero(&(rs - rt), pos) } + unsafe { env.test_zero(&(rs - rt), pos) } }; let offset = (Env::constant(1) - equals.clone()) * Env::constant(4) + equals * offset; let addr = { diff --git a/optimism/src/mips/witness.rs b/optimism/src/mips/witness.rs index 32f1c3964a..77bfc347d3 100644 --- a/optimism/src/mips/witness.rs +++ b/optimism/src/mips/witness.rs @@ -227,11 +227,7 @@ impl InterpreterEnv for Env { res } - unsafe fn equals_zero( - &mut self, - x: &Self::Variable, - position: Self::Position, - ) -> Self::Variable { + unsafe fn test_zero(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable { let res = if *x == 0 { 1 } else { 0 }; self.write_column(position, res.into()); res