From d4f17a8b8b1affb62280307d90b2912e2937b9c9 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 12 Apr 2024 20:50:40 +0200 Subject: [PATCH] chore(interpreter): rename wrapping_* opcodes --- crates/interpreter/src/instructions/arithmetic.rs | 6 +++--- crates/interpreter/src/opcode.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/interpreter/src/instructions/arithmetic.rs b/crates/interpreter/src/instructions/arithmetic.rs index 8d1e512773..34c98a348b 100644 --- a/crates/interpreter/src/instructions/arithmetic.rs +++ b/crates/interpreter/src/instructions/arithmetic.rs @@ -5,19 +5,19 @@ use crate::{ Host, Interpreter, }; -pub fn wrapping_add(interpreter: &mut Interpreter, _host: &mut H) { +pub fn add(interpreter: &mut Interpreter, _host: &mut H) { gas!(interpreter, gas::VERYLOW); pop_top!(interpreter, op1, op2); *op2 = op1.wrapping_add(*op2); } -pub fn wrapping_mul(interpreter: &mut Interpreter, _host: &mut H) { +pub fn mul(interpreter: &mut Interpreter, _host: &mut H) { gas!(interpreter, gas::LOW); pop_top!(interpreter, op1, op2); *op2 = op1.wrapping_mul(*op2); } -pub fn wrapping_sub(interpreter: &mut Interpreter, _host: &mut H) { +pub fn sub(interpreter: &mut Interpreter, _host: &mut H) { gas!(interpreter, gas::VERYLOW); pop_top!(interpreter, op1, op2); *op2 = op1.wrapping_sub(*op2); diff --git a/crates/interpreter/src/opcode.rs b/crates/interpreter/src/opcode.rs index 401c7c378e..23913abd75 100644 --- a/crates/interpreter/src/opcode.rs +++ b/crates/interpreter/src/opcode.rs @@ -379,9 +379,9 @@ pub const fn stack_io(mut opcode: OpCodeInfo) -> OpCod opcodes! { 0x00 => STOP => control::stop => stack_io<0,0>, terminating; - 0x01 => ADD => arithmetic::wrapping_add => stack_io<2, 1>; - 0x02 => MUL => arithmetic::wrapping_mul => stack_io<2, 1>; - 0x03 => SUB => arithmetic::wrapping_sub => stack_io<2, 1>; + 0x01 => ADD => arithmetic::add => stack_io<2, 1>; + 0x02 => MUL => arithmetic::mul => stack_io<2, 1>; + 0x03 => SUB => arithmetic::sub => stack_io<2, 1>; 0x04 => DIV => arithmetic::div => stack_io<2, 1>; 0x05 => SDIV => arithmetic::sdiv => stack_io<2, 1>; 0x06 => MOD => arithmetic::rem => stack_io<2, 1>;