http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49148

--- Comment #7 from John Peyton <jchthys at yahoo dot com> 2011-05-25 14:40:56 
UTC ---
> Try -ffast-math (the default for ICC) which disables subnormals.

Thanks, this helped it run much faster!

I noticed it still takes longer to divide by 3.0 than by 4.0. More
specifically, the following line was fast:

     new[i] = (A[i-1] + 2*A[i] + A[i+1]) / 4.0;

The following line took about 4 times as long to run without -ffast-math:

     new[i] = (A[i-1] + A[i] + A[i+1]) / 3.0;

With -ffast-math, it was faster; however, it was still took about 2 times as
long as the division by 4.0 version. In addition, changing division by 3.0 to
multiplication by 0.333 or even 0.3 did not affect the speed.

Could this also be related to subnormal numbers, or is this just a different
issue?

Reply via email to