diff options
author | Brooks Moses <brooks.moses@codesourcery.com> | 2007-04-25 02:12:47 +0000 |
---|---|---|
committer | Brooks Moses <brooks@gcc.gnu.org> | 2007-04-24 19:12:47 -0700 |
commit | 205a4d09cae7765310f0a6ae45d4fbde41af1571 (patch) | |
tree | db634c5069c7518a31fd69e68bc5446671f7df2a /gcc/builtins.c | |
parent | df80379db8bcba55301b23d560e42a98e9e79130 (diff) | |
download | gcc-205a4d09cae7765310f0a6ae45d4fbde41af1571.tar.gz |
real.c (mpfr_from_real): Handle Inf and NaN, and allow the rounding mode to be specified by the caller.
* real.c (mpfr_from_real): Handle Inf and NaN, and allow the
rounding mode to be specified by the caller.
(real_to_mpfr) Likewise.
* real.h: Update mpfr_from_real, mpfr_to_real prototypes to
include new arguments.
* builtins.c: Update mpfr_from_real, mpfr_to_real calls.
From-SVN: r124139
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 498aea62e6a..2cf15797d95 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -12205,7 +12205,7 @@ do_mpfr_ckconv (mpfr_srcptr m, tree type, int inexact) { REAL_VALUE_TYPE rr; - real_from_mpfr (&rr, m); + real_from_mpfr (&rr, m, type, GMP_RNDN); /* Proceed iff GCC's REAL_VALUE_TYPE can hold the MPFR value, check for overflow/underflow. If the REAL_VALUE_TYPE is zero but the mpft_t is not, then we underflowed in the @@ -12258,7 +12258,7 @@ do_mpfr_arg1 (tree arg, tree type, int (*func)(mpfr_ptr, mpfr_srcptr, mp_rnd_t), mpfr_t m; mpfr_init2 (m, prec); - mpfr_from_real (m, ra); + mpfr_from_real (m, ra, GMP_RNDN); mpfr_clear_flags (); inexact = func (m, m, GMP_RNDN); result = do_mpfr_ckconv (m, type, inexact); @@ -12301,8 +12301,8 @@ do_mpfr_arg2 (tree arg1, tree arg2, tree type, mpfr_t m1, m2; mpfr_inits2 (prec, m1, m2, NULL); - mpfr_from_real (m1, ra1); - mpfr_from_real (m2, ra2); + mpfr_from_real (m1, ra1, GMP_RNDN); + mpfr_from_real (m2, ra2, GMP_RNDN); mpfr_clear_flags (); inexact = func (m1, m1, m2, GMP_RNDN); result = do_mpfr_ckconv (m1, type, inexact); @@ -12349,9 +12349,9 @@ do_mpfr_arg3 (tree arg1, tree arg2, tree arg3, tree type, mpfr_t m1, m2, m3; mpfr_inits2 (prec, m1, m2, m3, NULL); - mpfr_from_real (m1, ra1); - mpfr_from_real (m2, ra2); - mpfr_from_real (m3, ra3); + mpfr_from_real (m1, ra1, GMP_RNDN); + mpfr_from_real (m2, ra2, GMP_RNDN); + mpfr_from_real (m3, ra3, GMP_RNDN); mpfr_clear_flags (); inexact = func (m1, m1, m2, m3, GMP_RNDN); result = do_mpfr_ckconv (m1, type, inexact); @@ -12393,7 +12393,7 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp) mpfr_t m, ms, mc; mpfr_inits2 (prec, m, ms, mc, NULL); - mpfr_from_real (m, ra); + mpfr_from_real (m, ra, GMP_RNDN); mpfr_clear_flags (); inexact = mpfr_sin_cos (ms, mc, m, GMP_RNDN); result_s = do_mpfr_ckconv (ms, type, inexact); |