@@ -27,7 +27,7 @@ use abi::{self, Abi};
2727use callee;
2828use builder:: Builder ;
2929use common:: { self , CrateContext , const_get_elt, val_ty} ;
30- use common:: { C_array , C_bool , C_bytes , C_floating_f64 , C_integral , C_big_integral } ;
30+ use common:: { C_array , C_bool , C_bytes , C_integral , C_big_integral } ;
3131use common:: { C_null , C_struct , C_str_slice , C_undef , C_uint , C_vector , is_undef} ;
3232use common:: const_to_opt_u128;
3333use consts;
@@ -96,11 +96,11 @@ impl<'tcx> Const<'tcx> {
9696 let llty = type_of:: type_of ( ccx, ty) ;
9797 let val = match cv {
9898 ConstVal :: Float ( v) => {
99- let v_f64 = match v {
100- ConstFloat :: F32 ( v) => f32 :: from_bits ( v) as f64 ,
101- ConstFloat :: F64 ( v) => f64 :: from_bits ( v)
99+ let bits = match v {
100+ ConstFloat :: F32 ( v) => U32 ( v) ,
101+ ConstFloat :: F64 ( v) => U64 ( v)
102102 } ;
103- C_floating_f64 ( v_f64 , llty)
103+ consts :: bitcast ( Const :: from_constint ( ccx , & bits ) . llval , llty)
104104 }
105105 ConstVal :: Bool ( v) => C_bool ( ccx, v) ,
106106 ConstVal :: Integral ( ref i) => return Const :: from_constint ( ccx, i) ,
0 commit comments