From 2ff3eb454d180c24cd6675acad4bc7b8b1b4262f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 21 Jan 2022 23:53:44 +0100 Subject: [PATCH] bpo-29882: _Py_popcount32() doesn't need 64x64 multiply 32x32 bits multiply is enough for _Py_popcount32(). --- Include/internal/pycore_bitutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/internal/pycore_bitutils.h b/Include/internal/pycore_bitutils.h index e4aa7a3d0d0567..3fd70b0e417c19 100644 --- a/Include/internal/pycore_bitutils.h +++ b/Include/internal/pycore_bitutils.h @@ -125,7 +125,7 @@ _Py_popcount32(uint32_t x) // Put count of each 8 bits into those 8 bits x = (x + (x >> 4)) & M4; // Sum of the 4 byte counts - return (uint32_t)((uint64_t)x * (uint64_t)SUM) >> 24; + return (x * SUM) >> 24; #endif }