0 is not a power of 2

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Tue May 19 14:11:37 PDT 2015


On Tuesday, 19 May 2015 at 20:41:58 UTC, Brian Schott wrote:
> On Tuesday, 19 May 2015 at 20:01:29 UTC, deadalnix wrote:
>> Have you tried things like :
>>
>> (x >> bsr(x)) == 1 ?
>>
>> I have no idea if this is faster or not, but worth trying.
>
> https://issues.dlang.org/show_bug.cgi?id=14380
>
> "If the content source operand is 0, the content of the 
> destination operand is undefined" - This applies to both the 
> bsf and bsr instructions.

Why ain't we generating a tzcnt ?


More information about the Digitalmars-d mailing list