Programing Puzzles
bearophile
bearophileHUGS at lycos.com
Fri Aug 8 09:31:54 PDT 2008
Koroskin Denis:
> It looks like a copy-paste from bithacks
> (http://graphics.stanford.edu/~seander/bithacks.html) - a must read for
> everyone!
My libs (math module) already contain some translations to D of those "hacks", including this one.
That page is good, and things will be better as soon as a high enough level language (D?) will allow to use CPU vector instructions like SSE and the following ones with a simple enough syntax, we'll probably see 1024 bit ones in 2-4 years:
http://en.wikipedia.org/wiki/Advanced_Vector_Extensions
With 1024 bits you can do *lot* of bitwise computations in one/few clock tick(s) :-)
There are many algorithms (like building state machines for exact/approximate string matching) that can become much faster with a portable support of such CPU instructions (you can use SSE3 with GCC in C but the syntax is hairy and not standard).
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list