From c07fa00997fe7afcc3dbb2c6593f0dc7230fffa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20G=C3=B6rgens?= Date: Thu, 12 Dec 2024 14:52:31 +0800 Subject: [PATCH] Remove unused and untested `u128`/`i128` implementations (#737) Extracted from https://github.com/scroll-tech/ceno/pull/736 for ease of review. --- ceno_zkvm/src/expression.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/ceno_zkvm/src/expression.rs b/ceno_zkvm/src/expression.rs index d0f557579..611eb25d8 100644 --- a/ceno_zkvm/src/expression.rs +++ b/ceno_zkvm/src/expression.rs @@ -601,17 +601,17 @@ macro_rules! mixed_binop_instances { mixed_binop_instances!( Add, add, - (u8, u16, u32, u64, usize, i8, i16, i32, i64, i128, isize) + (u8, u16, u32, u64, usize, i8, i16, i32, i64, isize) ); mixed_binop_instances!( Sub, sub, - (u8, u16, u32, u64, usize, i8, i16, i32, i64, i128, isize) + (u8, u16, u32, u64, usize, i8, i16, i32, i64, isize) ); mixed_binop_instances!( Mul, mul, - (u8, u16, u32, u64, usize, i8, i16, i32, i64, i128, isize) + (u8, u16, u32, u64, usize, i8, i16, i32, i64, isize) ); impl Mul for Expression { @@ -901,14 +901,6 @@ macro_rules! impl_from_unsigned { } impl_from_unsigned!(u8, u16, u32, u64, usize, RAMType, InsnKind); -// Implement From trait for u128 separately since it requires explicit reduction -impl> From for Expression { - fn from(value: u128) -> Self { - let reduced = value.rem_euclid(F::MODULUS_U64 as u128) as u64; - Expression::Constant(F::from(reduced)) - } -} - // Implement From trait for signed types macro_rules! impl_from_signed { ($($t:ty),*) => { @@ -922,7 +914,7 @@ macro_rules! impl_from_signed { )* }; } -impl_from_signed!(i8, i16, i32, i64, i128, isize); +impl_from_signed!(i8, i16, i32, i64, isize); impl Display for Expression { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {