Expand description
Bithacks to minimise the cost
Functions§
- highest_
bit_ set - bithacks functions. Implmented according to paper “Faster Remainder by Direct Computation Applications to Compilers and Software Libraries” Given a 32-bit number, find the highest bit number which is set 1. e.g:
- round_
up_ to_ power2 - Given a 32-bit number, return the next highest power of 2, and the corresponding thift. e.g: