@@ -16,8 +16,9 @@ use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue};
16
16
use rustc_codegen_ssa:: traits:: {
17
17
ArgAbiBuilderMethods , BuilderMethods , ConstCodegenMethods , IntrinsicCallBuilderMethods ,
18
18
} ;
19
+ use rustc_codegen_ssa:: traits:: BaseTypeCodegenMethods ;
19
20
#[ cfg( feature = "master" ) ]
20
- use rustc_codegen_ssa:: traits:: { BaseTypeCodegenMethods , MiscCodegenMethods } ;
21
+ use rustc_codegen_ssa:: traits:: MiscCodegenMethods ;
21
22
use rustc_middle:: bug;
22
23
#[ cfg( feature = "master" ) ]
23
24
use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt } ;
@@ -139,6 +140,17 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
139
140
& args. iter ( ) . map ( |arg| arg. immediate ( ) ) . collect :: < Vec < _ > > ( ) ,
140
141
)
141
142
}
143
+ sym:: fmaf16 => {
144
+ let func = self . cx . context . get_builtin_function ( "fmaf" ) ;
145
+ let args: Vec < _ > = args
146
+ . iter ( )
147
+ . map ( |arg| {
148
+ self . cx . context . new_cast ( self . location , arg. immediate ( ) , self . cx . type_f32 ( ) )
149
+ } )
150
+ . collect ( ) ;
151
+ let result = self . cx . context . new_call ( self . location , func, & args) ;
152
+ self . cx . context . new_cast ( self . location , result, self . cx . type_f16 ( ) )
153
+ }
142
154
sym:: is_val_statically_known => {
143
155
let a = args[ 0 ] . immediate ( ) ;
144
156
let builtin = self . context . get_builtin_function ( "__builtin_constant_p" ) ;
0 commit comments