@@ -923,6 +923,68 @@ pub fn ref_func(
923923 dispatch ! ( state, ip, sp, mem0, mem0_len, instance)
924924}
925925
926+ macro_rules! impl_i64_binop128 {
927+ (
928+ $( fn $handler: ident( $op: ident) = $eval: expr ) ;* $( ; ) ?
929+ ) => {
930+ $(
931+ pub fn $handler(
932+ state: & mut VmState ,
933+ ip: Ip ,
934+ sp: Sp ,
935+ mem0: Mem0Ptr ,
936+ mem0_len: Mem0Len ,
937+ instance: Inst ,
938+ ) -> Done {
939+ let ( ip, crate :: ir:: decode:: $op { results, lhs_lo, lhs_hi, rhs_lo, rhs_hi } ) = unsafe { decode_op( ip) } ;
940+ let lhs_lo: i64 = get_value( lhs_lo, sp) ;
941+ let lhs_hi: i64 = get_value( lhs_hi, sp) ;
942+ let rhs_lo: i64 = get_value( rhs_lo, sp) ;
943+ let rhs_hi: i64 = get_value( rhs_hi, sp) ;
944+ let results = results. to_array( ) ;
945+ let ( result_lo, result_hi) = $eval( lhs_lo, lhs_hi, rhs_lo, rhs_hi) ;
946+ set_value( sp, results[ 0 ] , result_lo) ;
947+ set_value( sp, results[ 1 ] , result_hi) ;
948+ dispatch!( state, ip, sp, mem0, mem0_len, instance)
949+ }
950+ ) *
951+ } ;
952+ }
953+ impl_i64_binop128 ! {
954+ fn i64_add128( I64Add128 ) = wasm:: i64_add128;
955+ fn i64_sub128( I64Sub128 ) = wasm:: i64_sub128;
956+ }
957+
958+ macro_rules! impl_i64_mul_wide {
959+ (
960+ $( fn $handler: ident( $op: ident) = $eval: expr ) ;* $( ; ) ?
961+ ) => {
962+ $(
963+ pub fn $handler(
964+ state: & mut VmState ,
965+ ip: Ip ,
966+ sp: Sp ,
967+ mem0: Mem0Ptr ,
968+ mem0_len: Mem0Len ,
969+ instance: Inst ,
970+ ) -> Done {
971+ let ( ip, crate :: ir:: decode:: $op { results, lhs, rhs } ) = unsafe { decode_op( ip) } ;
972+ let lhs: i64 = get_value( lhs, sp) ;
973+ let rhs: i64 = get_value( rhs, sp) ;
974+ let ( result_lo, result_hi) = $eval( lhs, rhs) ;
975+ let results = results. to_array( ) ;
976+ set_value( sp, results[ 0 ] , result_lo) ;
977+ set_value( sp, results[ 1 ] , result_hi) ;
978+ dispatch!( state, ip, sp, mem0, mem0_len, instance)
979+ }
980+ ) *
981+ } ;
982+ }
983+ impl_i64_mul_wide ! {
984+ fn i64_mul_wide( I64MulWide ) = wasm:: i64_mul_wide_s;
985+ fn u64_mul_wide( U64MulWide ) = wasm:: i64_mul_wide_u;
986+ }
987+
926988/// Fetches the branch table index value and normalizes it to clamp between `0..len_targets`.
927989fn fetch_branch_table_target ( sp : Sp , index : Slot , len_targets : u32 ) -> usize {
928990 let index: u32 = get_value ( index, sp) ;
0 commit comments