@@ -13,11 +13,12 @@ use rustc_codegen_ssa::common::IntPredicate;
13
13
use rustc_codegen_ssa:: errors:: InvalidMonomorphization ;
14
14
use rustc_codegen_ssa:: mir:: operand:: { OperandRef , OperandValue } ;
15
15
use rustc_codegen_ssa:: mir:: place:: { PlaceRef , PlaceValue } ;
16
+ use rustc_codegen_ssa:: traits:: BaseTypeCodegenMethods ;
17
+ #[ cfg( feature = "master" ) ]
18
+ use rustc_codegen_ssa:: traits:: MiscCodegenMethods ;
16
19
use rustc_codegen_ssa:: traits:: {
17
20
ArgAbiBuilderMethods , BuilderMethods , ConstCodegenMethods , IntrinsicCallBuilderMethods ,
18
21
} ;
19
- #[ cfg( feature = "master" ) ]
20
- use rustc_codegen_ssa:: traits:: { BaseTypeCodegenMethods , MiscCodegenMethods } ;
21
22
use rustc_middle:: bug;
22
23
#[ cfg( feature = "master" ) ]
23
24
use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt } ;
@@ -139,6 +140,18 @@ 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
+ // TODO(antoyo): use the correct builtin for f16.
145
+ let func = self . cx . context . get_builtin_function ( "fmaf" ) ;
146
+ let args: Vec < _ > = args
147
+ . iter ( )
148
+ . map ( |arg| {
149
+ self . cx . context . new_cast ( self . location , arg. immediate ( ) , self . cx . type_f32 ( ) )
150
+ } )
151
+ . collect ( ) ;
152
+ let result = self . cx . context . new_call ( self . location , func, & args) ;
153
+ self . cx . context . new_cast ( self . location , result, self . cx . type_f16 ( ) )
154
+ }
142
155
sym:: is_val_statically_known => {
143
156
let a = args[ 0 ] . immediate ( ) ;
144
157
let builtin = self . context . get_builtin_function ( "__builtin_constant_p" ) ;
0 commit comments