> Seasoned programmers put a .set noreorder at the top of their assembly
> files and gcc __asm__ macros.
And do not to forget a .set reorder at the bottom of their __asm__
> > And further still, some assemblers have 'noreorder' set by default,
> > most do not. You'll need to consult the docs for the assembler you
> > are using to see which is the case.
> Hopefully, the MIPS assemblers have a nice warning system.
They warn about some dangerous things like
which won't work on the interlockless R3000.
If you look through my code you'll find many places where I reenable
assembler reordering for just two instructions. This is to give
the assembler a chance of putting nops necesessary for the R3000
into the object file.
> The Alpha has exactly the same problem.
But no delay slots ...
> > I was pretty ticked when I learned that MIPS assemblers move
> > instructions around on you behind your back, this is just simply
> > broken.
> You mean the usage of the at register for performing the syntetic
> instructions? Yeah, well, I can imagine *you* did not like that :-).
> But you never liked syntetic instructions on the sparc either.
I'm similar to David in that I also usually prefer lobotomized tools
that only do what I tell them to do but the intelligence of the MIPS
assemblers makes sense. The synthetic instructions are necessary in
order to make it possible for the assembler to generate best possible
code for both PIC/non-PIC etc. code models from the same source.
Also the assembler knows more about the object files' layout than the
compiler so it can do several optimizations that a compiler can't.