Add generic ilog2 functions