AIM: add integer log2 utilities

Reviewer: @jnealtowns