This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (a+b)+c should be replaced by a+(b+c)
On Thu, Mar 25, 2004 at 09:21:48AM -0500, Scott Robert Ladd wrote:
> Joost VandeVondele wrote:
> >BTW, timing of the code below on IBM SP4 with xlf90, would be useful to
> >see how gfortran performs.
>
> Being in a benchmarking mood, I took your code and compiled it on a
> 2.8GHz Pentium 4 (Northwood core). The results did not show gfortran in
> a very good light:
>
> - - - - - - - - - - - - - - - - - - - - -
>
> Tycho$ ifort -O3 -tpp7 -xN -ipo -o matmuli matmul.for
> IPO: using IR for /tmp/ifortyRX1Wg.o
> IPO: performing single-file optimizations
> matmul.for(6) : (col. 6) remark: LOOP WAS VECTORIZED.
> matmul.for(7) : (col. 6) remark: LOOP WAS VECTORIZED.
> matmul.for(8) : (col. 6) remark: LOOP WAS VECTORIZED.
> Tycho:$ ./matmuli
> 5.90410300000000 10.2399999999998
> Tycho$ gfortran -o matmulg -O3 -ffast-math -march=pentium4 matmul.for
You forgot -mfpmath=sse. That is only the default for -m64.
Jakub