[Top] [All Lists]

Re: MIPS gas relaxation still doesn't work

To: "H. J. Lu" <>
Subject: Re: MIPS gas relaxation still doesn't work
From: Jim Wilson <>
Date: 15 Oct 2002 15:58:57 -0400
Cc: Alexandre Oliva <>, Richard Sandiford <>,,,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <> <> <> <> <>
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.


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