From 3e4ced245d9e603cfc806e64ab56b9b2b7223287 Mon Sep 17 00:00:00 2001 From: pelissip Date: Wed, 5 Nov 2003 12:11:47 +0000 Subject: 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 --- sub1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sub1.c') 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); -- cgit v1.2.1