This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS gas relaxation still doesn't work


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]