diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-08-12 13:19:40 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2008-08-12 13:19:40 +0000 |
commit | 3e479de394686d3957c4945d529bfdcf4d338de8 (patch) | |
tree | 8520ed37f4f8d6016d590082a4aa6d51a73e1cdd /gcc/c-cppbuiltin.c | |
parent | 88f091f5aec9a1d5a9deebe5cd743dcab2760d84 (diff) | |
download | gcc-3e479de394686d3957c4945d529bfdcf4d338de8.zip gcc-3e479de394686d3957c4945d529bfdcf4d338de8.tar.gz gcc-3e479de394686d3957c4945d529bfdcf4d338de8.tar.bz2 |
real.h (struct real_format): New member round_towards_zero.
ChangeLog:
* real.h (struct real_format): New member round_towards_zero.
* real.c (round_for_format): Respect fmt->round_towards_zero.
(ieee_single_format, mips_single_format, motorola_single_format,
spu_single_format, ieee_double_format, mips_double_format,
motorola_double_format, ieee_extended_motorola_format,
ieee_extended_intel_96_format, ieee_extended_intel_128_format,
ieee_extended_intel_96_round_53_format, ibm_extended_format,
mips_extended_format, ieee_quad_format, mips_quad_format,
vax_f_format, vax_d_format, vax_g_format): Initialize it.
* config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise.
* builtins.s (do_mpfr_arg1): Consider round_towards_zero member of
real_format to choose rounding mode when calling MPFR functions.
(do_mpfr_arg2, do_mpfr_arg3, do_mpfr_sincos): Likewise.
(do_mpfr_bessel_n, do_mpfr_remquo, do_mpfr_lgamma_r): Likewise.
* real.h (real_to_decimal_for_mode): Add prototype.
* real.c (real_to_decimal_for_mode): Renames old real_to_decimal.
Respect target rounding mode when generating decimal representation.
(real_to_decimal): New stub for backwards compatibility.
* c-cppbuiltin.c (builtin_define_with_hex_fp_value): Use
real_to_decimal_for_mode instead of real_to_decimal.
* config/spu/spu.md ("floatdisf2", "floatunsdisf2"): New.
testsuite/ChangeLog:
* gcc.c-torture/execute/20031003-1.c (main): Update test to
accommodate SPU single-precision rounding mode.
* gcc.c-torture/execute/conversion.c (test_float_to_integer,
test_float_to_longlong_integer): Likewise.
* gcc.c-torture/execute/ieee/rbug.c (main): Likewise.
* gcc.dg/hex-round-1.c: Skip test on SPU.
* gcc.dg/hex-round-2.c: Likewise.
Co-Authored-By: Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
From-SVN: r139014
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r-- | gcc/c-cppbuiltin.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index cbd56b4..f1a454f 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -852,7 +852,7 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value) /* Pass an object-like macro a hexadecimal floating-point value. */ static void builtin_define_with_hex_fp_value (const char *macro, - tree type ATTRIBUTE_UNUSED, int digits, + tree type, int digits, const char *hex_str, const char *fp_suffix, const char *fp_cast) @@ -871,7 +871,8 @@ builtin_define_with_hex_fp_value (const char *macro, then print it back out as decimal. */ real_from_string (&real, hex_str); - real_to_decimal (dec_str, &real, sizeof (dec_str), digits, 0); + real_to_decimal_for_mode (dec_str, &real, sizeof (dec_str), digits, 0, + TYPE_MODE (type)); /* Assemble the macro in the following fashion macro = fp_cast [dec_str fp_suffix] */ |