@@ -7,7 +7,7 @@ use rustc_middle::ty::layout::{
77use rustc_middle:: ty:: TypeFoldable ;
88use rustc_span:: source_map:: Spanned ;
99use rustc_target:: abi:: call:: FnAbi ;
10- use rustc_target:: abi:: { Integer , Primitive } ;
10+ use rustc_target:: abi:: { Float , Integer , Primitive } ;
1111use rustc_target:: spec:: { HasTargetSpec , Target } ;
1212
1313use crate :: constant:: ConstantCx ;
@@ -32,10 +32,12 @@ pub(crate) fn scalar_to_clif_type(tcx: TyCtxt<'_>, scalar: Scalar) -> Type {
3232 Integer :: I64 => types:: I64 ,
3333 Integer :: I128 => types:: I128 ,
3434 } ,
35- Primitive :: F16 => unimplemented ! ( "f16_f128" ) ,
36- Primitive :: F32 => types:: F32 ,
37- Primitive :: F64 => types:: F64 ,
38- Primitive :: F128 => unimplemented ! ( "f16_f128" ) ,
35+ Primitive :: Float ( float) => match float {
36+ Float :: F16 => unimplemented ! ( "f16_f128" ) ,
37+ Float :: F32 => types:: F32 ,
38+ Float :: F64 => types:: F64 ,
39+ Float :: F128 => unimplemented ! ( "f16_f128" ) ,
40+ } ,
3941 // FIXME(erikdesjardins): handle non-default addrspace ptr sizes
4042 Primitive :: Pointer ( _) => pointer_ty ( tcx) ,
4143 }
0 commit comments