[LIBS] Add library APIs for log2 functions

Signed-off-by: Anup Patel <anup@brainfault.org>