Bitwise gems – fast integer math

September 24, 2009

Found an interesting link: how to speed arithmetic operations, e.g.:

x = x * 2;
x = x * 64;

//equals, but 300% faster:
x = x << 1;
x = x << 6;

Others: http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/

Compiler I think does all of those tricks.

posted in Uncategorized, FYI by dmitko

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org