summaryrefslogtreecommitdiff
path: root/sub1.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-11-05 12:11:47 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-11-05 12:11:47 +0000
commit3e4ced245d9e603cfc806e64ab56b9b2b7223287 (patch)
tree07d2403dc7906d32a852d032df4b348aed7616b5 /sub1.c
parentc1ff1a575e238532d7329dd5ebb15f5f48581868 (diff)
downloadmpfr-3e4ced245d9e603cfc806e64ab56b9b2b7223287.tar.gz
Optimize mpfr_prec_round.
Optimize mpfr_set (Case of both src & dest have the same precision). Start optimizing mpfr_sub1. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2535 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub1.c')
-rw-r--r--sub1.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sub1.c b/sub1.c
index 6f4f900a4..d9814d4a1 100644
--- a/sub1.c
+++ b/sub1.c
@@ -49,11 +49,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
an = 1 + (MPFR_PREC(a) - 1) / BITS_PER_MP_LIMB;
sign = mpfr_cmp2 (b, c, &cancel);
- if (sign == 0)
+ if (MPFR_UNLIKELY(sign == 0))
{
if (rnd_mode == GMP_RNDD)
MPFR_SET_NEG(a);
-
else
MPFR_SET_POS(a);
MPFR_SET_ZERO(a);
@@ -80,7 +79,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
{
mpfr_srcptr t;
MPFR_CHANGE_SIGN(a);
- t = b; b = c; c = t;
+ t = b; b = c; c = t;
}
diff_exp = (mp_exp_unsigned_t) MPFR_GET_EXP (b) - MPFR_GET_EXP (c);