Article View: gnu.gcc.help
Article #53292Re: Benchmarks of GCC 2.0
From: Miles Bader
Date: Tue, 25 Feb 1992 16:26
Date: Tue, 25 Feb 1992 16:26
72 lines
3653 bytes
3653 bytes
jacobsd@prism.CS.ORST.EDU (Dana Jacobsen) writes:
> In <MIB.92Feb24165350@geech.gnu.ai.mit.edu> mib@geech.gnu.ai.mit.edu (Michael I Bushnell) writes:
> >From the release announcement by rms:
> > Early testing of GCC Version 2.0 indicates that it produces faster
> > code for SPARC computers than Sun's latest released compilers (both
> > bundled and unbundled). It is also the fastest known compiler for
> > the Motorola 88k.
> >I don't know in what the "early testing" consists.
> I will get the new version soon, but I ran some initial tests on the Jan
> 7 version, and it is faster than Sun's bundled compiler, but not the 1.0
> unbundled one.
The released version of gcc2 doesn't seem to do a very good job of scheduling
compared to the sun compiler that comes with sunos (4.1.1).
E.g.,
float dotprod(vec1,vec2,length)
float *vec1, *vec2;
int length;
{
int i;
float sum=0;
for(i=0; i<length; i++)
sum+=vec1[i]*vec2[i];
return sum;
}
Here's what the unrolled part of the inner loops look like:
"gcc2 -O2 -funroll-loops" "cc -O4 -fsingle"
L5: L77003:
ld [%o0],%f2 ld [%o0],%f1
ld [%o1],%f1 ld [%o5],%f2
fmuls %f2,%f1,%f1 fmuls %f1,%f2,%f1
fadds %f0,%f1,%f0 ld [%o0+4],%f4
ld [%o0+4],%f2 fadds %f30,%f1,%f30
ld [%o1+4],%f1 ld [%o5+4],%f5
fmuls %f2,%f1,%f1 fmuls %f4,%f5,%f4
fadds %f0,%f1,%f0 fadds %f30,%f4,%f30
ld [%o0+8],%f2 ld [%o0+8],%f7
ld [%o1+8],%f1 ld [%o5+8],%f8
fmuls %f2,%f1,%f1 fmuls %f7,%f8,%f7
fadds %f0,%f1,%f0 ld [%o0+12],%f10
ld [%o0+12],%f2 fadds %f30,%f7,%f30
ld [%o1+12],%f1 ld [%o5+12],%f11
fmuls %f2,%f1,%f1 fmuls %f10,%f11,%f10
add %g2,16,%g2 inc 16,%o5
cmp %g2,%o3 add %o5,12,%g2
add %o0,16,%o0 fadds %f30,%f10,%f30
add %o1,16,%o1 cmp %g2,%o1
bl L5 blu L77003
fadds %f0,%f1,%f0 inc 16,%o0
The same instructions, but sun's compiler spreads them more advantageously;
anyway, the resulting program (that just repeatedly calls dotprod) runs
almost twice as fast when compiled with the sun compiler...
[Where should messages like this be posted? Should this have gone to gnu.gcc.bugs?]
-Miles
--
--
Miles Bader -- HCRC, University of Edinburgh -- miles@cogsci.ed.ac.uk
Ich bin ein Virus. Mach' mit und kopiere mich in Deine .signature.
97% of everything is grunge
Technical Details
Message-ID:
<MILES.92Feb25162624@oliphant.cogsci.ed.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!edcastle!aisb!cogsci!milesReferences:
<1992Feb23.213917.13705@murdoch.acc.Virginia.EDU> <MIB.92Feb24165350@geech.gnu.ai.mit.edu> <1992Feb25.001812.21112@CS.ORST.EDU>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,594f013cff35018a,start X-Google-Attributes: gid11318c,public X-Google-Thread: 1025b4,e63d5b04b0b2c1eb X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1992-02-25 22:23:57 PST Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!edcastle!aisb!cogsci!miles From: miles@cogsci.ed.ac.uk (Miles Bader) Newsgroups: gnu.gcc.help,gnu.misc.discuss Subject: Re: Benchmarks of GCC 2.0 Message-ID: <MILES.92Feb25162624@oliphant.cogsci.ed.ac.uk> Date: 25 Feb 92 16:26:24 GMT References: <1992Feb23.213917.13705@murdoch.acc.Virginia.EDU> <MIB.92Feb24165350@geech.gnu.ai.mit.edu> <1992Feb25.001812.21112@CS.ORST.EDU> Sender: news@aisb.ed.ac.uk (Network News Administrator) Organization: HCRC, University of Edinburgh Lines: 72 In-Reply-To: jacobsd@prism.CS.ORST.EDU's message of 25 Feb 92 00:18:12 GMT