Y
Yixin Cao
GCC always avoids multiplication instructions as much as possible, so a *= 10; will be translated into:
leal (%eax, %eax, 4), %eax
add %eax, %eax
I do know that it is due to historic reason, for that old CPU spent 30+ clock cycles to finish a multiplication
instruction. But it is never true now, while 3 clock cycles will suffice, so it brings the side affect of bigger object
files without any gain.
It might do it default for the consideration of compatibility, but my problem is how to disable it, for my code will
never run on a box been made a decade ago.
Yixin Cao
leal (%eax, %eax, 4), %eax
add %eax, %eax
I do know that it is due to historic reason, for that old CPU spent 30+ clock cycles to finish a multiplication
instruction. But it is never true now, while 3 clock cycles will suffice, so it brings the side affect of bigger object
files without any gain.
It might do it default for the consideration of compatibility, but my problem is how to disable it, for my code will
never run on a box been made a decade ago.
Yixin Cao