MIPS opcodes patch: change move from andu to or

Gavin Romig-Koch gavin@cygnus.com
Mon Oct 25 12:50:00 GMT 1999


Andrew Haley writes:
 > >    OK to commit?
 > > 
 > >    For opcodes:
 > > 	   * mips-opc.c (move): Use "or" rather than "addu" or "daddu".
 > > 
 > > We deliberately chose ``addu'' and ``daddu'' rather than ``or''
 > > because several MIPS chips have two pipelined addition units but only
 > > one pipelined logical unit.  Those chips can move two pairs of
 > > registers around at once if we use ``addu'', but they can only move
 > > one pair if we use ``or''.
 > 
 > Aha!  That's a *very* good reason.  I'll add a comment, if that's OK
 > with you.
 > 
 > > Is there any reason we should use ``or''?  Your comment mentions
 > > something about ``gcc -mips3 -gp32''; can't we fix gcc?
 > 
 > Yeah.  The problem is that -mgp32 is supposed to generate 32-bit code,
 > but any move insns get converted into "dadd".  I don't really think
 > that this is important, since the insns will have the same effect, but
 > it looks rather odd.

The overall problem is that the -mgp32 flag was never fully implemented
(I don't know why), and no-one's ever had time to get it working.  One
of the problems with it is that gas neither recieves nor handles the
-mgp32 flag.  It only sees the -mips3 flag (or gets -mips3 it by default),
and produces a "daddu" for "move" (and perhaps other related problems).

I thought that the "move" -> "or" patch would be a low cost fix to part
of the -mgp32 problems, but I didn't think of the pipeline issue.

 > I suppose that we could change gcc to ouput "or" insns for 32-bit
 > moves, but that would degrade performance in the case that you
 > describe.

Getting -mgp32 working in mips gas is on my list of things to do; I'll
see about moving it up.

                                                -gavin...



More information about the Binutils mailing list