Simple features that I've always missed from C...

Don nospam at nospam.com
Tue Oct 18 02:12:59 PDT 2011


On 18.10.2011 06:25, Robert Jacques wrote:
> On Mon, 17 Oct 2011 16:53:42 -0400, Manu <turkeyman at gmail.com> wrote:
> [snip]
>> *Count leading/trailing zeroes:* I don't know of any even slightly recent
>> architecture that doesn't have opcodes to count loading/trailing zeroes,
>> although they do exist, so perhaps this is a little dubious. I'm sure
>> this
>> could be emulated for such architectures, but it might be unreasonably
>> slow
>> if used...
>
> D has this: check out std.intrinsic's bsr and bsl.

You mean bsr and bsf.
Unfortunately, there are some big problems with them. What is bsr(0) ?



More information about the Digitalmars-d mailing list