0 is not a power of 2

Brian Schott via Digitalmars-d digitalmars-d at puremagic.com
Mon May 18 22:40:05 PDT 2015


On Tuesday, 19 May 2015 at 05:16:48 UTC, Andrei Alexandrescu 
wrote:
> Any ideas for faster code?

Unless I'm mistaken, any uint that's a power of 2 will only have 
a single set bit, so why not use the "popcnt" instruction? 
http://dlang.org/phobos/core_bitop.html#.popcnt


More information about the Digitalmars-d mailing list