This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] patch: Re: reg+reg addressing mode on SPARC
- To: Dan Nicolaescu <dann at ics dot uci dot edu>
- Subject: Re: [RFC] patch: Re: reg+reg addressing mode on SPARC
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Sat, 11 Aug 2001 08:03:19 +0200
- Cc: Joe Buck <jbuck at synopsys dot com>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <200108110107.SAA09804@atrus.synopsys.com> <200108101846.aa22556@gremlin-relay.ics.uci.edu>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
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.
And the example you gave is IMHO really not related to addressing mode
costs, after all they are the same. The thing is we need to find out why
loop optimization does not do its job properly.
If it e.g. wrote the first loop as:
.LL5:
ld [%o4+%o2], %o1
add %o2, 4, %o2
cmp %o2, 4095
ble .LL5
add %o3, %o1, %o3
retl
mov %o3, %o0
it would be better. Even better with:
.LL5:
ld [%o4+%o2], %o1
cmp %o2, 4095-4
ble .LL5
add %o2, 4, %o2
retl
add %o3, %o1, %o0
But in all these cases reg+reg addressing is used. Pesimizing reg+reg or
even reg+anything will make generated code worse.
Jakub