From ac8e6d707a13e1da7cf62f4922756ab674db6b07 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:46:59 +0100 Subject: [PATCH] chore: remove unnecessary `is_integral_bit_size` function (#9352) --- avm-transpiler/src/transpile.rs | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/avm-transpiler/src/transpile.rs b/avm-transpiler/src/transpile.rs index 311fa5a87d1..b5251154a72 100644 --- a/avm-transpiler/src/transpile.rs +++ b/avm-transpiler/src/transpile.rs @@ -96,12 +96,7 @@ pub fn brillig_to_avm( ], }); } - BrilligOpcode::BinaryIntOp { destination, op, bit_size, lhs, rhs } => { - assert!( - is_integral_bit_size(*bit_size), - "BinaryIntOp bit size should be integral: {:?}", - brillig_instr - ); + BrilligOpcode::BinaryIntOp { destination, op, lhs, rhs, .. } => { let bits_needed = [*lhs, *rhs, *destination].iter().map(bits_needed_for).max().unwrap(); assert!( @@ -189,12 +184,7 @@ pub fn brillig_to_avm( ], }); } - BrilligOpcode::Not { destination, source, bit_size } => { - assert!( - is_integral_bit_size(*bit_size), - "Not bit size should be integral: {:?}", - brillig_instr - ); + BrilligOpcode::Not { destination, source, .. } => { let bits_needed = [*source, *destination].iter().map(bits_needed_for).max().unwrap(); assert!( @@ -1421,18 +1411,6 @@ pub fn map_brillig_pcs_to_avm_pcs(brillig_bytecode: &[BrilligOpcode bool { - matches!( - bit_size, - IntegerBitSize::U1 - | IntegerBitSize::U8 - | IntegerBitSize::U16 - | IntegerBitSize::U32 - | IntegerBitSize::U64 - | IntegerBitSize::U128 - ) -} - fn tag_from_bit_size(bit_size: BitSize) -> AvmTypeTag { match bit_size { BitSize::Integer(IntegerBitSize::U1) => AvmTypeTag::UINT1,