Why pass HAVE_32BIT_GPRS to OPCODE_IS_MEMBER?

Richard Sandiford r.sandiford@redhat.com
Tue Aug 7 13:14:00 GMT 2001


"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
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.

Richard



More information about the Binutils mailing list