diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-11-17 14:43:54 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-11-17 14:43:54 +0000 |
commit | c59abbe962268a65eda822b85787802fdc45f812 (patch) | |
tree | 5a393b247bfd44273614562939c24b958177f554 /div.c | |
parent | f3ec3c948ac523a73c8bae0e85592c87bc627a41 (diff) | |
download | mpfr-c59abbe962268a65eda822b85787802fdc45f812.tar.gz |
* Optimize a few div.c and mul.c.
* Reorder the tests.
* Remove mpfr_round_raw_generic and create 4 new functions which replace it, for efficiency reasons.
* Add round_raw_generic.c which is the generic file to create the 4 new functions.
* Add new MACRO: MPFR_RNDUTEST_OR_RNDDNOTTEST which is a faster way to check if (rnd_mode==GMP_RNDU && test) || (rnd_mode==GMP_RNDD && !test).
* Add new MACRO: MPFR_UNSIGNED_MINUS_MODULO.
* Optimize mpfr_can_round_raw.
* Some new defines in mpfr.h to increase compatibility with MPFR v2.0.1 and above.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2550 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div.c')
-rw-r--r-- | div.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -354,9 +354,9 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) } } - cc = mpfr_round_raw_generic(qp, qp, err, - (MPFR_IS_NEG_SIGN(sign_quotient) ? 1 : 0), - MPFR_PREC(q), rnd_mode, &inex, 1); + cc = mpfr_round_raw_3(qp, qp, err, + (MPFR_IS_NEG_SIGN(sign_quotient) ? 1 : 0), + MPFR_PREC(q), rnd_mode, &inex); qp += qsize - MPFR_LIMB_SIZE(q); /* 0 or 1 */ qsize = MPFR_LIMB_SIZE(q); @@ -387,8 +387,8 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) if (k >= 0) /* Remainder is nonzero. */ { - if ((rnd_mode == GMP_RNDD && MPFR_IS_NEG_SIGN(sign_quotient)) - || (rnd_mode == GMP_RNDU && MPFR_IS_POS_SIGN(sign_quotient))) + if (MPFR_IS_RNDUTEST_OR_RNDDNOTTEST(rnd_mode, + MPFR_IS_POS_SIGN(sign_quotient))) /* Rounding to infinity. */ { inex = MPFR_FROM_SIGN_TO_INT( sign_quotient ); |