This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29549] matmul slow for complex matrices
- From: "jb at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Nov 2006 22:16:56 -0000
- Subject: [Bug fortran/29549] matmul slow for complex matrices
- References: <bug-29549-1719@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from jb at gcc dot gnu dot org 2006-11-04 22:16 -------
For the C version with 1d arrays, the benchmark results, with gfortran results
for comparison, are
Complex version:
-O3 funroll-loops -mfpmath=sse -msse2
1.32
above + fast-math
0.38
gfortran -O2:
0.32
Real version:
0.07 s
fast-math, same thing.
gfortran -O2 -g
0.07
So it seems the culprit is some optimization that -ffast-math enables that
makes a huge difference for C99 complex arithmetic. However, compiling matmul
in libgfortran with -ffast-math almost certainly won't fly..
So ideally we should find exactly what flag enables this performance
improvement, and see if we can enable only that without bringing in all the
-ffast-math baggage. Or then we should bugger the optimizer guys, if this is an
optimization that could be enabled also without -ffast-math.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29549