This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why pass HAVE_32BIT_GPRS to OPCODE_IS_MEMBER?


On Tue, Aug 07, 2001 at 10:43:16PM +0200, Thiemo Seufer wrote:
> H . J . Lu wrote:
> [snip]
> >    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.  */
> 
> This comment is possibly misleading. There are three ways to restrict
> the assembler to 32bit GPRs: Explicitly by the programmer (-mgp32),
> implicitly by the ABI (-mabi=32) and implicitly by the ISA (-mips{1,2,32}
> or -march=FOO), where only the latter one can change over an assembly
> run. So we need to check only two states: Programmer+ABI and ISA.
> The current code checks for three which may get inconsistent.

There are

/* 32-bit code running on a ISA3+ CPU.  */
#define INSN_GP32                 0x00100000

#define OPCODE_IS_MEMBER(insn, isa, cpu, gp32)                          \
    ((((insn)->membership & isa) != 0                                   \
      && ((insn)->membership & INSN_GP32 ? gp32 : 1)                    \

#define G6      INSN_GP32

{"move", "d,s", 0x00000025, 0xfc1f07ff, WR_d|RD_s, I1|G6   },/* or */

"move" is the only one affected by this. I am enclosing a new patch here.

> > +#define HAVE_FORCEED_32BIT_GPRS	            \
>                      ^
> Consistent typo. :-)

Oops.

> 
> > +   (mips_gp32 || mips_32bit_abi)
> > +
> 
> Why differentiate between forced and non-forced 32bit GPRS?
> The assembler should handle both identically.

I don't know.


H.J.
--- gas/config/tc-mips.c.gp32	Tue Aug  7 12:46:48 2001
+++ gas/config/tc-mips.c	Tue Aug  7 14:05:41 2001
@@ -266,6 +266,10 @@ static int mips_32bit_abi = 0;
     || mips_32bit_abi                       \
     || ! ISA_HAS_64BIT_REGS (mips_opts.isa))
 
+#define HAVE_FORCED_32BIT_GPRS	            \
+   ((mips_gp32 || mips_32bit_abi)	    \
+    && ISA_HAS_64BIT_REGS (mips_opts.isa))
+
 #define HAVE_32BIT_FPRS                     \
    (mips_fp32                               \
     || mips_32bit_abi                       \
@@ -2618,7 +2622,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_FORCED_32BIT_GPRS)
 	  && (mips_arch != CPU_R4650 || (insn.insn_mo->pinfo & FP_D) == 0))
 	break;
 
@@ -7154,7 +7158,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_FORCED_32BIT_GPRS))
 	ok = true;
       else
 	ok = false;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]