This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: linpack C source
- To: Toshiyasu Morita <tm at netcom dot com>
- Subject: Re: linpack C source
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Sun, 12 Jul 98 17:51:06 +0200
- Cc: egcs-bugs at cygnus dot com
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <199807121139.EAA27996@netcom8.netcom.com>
> If anyone needs the source, I've put it up for ftp at:
>
> ftp://shell14.ba.best.com/pub.t/tm2/linpackc.c
The interesting part of the source, which you unfortunately didn't
copy in your previous message, is this:
y[i] = ((((((((((((((( (y[i])
+ x[j-15]*m[ldm*(j-15)+i])
+ x[j-14]*m[ldm*(j-14)+i])
+ x[j-13]*m[ldm*(j-13)+i])
+ x[j-12]*m[ldm*(j-12)+i])
+ x[j-11]*m[ldm*(j-11)+i])
+ x[j-10]*m[ldm*(j-10)+i])
+ x[j- 9]*m[ldm*(j- 9)+i])
+ x[j- 8]*m[ldm*(j- 8)+i])
+ x[j- 7]*m[ldm*(j- 7)+i])
+ x[j- 6]*m[ldm*(j- 6)+i])
+ x[j- 5]*m[ldm*(j- 5)+i])
+ x[j- 4]*m[ldm*(j- 4)+i])
+ x[j- 3]*m[ldm*(j- 3)+i])
+ x[j- 2]*m[ldm*(j- 2)+i])
+ x[j- 1]*m[ldm*(j- 1)+i])
+ x[j] *m[ldm*j+i];
The problem here is the hand-unrolled loop (don't you love
benchmarks :-(). Try the same with a simple loop and let egcs
unroll it (because the loop is so small, it will probably unroll it
4 times, which on a ix86 indeed loses, but it will be much better
than the "original").
Cheers,
Toon.
PS: I hope noone on this list thinks physicists write this sort of
cruft for a living ... I've better things to do with my time.