This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stepanov on i686-pc-linux-gnu
On Sat, May 26, 2001 at 07:17:32PM -0700, Richard Henderson wrote:
> On Fri, May 25, 2001 at 06:24:39PM -0700, Joe Buck wrote:
> > .L262:
> > faddl (%eax)
> > leal 8(%eax), %edx
> > cmpl %ecx, %edx
> > movl %edx, %eax
> > jne .L262
> > movl %edx, 8(%ebp)
> >
> > Ouch! The iterator is being retrieved and stored to memory.
>
> Well, sorta. That last move is outside the loop.
I suppose the 'sorta' is ironically? Cause this code looks ok.
It looks like an iteration through a linked list with
%edx being end() and %edx being the iterator.
Hmm, an unroll of 2 would give
.L262:
faddl (%eax)
leal 8(%eax), %edx
cmpl %ecx, %edx
je .L263
faddl (%edx)
leal 8(%edx), %eax
cmpl %ecx, %eax
jne .L262
movl %eax, %edx
.L263:
movl %edx, 8(%ebp)
That takes one movl out of the loop :*)
But -heh- with all this pipelining etc, I have no idea
if it would gain anything.
Being of the 8080 generation (and not doing assembly since),
--
Carlo Wood <carlo@alinoe.com>