This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rtlopt loop unroller question
On Thu, Oct 23, 2003 at 10:12:59PM +0200, Toon Moene wrote:
> Daniel Jacobowitz wrote:
>
> >On Wed, Oct 22, 2003 at 11:38:50PM +0200, Toon Moene wrote:
>
> >>What I do not understand is why this part of the compiler thinks that:
> >>
> >> LD Rx,<const>(Ay)
> >> ADD 2^N,Ay ! sizeof(LD access) = 2^N
> >>
> >>can be replaced by
> >>
> >> LD Rx,<const>(Ay)+ ! Using autoincrement
> >>
> >>By far the most architectures that do support autoincrement/decrement do
> >>not do so when the address register is offset ...
>
> >Well, that suggests that ARM may be a good target to try related
> >benchmarks on:
> > ldr r3, [ip, pc]!
> >is "load [ip + pc] into r3 and update ip to ip + pc". #8 works in
> >place of pc, too.
>
> Yeah, but that isn't the problem. The problem is that the piece of code
> that Zdenek disabled takes [pseudo-code]
>
> (PLUS (PLUS REG 4) 4)
>
> and then says:
>
> 1. This is a {PRE|POST}_INCREMENT target.
> 2. The inner constant (4) is equal to the outer constant (4).
> 3. And those are of the form 2^n.
>
> -> Therefore I won't CSE these expressions as auto-increment will make
> efficient code out of it.
>
> BUT:
>
> Auto-increment doesn't work here, because
>
> LD Rx,4(Ry)+
>
> is not allowed, only
>
> LD Rx,(Ry)+
What I'm saying is that
ldr Rx, [Ry, #4]!
is the "4(Ry)+" that you describe above.
But there's no 2^N restriction so that still leaves me in the dark what
this was developed for.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer