This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: [RFC] patch: Re: reg+reg addressing mode on SPARC


Jakub Jelinek <jakub@redhat.com> writes:

  > On Fri, Aug 10, 2001 at 06:46:44PM -0700, Dan Nicolaescu wrote:
  > > Meanwhile let's see if my patch is correct...
  > > (it bootstraps on sparc-sun-solaris2.8)
  > 
  > > +       if (code0 == REG || code1 == REG)
  > > +         return 2;
  > 
  > It apparently does not do what was described it does: it gives higher cost
  > for %reg+anything.

Yep, typo. Should have been && instead of ||. 

  > And the example you gave is IMHO really not related to addressing
  > mode costs, after all they are the same.

Are you sure? (I have no idea...)
Is anything taking into account that reg+reg is using 2 registers,
thus increases the register pressure? 
Modern sparcs have a sum-addressed L1 cache, so they don't need an
adder for a reg+offset address, but a reg+reg address might need to go
through an adder (this is speculation and some vague memories, as I
can't seem to find the relevant paper to check the facts).

I have run the SPEC95 benchmarks compiled with gcc-3.0 and gcc-3.0
with the patch that increases ADDRESS_COST for reg+reg addressing on a 
SUN Blade100 machine: 500MHz UltraSPARCIIe and 1GB RAM, running Solaris2.8

The results are a little better in some cases for the patched
compiler, and a little worse in some other cases. 

First set of compiler flags:
All benchmarks compiled with:
-O2 -mcpu=v8 -mtune=ultrasparc

SpecINT95 
for gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O2comparison/CINT95.052.asc

for the patched gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O2comparison/CINT95.055.asc

SpecFP95
for gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O2comparison/CFP95.052.asc

for the patched gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O2comparison/CFP95.055.asc

Second set of compiler flags:
First set of compiler flags:
All benchmarks compiled with:
-O3 -funroll-loops -mcpu=v8 -mtune=ultrasparc

SpecINT95 
for gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O3-unroll-loops-comparison/CINT95.057.asc

for the patched gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O3-unroll-loops-comparison/CINT95.058.asc

SpecFP95
for gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O3-unroll-loops-comparison/CFP95.057.asc

for the patched gcc-3.0: http://www.ics.uci.edu/~dann/addrcost/Save-O3-unroll-loops-comparison/CFP95.058.asc

All benchmarks where run 3 times.

It seems 126.gcc does not work in all cases.
When using -O3 -funroll-loops 101.tomcatv is misscompiled. 

What to do next? 
        
        --dan


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