diff --git a/py/misc.h b/py/misc.h index 49f2f8711..1cf582456 100644 --- a/py/misc.h +++ b/py/misc.h @@ -390,7 +390,7 @@ static inline uint32_t mp_popcount(uint32_t x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0F0F0F0F; - return x * 0x01010101; + return (x * 0x01010101) >> 24; } #endif #endif