diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2014-09-01 09:11:17 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2014-09-01 09:11:17 +0200 |
commit | 3652d6e481bebf95d28820d738a1f5c2b021ce2c (patch) | |
tree | 9da04a2f2975fb849d594839579be0933601325b /mpn/generic/divis.c | |
parent | 42d111d0683b6452b408c697a27ab9faabe426fa (diff) | |
download | gmp-3652d6e481bebf95d28820d738a1f5c2b021ce2c.tar.gz |
mpn/generic/divis.c: Share a count.
Diffstat (limited to 'mpn/generic/divis.c')
-rw-r--r-- | mpn/generic/divis.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mpn/generic/divis.c b/mpn/generic/divis.c index 9e162e60d..e2b09eb59 100644 --- a/mpn/generic/divis.c +++ b/mpn/generic/divis.c @@ -4,7 +4,7 @@ CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES. -Copyright 2001, 2002, 2005, 2009 Free Software Foundation, Inc. +Copyright 2001, 2002, 2005, 2009, 2014 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -113,12 +113,12 @@ mpn_divisible_p (mp_srcptr ap, mp_size_t an, return mpn_modexact_1_odd (ap, an, dlow) == 0; } + count_trailing_zeros (twos, dlow); if (dn == 2) { mp_limb_t dsecond = dp[1]; if (dsecond <= dmask) { - count_trailing_zeros (twos, dlow); dlow = (dlow >> twos) | (dsecond << (GMP_NUMB_BITS-twos)); ASSERT_LIMB (dlow); return MPN_MOD_OR_MODEXACT_1_ODD (ap, an, dlow) == 0; @@ -138,8 +138,6 @@ mpn_divisible_p (mp_srcptr ap, mp_size_t an, rp = TMP_ALLOC_LIMBS (an + 1); qp = TMP_ALLOC_LIMBS (an - dn + 1); /* FIXME: Could we avoid this? */ - count_trailing_zeros (twos, dp[0]); - if (twos != 0) { tp = TMP_ALLOC_LIMBS (dn); |