I\'ve often noticed gcc converting multiplications into shifts in the executable. Something similar might happen when multiplying an int and a float. F
int
float
Here's an actual compiler optimization I'm seeing with GCC 10:
x = 2.0 * hi * lo;
Generates this code:
mulsd %xmm1, %xmm0 # x = hi * lo; addsd %xmm0, %xmm0 # x += x;