@@ -18,11 +18,18 @@ fn call_asm<'tcx>(
1818 let name = format ! ( "__rust_cranelift_{name}" ) ;
1919 let is_defined = fx. module . declarations ( ) . get_name ( & name) . is_none ( ) ;
2020
21- let sig = Signature { params : todo ! ( ) , returns : todo ! ( ) , call_conv : CallConv :: SystemV } ;
21+ let sig = Signature {
22+ params : args
23+ . iter ( )
24+ . map ( |arg| AbiParam :: new ( fx. clif_type ( arg. layout ( ) . ty ) . unwrap ( ) ) )
25+ . collect ( ) ,
26+ returns : vec ! [ AbiParam :: new( fx. clif_type( ret. layout( ) . ty) . unwrap( ) ) ] ,
27+ call_conv : CallConv :: SystemV ,
28+ } ;
2229
2330 let func = fx. module . declare_function ( & name, Linkage :: Local , & sig) . unwrap ( ) ;
2431 if !is_defined {
25- todo ! ( "define" ) ;
32+ fx . module . define_function_bytes ( func , & Function :: new ( ) , 4 , & code , & [ ] ) . unwrap ( ) ;
2633 }
2734
2835 let func_ref = fx. module . declare_func_in_func ( func, & mut fx. bcx . func ) ;
@@ -478,19 +485,19 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
478485 // ==== begin autogenerated section ====
479486 "llvm.trunc.v1f64" => {
480487 intrinsic_args ! ( fx, args => ( a) ; intrinsic) ;
481- call_asm ( fx, "llvm__trunc__v1f64" , & [ a] , ret, & [ 0 , 192 , 101 , 30 ] ) ;
488+ call_asm ( fx, "llvm__trunc__v1f64" , & [ a] , ret, & [ 0 , 192 , 101 , 30 , 192 , 3 , 95 , 214 ] ) ;
482489 }
483490 "llvm.trunc.v2f32" => {
484491 intrinsic_args ! ( fx, args => ( a) ; intrinsic) ;
485- call_asm ( fx, "llvm__trunc__v2f32" , & [ a] , ret, & [ 0 , 152 , 161 , 14 ] ) ;
492+ call_asm ( fx, "llvm__trunc__v2f32" , & [ a] , ret, & [ 0 , 152 , 161 , 14 , 192 , 3 , 95 , 214 ] ) ;
486493 }
487494 "llvm.trunc.v2f64" => {
488495 intrinsic_args ! ( fx, args => ( a) ; intrinsic) ;
489- call_asm ( fx, "llvm__trunc__v2f64" , & [ a] , ret, & [ 0 , 152 , 225 , 78 ] ) ;
496+ call_asm ( fx, "llvm__trunc__v2f64" , & [ a] , ret, & [ 0 , 152 , 225 , 78 , 192 , 3 , 95 , 214 ] ) ;
490497 }
491498 "llvm.trunc.v4f32" => {
492499 intrinsic_args ! ( fx, args => ( a) ; intrinsic) ;
493- call_asm ( fx, "llvm__trunc__v4f32" , & [ a] , ret, & [ 0 , 152 , 161 , 78 ] ) ;
500+ call_asm ( fx, "llvm__trunc__v4f32" , & [ a] , ret, & [ 0 , 152 , 161 , 78 , 192 , 3 , 95 , 214 ] ) ;
494501 }
495502 // ==== end autogenerated section
496503
0 commit comments