This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Why pass HAVE_32BIT_GPRS to OPCODE_IS_MEMBER?
On Tue, Aug 07, 2001 at 09:14:36PM +0100, Richard Sandiford wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
>
> > The new gas generates different opcodes on Linux/mips. The change was
> > introduced by the HAVE_32BIT_GPRS change. In include/opcode/mips.h
> >
> > /* Test for membership in an ISA including chip specific ISAs.
> > INSN is pointer to an element of the opcode table; ISA is the
> > specified ISA to test against; and CPU is the CPU specific ISA
> > to test, or zero if no CPU specific ISA test is desired.
> > The gp32 arg is set when you need to force 32-bit register usage on
> > a machine with 64-bit registers; see the documentation under -mgp32
> > in the MIPS gas docs. */
> >
> > #define OPCODE_IS_MEMBER(insn, isa, cpu, gp32) \
> >
> > I don't understand why the change was made. Here is a patch which
> > restores the old opcodes. But I am not sure if it is 100% correct.
> > Any comments?
>
> I'm not sure why you want to make this change. Because you want "addi" to be
> used instead of "ori" for the move instruction? It should be OK to change
It is "addu" vs. "or" for "move $1, $2".
> mips-opc.c so that "addi" is used for -mgp32 if so.
>
> There was discussion after I sent the patch of making the mtune option
> decide which instruction is used for moves. That sounded like a great idea,
> so I held off making a mips-opc.c change myself.
>
> Your patch seems to assume that "-mips2" and "-mips2 -mgp32" should give
> different results, which doesn't make much sense to me.
That was the old behavior, which I don't know if it makes senses or not. That
is why I am asking. Maybe we should do
#define HAVE_FORCEED_32BIT_GPRS \
((mips_gp32 || mips_32bit_abi) \
&& ISA_HAS_64BIT_REGS (mips_opts.isa))
I cannot tell any difference between "addu" vs. "or" for "move". But I
don't think we should change it for no good reason.
H.J.