Table lookups - this is pretty definitive

Alix Pexton via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 18 00:52:59 PDT 2014


On 17/04/2014 8:41 PM, monarch_dodra wrote:
> On Thursday, 17 April 2014 at 18:07:24 UTC, ixid wrote:
>> I feel like there must be a way of making a fast bit look up but my
>> version is only moderate in speed. You can get all the bits you need
>> on two 64 bit registers or one SSE register. I haven't tried bt, does
>> that work with a 64 bit register?
>
> http://dlang.org/phobos/core_bitop.html#.bt
>
> ?
>
> Note it can be applied to the table in general, rather than the byte
> themselves. EG:
>
> ubyte[256] buf;
> auto b = bt(buf.ptr, 428);

I didn't think to look in core.bitop for a faster way to check bits, 
I'll check if it closes the gap to Walter's version.

A...


More information about the Digitalmars-d mailing list