@@ -27,7 +27,7 @@ use abi::{self, Abi};
27
27
use callee;
28
28
use builder:: Builder ;
29
29
use 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 } ;
31
31
use common:: { C_null , C_struct , C_str_slice , C_undef , C_uint , C_vector , is_undef} ;
32
32
use common:: const_to_opt_u128;
33
33
use consts;
@@ -96,11 +96,11 @@ impl<'tcx> Const<'tcx> {
96
96
let llty = type_of:: type_of ( ccx, ty) ;
97
97
let val = match cv {
98
98
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)
102
102
} ;
103
- C_floating_f64 ( v_f64 , llty)
103
+ consts :: bitcast ( Const :: from_constint ( ccx , & bits ) . llval , llty)
104
104
}
105
105
ConstVal :: Bool ( v) => C_bool ( ccx, v) ,
106
106
ConstVal :: Integral ( ref i) => return Const :: from_constint ( ccx, i) ,
0 commit comments