Bit hack optimizations

20 05 2008

I came across Sean Eron Anderson’s Bit Twiddling Hacks page today, where all these awkward optimizations are collected that are faster than generated machine code from the compiler for common tasks. Using those was common practice when people were still coding in Assembler and needed to get the most out of their CPUs, and it probably still finds use in programming today when speed is of the essence.

A link on that page went to Paul Hsie’s Assembly Language Lab where you can find fast code for dividing by a constant and multiplying with a constant. The latter page has a warning that because it is over 235K of HTML, browsers may fail to render the page correctly. Very cute. 🙂




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: