pgcc-1.0.1 with and without haifa

John Carr jfc@mit.edu
Fri Jan 9 20:45:00 GMT 1998


> [replacing div with mul] is a win on just about every machine architecture
> ever created, for integer as well as float.

gcc converts integer division by a constant to multiplication on machines
with extended precision multiply instructions.

For floating point most compilers avoid this optimization unless explicitly
requested because a few users want exact IEEE FP standard results and
x/y != x*(1/y) in IEEE FP.  gcc and some other compilers optimize division
by powers of 2 unconditionally because that substitution is exact.



More information about the Gcc mailing list