Skip to content

Commit e45b4d3

Browse files
committed
Add f16 and f128 to rustc_type_ir::FloatTy and rustc_abi::Primitive
Make changes necessary to support these types in the compiler.
1 parent c099ed3 commit e45b4d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common.rs

+4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ pub(crate) fn scalar_to_clif_type(tcx: TyCtxt<'_>, scalar: Scalar) -> Type {
3333
Integer::I64 => types::I64,
3434
Integer::I128 => types::I128,
3535
},
36+
Primitive::F16 => unimplemented!("f16_f128"),
3637
Primitive::F32 => types::F32,
3738
Primitive::F64 => types::F64,
39+
Primitive::F128 => unimplemented!("f16_f128"),
3840
// FIXME(erikdesjardins): handle non-default addrspace ptr sizes
3941
Primitive::Pointer(_) => pointer_ty(tcx),
4042
}
@@ -61,8 +63,10 @@ fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types::Typ
6163
},
6264
ty::Char => types::I32,
6365
ty::Float(size) => match size {
66+
FloatTy::F16 => unimplemented!("f16_f128"),
6467
FloatTy::F32 => types::F32,
6568
FloatTy::F64 => types::F64,
69+
FloatTy::F128 => unimplemented!("f16_f128"),
6670
},
6771
ty::FnPtr(_) => pointer_ty(tcx),
6872
ty::RawPtr(TypeAndMut { ty: pointee_ty, mutbl: _ }) | ty::Ref(_, pointee_ty, _) => {

0 commit comments

Comments
 (0)