From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gavin Romig-Koch To: Andrew Haley , ian@zembu.com Cc: binutils@sourceware.cygnus.com Subject: Re: MIPS opcodes patch: change move from andu to or Date: Mon, 25 Oct 1999 12:50:00 -0000 Message-id: <14356.45992.470966.869324@cetus.cygnus.com> References: <19991025173112.5003.qmail@daffy.airs.com> <19991025173905.17950.qmail@pasanda.cygnus.co.uk> X-SW-Source: 1999-10/msg00135.html 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...