Table lookups - this is pretty definitive

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 12:41:19 PDT 2014


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);


More information about the Digitalmars-d mailing list