use portable CmiLog2 instead of log2