@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
42
42
#include " gcc.h"
43
43
#include " diagnostic.h"
44
44
#include " stmt.h"
45
+ #include " realmpfr.h"
45
46
46
47
#include " jit-playback.h"
47
48
#include " jit-result.h"
@@ -1093,22 +1094,16 @@ new_rvalue_from_const <double> (type *type,
1093
1094
// FIXME: type-checking, or coercion?
1094
1095
tree inner_type = type->as_tree ();
1095
1096
1097
+ mpfr_t mpf_value;
1098
+
1099
+ mpfr_init2 (mpf_value, 64 );
1100
+ mpfr_set_d (mpf_value, value, MPFR_RNDN);
1101
+
1096
1102
/* We have a "double", we want a REAL_VALUE_TYPE.
1097
1103
1098
- real.cc:real_from_target appears to require the representation to be
1099
- split into 32-bit values, and then sent as an pair of host long
1100
- ints. */
1104
+ realmpfr.cc:real_from_mpfr. */
1101
1105
REAL_VALUE_TYPE real_value;
1102
- union
1103
- {
1104
- double as_double;
1105
- uint32_t as_uint32s[2 ];
1106
- } u;
1107
- u.as_double = value;
1108
- long int as_long_ints[2 ];
1109
- as_long_ints[0 ] = u.as_uint32s [0 ];
1110
- as_long_ints[1 ] = u.as_uint32s [1 ];
1111
- real_from_target (&real_value, as_long_ints, DFmode);
1106
+ real_from_mpfr (&real_value, mpf_value, inner_type, MPFR_RNDN);
1112
1107
tree inner = build_real (inner_type, real_value);
1113
1108
return new rvalue (this , inner);
1114
1109
}
0 commit comments