linux-mips
[Top] [All Lists]

Re: MIPS gas relaxation still doesn't work

To: "H. J. Lu" <hjl@lucon.org>
Subject: Re: MIPS gas relaxation still doesn't work
From: Jim Wilson <wilson@redhat.com>
Date: 15 Oct 2002 15:58:57 -0400
Cc: Alexandre Oliva <aoliva@redhat.com>, Richard Sandiford <rsandifo@redhat.com>, linux-mips@linux-mips.org, gcc@gcc.gnu.org, binutils@sources.redhat.com
In-reply-to: <20021014123940.A32333@lucon.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20021014082810.A28682@lucon.org> <wvnit05ovct.fsf@talisman.cambridge.redhat.com> <20021014091649.A29353@lucon.org> <wvnfzv9ou6j.fsf@talisman.cambridge.redhat.com> <20021014101640.A30133@lucon.org> <orhefo3oht.fsf@free.redhat.lsd.ic.unicamp.br> <20021014105055.B30830@lucon.org> <orzntg298z.fsf@free.redhat.lsd.ic.unicamp.br> <20021014110118.B30940@lucon.org> <orelas24n2.fsf@free.redhat.lsd.ic.unicamp.br> <20021014123940.A32333@lucon.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
>Can gcc not to emit nop nor noreorder when it tries to fill the delay
>slot with nop?

You never want the assembler to try to fill delay slots.  Consider a compiler
optimization like software pipelining.  The compiler will schedule instructions
inside a loop with full knowledge of the target pipeline to give maximum
performance.  Then the assembler picks a random instruction from the loop,
puts it in a branch delay slot, and now your code runs twice as slow because
the assembler introduced pipeline stalls.  Of course, gcc isn't good enough
yet to have this problem yet, but we will get there eventually.  Meanwhile, we
need to get out of the habit of relying on assembler optimizations.  In the
long run, assembler optimizations are bad, and we need to stop using them as
soon as possible.  Gcc should emit .set nomacro/noreorder/noat/etc at the
begining of its assembly output, and never turn them on.

Jim

<Prev in Thread] Current Thread [Next in Thread>