Which is faster: x

Potentially depends on the CPU.

However, all modern CPUs (x86, ARM) use a “barrel shifter” — a hardware module specifically designed to perform arbitrary shifts in constant time.

So the bottom line is… no. No difference.

Leave a Comment