On 13 January 2017 at 15:52, André Hentschel nerv@dawncrow.de wrote:
Thank you both for the hints. One thing is that popcount would count all 1s even with 0s in between, whereas this function stops at the first 0.
Yeah, the strict equivalent would be something along the lines of "__builtin_clz(~mask)". But as you mentioned, there's the question what should happen with broken/special masks.