import core.cpuid: hasPopcnt;
/// Returns the number of bits which are set.
uint popcnt(ulong bits) nothrow
{
version(X86_64) {
if(hasPopcnt()) {
asm {
....
}
}
else {
...
}
}
}
Is there any reason that core.cpuid.hasPopcnt() cannot be made
pure? Hopefully, calling it won't change my processor :)
