Number of Bits Needed to Represent a Zero-Offset Integer

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 19 10:40:10 PST 2015


On 1/19/15 10:49 AM, "Per =?UTF-8?B?Tm9yZGzDtnci?= 
<per.nordlow at gmail.com>" wrote:
> On Monday, 19 January 2015 at 13:30:47 UTC, Steven Schveighoffer wrote:
>> http://dlang.org/phobos/core_bitop.html#.bsr
>>
>> It's actually an intrinsic, reduces to an instruction. Mind the
>> requirements for 0.
>>
>
> Nice. Is this intrinsic supported for all DMD/GCD/LDC supported
> platforms or do we have to supply fallback logic when bsr is not available?

I'm fairly certain it's supported as an intrinsic there. BSR is an X86 
instruction. You'd have to disassemble to be sure on the target platform.

But it is definitely supported regardless, as it's part of the API.

-Steve


More information about the Digitalmars-d-learn mailing list