Andrew Haley wrote:
John Fine wrote:
I'm confident neither gcc nor Intel10 is inlining the exp() function,
Why are you confident of that? With -ffast-math -O2 that is precisely what
gcc will do. That's why Ian suggested it.
I should have asked whether the architecture being tested was 32bit or
64bit. I was assuming 64 bit and probably shouldn't have.
I had done similar tests myself with Intel10 in both 32 bit and 64 bit
and with gcc in only 64 bit. I never saw exp() inlined.
I retested with the source code from this thread in both Intel10 and gcc
4.1.2 both 32 bit and 64 bit, with -O2 in all cases and -ffast-math for
gcc. The exp() was inlined for 32 bit gcc but not for either Intel10
compile and not for 64 bit gcc. But the Intel results were four time
faster than the gcc results. Surprisingly, the gcc speed was the same
for the 32 bit with inlined code and the 64 bit with non inlined code.
The Intel10 speed was also the same for 32 bit as for 64 bit.