diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-05-04 07:46:57 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-05-04 07:46:57 +0000 |
commit | 6de18e36a603b2b4c3f065119de5d5fd78367b51 (patch) | |
tree | 333e193c333ea5369d4fcd17e5fbb469dd50c40d /src/sub1sp.c | |
parent | c64ffc2f9958b4fa2eab676fee377ef0fbcaddba (diff) | |
download | mpfr-6de18e36a603b2b4c3f065119de5d5fd78367b51.tar.gz |
Merged r11179-11196 from the trunk (no conflicts).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/faithful@11453 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/sub1sp.c')
-rw-r--r-- | src/sub1sp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sub1sp.c b/src/sub1sp.c index f9eee75dd..b469b25a5 100644 --- a/src/sub1sp.c +++ b/src/sub1sp.c @@ -620,6 +620,8 @@ mpfr_sub1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode, if (d < GMP_NUMB_BITS) { mp_limb_t cy; + /* warning: we must have the most significant bit of sb correct + since it might become the round bit below */ sb = cp[0] << (GMP_NUMB_BITS - d); /* neglected part of c */ a0 = bp[0] - ((cp[1] << (GMP_NUMB_BITS - d)) | (cp[0] >> d)); a1 = bp[1] - ((cp[2] << (GMP_NUMB_BITS - d)) | (cp[1] >> d)) @@ -681,6 +683,8 @@ mpfr_sub1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode, else if (d < 2 * GMP_NUMB_BITS) { mp_limb_t c0shifted; + /* warning: we must have the most significant bit of sb correct + since it might become the round bit below */ sb = (d == GMP_NUMB_BITS) ? cp[0] : (cp[1] << (2*GMP_NUMB_BITS - d)) | (cp[0] != 0); c0shifted = (d == GMP_NUMB_BITS) ? cp[1] @@ -980,8 +984,8 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mpn_lshift (ap + len, ap, k, cnt); /* Normalize the High Limb*/ else { - /* Must use DECR since src and dest may overlap & dest>=src*/ - MPN_COPY_DECR(ap+len, ap, k); + /* Must use copyd since src and dst may overlap & dst>=src */ + mpn_copyd (ap+len, ap, k); } MPN_ZERO(ap, len); /* Zeroing the last limbs */ bx -= cnt + len*GMP_NUMB_BITS; /* Update Expo */ |