Bit hacks to compute floor(log2(int))