From 95d89505a623cd743e05ac8b0b30ddcb85091506 Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Thu, 8 Feb 2018 12:58:28 +0100 Subject: gmp-impl.h (popc_limb): Use fewer constants (GMP_LIMB_BITS == 16) --- gmp-impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gmp-impl.h') 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 -- cgit v1.2.1