@@ -81,26 +81,6 @@ pub(crate) fn maybe_codegen_checked<'tcx>(
8181 match bin_op {
8282 BinOp :: BitAnd | BinOp :: BitOr | BinOp :: BitXor => unreachable ! ( ) ,
8383 BinOp :: Add | BinOp :: Sub => None ,
84- BinOp :: Mul if is_signed => {
85- let out_ty = Ty :: new_tup ( fx. tcx , & [ lhs. layout ( ) . ty , fx. tcx . types . bool ] ) ;
86- let oflow = CPlace :: new_stack_slot ( fx, fx. layout_of ( fx. tcx . types . i32 ) ) ;
87- let lhs = lhs. load_scalar ( fx) ;
88- let rhs = rhs. load_scalar ( fx) ;
89- let oflow_ptr = oflow. to_ptr ( ) . get_addr ( fx) ;
90- let res = fx. lib_call_unadjusted (
91- "__muloti4" ,
92- vec ! [
93- AbiParam :: new( types:: I128 ) ,
94- AbiParam :: new( types:: I128 ) ,
95- AbiParam :: new( fx. pointer_type) ,
96- ] ,
97- vec ! [ AbiParam :: new( types:: I128 ) ] ,
98- & [ lhs, rhs, oflow_ptr] ,
99- ) [ 0 ] ;
100- let oflow = oflow. to_cvalue ( fx) . load_scalar ( fx) ;
101- let oflow = fx. bcx . ins ( ) . ireduce ( types:: I8 , oflow) ;
102- Some ( CValue :: by_val_pair ( res, oflow, fx. layout_of ( out_ty) ) )
103- }
10484 BinOp :: Mul => {
10585 let out_ty = Ty :: new_tup ( fx. tcx , & [ lhs. layout ( ) . ty , fx. tcx . types . bool ] ) ;
10686 let out_place = CPlace :: new_stack_slot ( fx, fx. layout_of ( out_ty) ) ;
@@ -110,7 +90,12 @@ pub(crate) fn maybe_codegen_checked<'tcx>(
11090 AbiParam :: new( types:: I128 ) ,
11191 ] ;
11292 let args = [ out_place. to_ptr ( ) . get_addr ( fx) , lhs. load_scalar ( fx) , rhs. load_scalar ( fx) ] ;
113- fx. lib_call ( "__rust_u128_mulo" , param_types, vec ! [ ] , & args) ;
93+ fx. lib_call (
94+ if is_signed { "__rust_i128_mulo" } else { "__rust_u128_mulo" } ,
95+ param_types,
96+ vec ! [ ] ,
97+ & args,
98+ ) ;
11499 Some ( out_place. to_cvalue ( fx) )
115100 }
116101 BinOp :: AddUnchecked | BinOp :: SubUnchecked | BinOp :: MulUnchecked => unreachable ! ( ) ,
0 commit comments