This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Large slowdown with gfortran vs f77 (x7)


Tobias Burnus wrote:
On 09/04/2009 05:04 PM, FX wrote:
  -- it's unarguably a glibc issue: if exp() is fast and expf() is
slow, why doesn't glibc implement expf() by calling exp()? (yes, there
can be other issues like rounding or so, but they can also be dealt
with separately)

If I recall correctly, it is mostly an x86-64 problem. AMD has some math patches for GLIBC which speed things up a lot. I think those are used in openSUSE/SLES but not in Fedora. On the other hand, the AMD patches have a problem with signaling NaN, which is being fixed [1,4].

Some older timings (from PR 34128) on openSUSE (!)  -- for "sin" but
there is the same problem as for exp:

              g77     gfortran
-m32  real(4) 0.408s  0.421s
-m64  real(4) 1.040s  0.589s ! sinf on x86-64: 40% faster!
-m32  real(8) 0.411s  0.408s
-m64  real(8) 0.976s  0.968s ! sin on x86-64

When I dug into the library routines originally on this I discovered the slow routines were using a software implementation where as the faster functions were using the math coprocessor. It is the glibc code.


Regards,

Jerry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]