Re:Counting set bits in an interesting way
by Genbox on Saturday April 30, 2022 @09:31AM
(#31215939)
The builtin POPCNT that came with Intel's SSE4 (SSE4a for AMD) is much faster. However, at a certain point, using AVX2 (and AVX-512 if present) is actually faster yet [1] - at least for 512 byte inputs or larger.
[1]: https://github.com/WojciechMula/sse-popcount