Checking if an Integer is an Exact Binary Power

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 26 09:53:00 PDT 2016


On Tuesday, 26 April 2016 at 14:37:46 UTC, Marco Leise wrote:
> Can we just use __traits(hasTargetFeature, "popcnt") already
> and get rid of _popcnt?

No, because DMD does not currently support setting SSE4 as the 
minimum target. Thus, `__traits(hasTargetFeature, "popcnt")` must 
always return `false` at compile time.

As for LDC and GDC - both already treat `popcnt()` as an 
intrinsic, and don't need your proposed change.


More information about the Digitalmars-d mailing list