diff --git a/src/context.rs b/src/context.rs index 2d2740efb9f..ad26a6e97cd 100644 --- a/src/context.rs +++ b/src/context.rs @@ -71,9 +71,13 @@ pub struct CodegenCx<'gcc, 'tcx> { pub float_type: Type<'gcc>, pub double_type: Type<'gcc>, + #[cfg(feature="master")] pub float16_type: Type<'gcc>, + #[cfg(feature="master")] pub float32_type: Type<'gcc>, + #[cfg(feature="master")] pub float64_type: Type<'gcc>, + #[cfg(feature="master")] pub float128_type: Type<'gcc>, pub linkage: Cell, @@ -187,9 +191,13 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> { // TODO(antoyo): set alignment on those types as well. let float_type = context.new_type::(); let double_type = context.new_type::(); + #[cfg(feature="master")] let float16_type = context.new_c_type(CType::Float16); + #[cfg(feature="master")] let float32_type = context.new_c_type(CType::Float32); + #[cfg(feature="master")] let float64_type = context.new_c_type(CType::Float64); + #[cfg(feature="master")] let float128_type = context.new_c_type(CType::Float128); let char_type = context.new_c_type(CType::Char); @@ -316,9 +324,13 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> { float_type, double_type, + #[cfg(feature="master")] float16_type, + #[cfg(feature="master")] float32_type, + #[cfg(feature="master")] float64_type, + #[cfg(feature="master")] float128_type, linkage: Cell::new(FunctionType::Internal), diff --git a/src/type_.rs b/src/type_.rs index 72e495294d2..0713ec7736b 100644 --- a/src/type_.rs +++ b/src/type_.rs @@ -120,9 +120,15 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> { self.isize_type } + #[cfg(feature="master")] fn type_f16(&self) -> Type<'gcc> { self.float16_type } + #[cfg(not(feature="master"))] + fn type_f16(&self) -> Type<'gcc> { + unimplemented!("f16") + } + fn type_f32(&self) -> Type<'gcc> { self.float_type @@ -132,9 +138,14 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> { self.double_type } + #[cfg(feature="master")] fn type_f128(&self) -> Type<'gcc> { self.float128_type } + #[cfg(not(feature="master"))] + fn type_f128(&self) -> Type<'gcc> { + unimplemented!("f128") + } fn type_func(&self, params: &[Type<'gcc>], return_type: Type<'gcc>) -> Type<'gcc> { self.context.new_function_pointer_type(None, return_type, params, false)