bitarithm: replace log2 and popcount, too