mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774)
32x32 bits multiply is enough for _Py_popcount32().
This commit is contained in:
parent
ac1f152421
commit
cd8de40b3b
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue