I came across this site years ago and it has come in handy for my few embedded projects when cpu time gets tight. It provides some rather nifty ways to do all sorts of integer and bit operations in far less operations than you might suspect. Some require 64 bit operations, or IEEE floating point operations, or fast integer division, but what's left is still pretty damn interesting.
http://graphics.stanford.edu/~seander/bithacks.html
http://graphics.stanford.edu/~seander/bithacks.html