diff options
author | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-12 13:19:40 +0000 |
---|---|---|
committer | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-12 13:19:40 +0000 |
commit | e2eb2b7f42c984114a733ebf5b9b4fd48c77f52c (patch) | |
tree | 8520ed37f4f8d6016d590082a4aa6d51a73e1cdd /gcc/real.h | |
parent | 98bbec1e473511d08a36b0cf5796c7337c5d07f8 (diff) | |
download | gcc-e2eb2b7f42c984114a733ebf5b9b4fd48c77f52c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139014 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.h')
-rw-r--r-- | gcc/real.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h index 39522b6332c..d849a2e43c6 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -147,6 +147,9 @@ struct real_format or -1 for a complex encoding. */ int signbit_rw; + /* Default rounding mode for operations on this format. */ + bool round_towards_zero; + /* Properties of the format. */ bool has_nans; bool has_inf; @@ -216,6 +219,11 @@ extern bool exact_real_truncate (enum machine_mode, const REAL_VALUE_TYPE *); extern void real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int); +/* Render R as a decimal floating point constant, rounded so as to be + parsed back to the same value when interpreted in mode MODE. */ +extern void real_to_decimal_for_mode (char *, const REAL_VALUE_TYPE *, size_t, + size_t, int, enum machine_mode); + /* Render R as a hexadecimal floating point constant. */ extern void real_to_hexadecimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int); |