Andrew Haley wrote:
jackfrost wrote:
Ian Lance Taylor-3 wrote:
Try -ffast-math. I think it's the default for icc when optimizing.
I've tried -ffast-math with the same result.
You're going to have to look at the generated assembler code.
The generated assembler code wouldn't tell you anything.
Almost all the CPU time is spent inside the exp() function. I'm
confident neither gcc nor Intel10 is inlining the exp() function, so you
won't see the implementation of exp() in that generated assembler code.
You can look at the source code for the gnu version of exp(). Maybe you
can even figure out the conditions under which it is slow.
What are you trying to accomplish with the investigation of this
performance issue? Does the program whose performance you really care
about heavily use exp()? (Or did you get sidetracked into an exp()
investigation when you really care about something else?) Do you need
to use the gnu version of exp()? For an open source project, I guess
you would. For a program you will just use yourself, it is practical to
use Intel's version of exp() (and similar functions in libimf) even when
compiling your own source code with gcc.