This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Why pass HAVE_32BIT_GPRS to OPCODE_IS_MEMBER?
- To: rsandifo at redhat dot com
- Subject: Why pass HAVE_32BIT_GPRS to OPCODE_IS_MEMBER?
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Tue, 7 Aug 2001 12:59:31 -0700
- Cc: binutils at sourceware dot cygnus dot com
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?
H.J.
----
2001-08-07 H.J. Lu <hjl@gnu.org>
* config/tc-mips.c (HAVE_FORCEED_32BIT_GPRS): New.
(macro_build): Pass HAVE_FORCEED_32BIT_GPRS to OPCODE_IS_MEMBER
instead of HAVE_32BIT_GPRS.
(mips_ip): Likewise.
--- gas/config/tc-mips.c.gp32 Tue Aug 7 12:46:48 2001
+++ gas/config/tc-mips.c Tue Aug 7 12:48:11 2001
@@ -266,6 +266,9 @@ static int mips_32bit_abi = 0;
|| mips_32bit_abi \
|| ! ISA_HAS_64BIT_REGS (mips_opts.isa))
+#define HAVE_FORCEED_32BIT_GPRS \
+ (mips_gp32 || mips_32bit_abi)
+
#define HAVE_32BIT_FPRS \
(mips_fp32 \
|| mips_32bit_abi \
@@ -2618,7 +2621,7 @@ macro_build (place, counter, ep, name, f
if (strcmp (fmt, insn.insn_mo->args) == 0
&& insn.insn_mo->pinfo != INSN_MACRO
&& OPCODE_IS_MEMBER (insn.insn_mo, mips_opts.isa, mips_arch,
- HAVE_32BIT_GPRS)
+ HAVE_FORCEED_32BIT_GPRS)
&& (mips_arch != CPU_R4650 || (insn.insn_mo->pinfo & FP_D) == 0))
break;
@@ -7154,7 +7157,8 @@ mips_ip (str, ip)
assert (strcmp (insn->name, str) == 0);
- if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_arch, HAVE_32BIT_GPRS))
+ if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_arch,
+ HAVE_FORCEED_32BIT_GPRS))
ok = true;
else
ok = false;