summaryrefslogtreecommitdiff
path: root/gmp-impl.h
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2018-02-08 12:58:28 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2018-02-08 12:58:28 +0100
commit95d89505a623cd743e05ac8b0b30ddcb85091506 (patch)
tree165643d52a435116b192da38680cce1750a0c9bd /gmp-impl.h
parent50bf88ac58fabb0788cd774eeffb87f03a1a8de9 (diff)
downloadgmp-95d89505a623cd743e05ac8b0b30ddcb85091506.tar.gz
gmp-impl.h (popc_limb): Use fewer constants (GMP_LIMB_BITS == 16)
Diffstat (limited to 'gmp-impl.h')
-rw-r--r--gmp-impl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gmp-impl.h b/gmp-impl.h
index f0e2bff50..7bcdd89d0 100644
--- a/gmp-impl.h
+++ b/gmp-impl.h
@@ -3711,9 +3711,9 @@ __GMP_DECLSPEC extern const unsigned char binvert_limb_table[128];
mp_limb_t __x = (input); \
__x -= (__x >> 1) & MP_LIMB_T_MAX/3; \
__x = ((__x >> 2) & MP_LIMB_T_MAX/5) + (__x & MP_LIMB_T_MAX/5); \
- __x = ((__x >> 4) + __x) & MP_LIMB_T_MAX/17; \
- __x = ((__x >> 8) + __x); \
- (result) = __x & 0xff; \
+ __x += (__x >> 4); \
+ __x = ((__x >> 8) & MP_LIMB_T_MAX/4369)+(__x & MP_LIMB_T_MAX/4369); \
+ (result) = __x; \
} while (0)
#endif