Re:Iterating over Bit Sets Quickly
by jandrewrogers on Saturday February 24, 2024 @06:06PM
(#39495966)
At least on x86 processors, most idiomatic bit manipulation expressions like `word & -word` or `word & (word - 1)` compile to a single fast ALU instruction. __builtin_clz and similar are comparatively more expensive on many architectures.
[ Parent
| on HN ]
There are no comments on this comment yet.