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