Replace power of 2 multiplications by shift

These expressions may be replaced by right or left shift operations, to
some possible performance improvement.

(Needs to verify if they are all positive values (shift does not work for
negative numbers))