2 ms·
I mean ideally you’d probably want this to be lowered to a popcnt instruction.
by saagarjha 3y ago
I mean ideally you’d probably want this to be lowered to a popcnt instruction.
- celrod 3y agoYes, just because you see SIMD instructions doesn't mean the code is fast. You need the correct instructions. Not relevant to this example, which is `popcount`ing only a single number, but AVX512 did also introduce SIMD popcount instructions for getting many inputs at a time. Also true for other useful bit-funs like leading or trailing zeros. So if you're using zmm registers, you can do way better than that godbolt example.