public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] MIPS/GAS: Support 32-bit offset with PREF
@ 2011-02-25  0:43 Maciej W. Rozycki
  2011-02-26  9:19 ` Richard Sandiford
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2011-02-25  0:43 UTC (permalink / raw)
  To: binutils; +Cc: Richard Sandiford

Hi,

 Interestingly enough, unlike with all the other instructions that address 
memory using the "o(b)" format specifier, we do not support the 32-bit 
offset form of "A(b)" as a macro with the PREF instruction.  I don't know 
what the original reason behind it was if any in particular, but it seems 
a good idea to me to stay consistent across the instruction set, so here's 
a change to make such a macro available.

 No test case included as the microMIPS change would wipe it away anyway 
-- I did include a suitable one there under the assumption this change 
will be preapplied.  Let me know if you'd rather I extracted it from there 
and converted to a transitional form to use here.

 Regression-tested with the mips-sde-elf and mips-linux-gnu targets.  OK 
to apply?

2011-02-25  Maciej W. Rozycki  <macro@codesourcery.com>

	gas/
	* config/tc-mips.c (macro): Handle M_PREF_AB.

	include/opcode/
	* mips.h (M_PREF_AB): New enum value.

	opcodes/
	* mips-opc.c (mips_builtin_opcodes): Add "pref" macro.

  Maciej

binutils-mips-pref.diff
Index: binutils-fsf-trunk-quilt/gas/config/tc-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/config/tc-mips.c	2011-02-24 23:46:08.000000000 +0000
+++ binutils-fsf-trunk-quilt/gas/config/tc-mips.c	2011-02-24 23:46:08.000000000 +0000
@@ -6530,6 +6530,9 @@ macro (struct mips_cl_insn *ip)
     case M_CACHE_AB:
       s = "cache";
       goto st;
+    case M_PREF_AB:
+      s = "pref";
+      goto st;
     case M_SDC1_AB:
       s = "sdc1";
       coproc = 1;
@@ -6571,7 +6574,7 @@ macro (struct mips_cl_insn *ip)
 	  || mask == M_L_DAB
 	  || mask == M_S_DAB)
 	fmt = "T,o(b)";
-      else if (mask == M_CACHE_AB)
+      else if (mask == M_CACHE_AB || mask == M_PREF_AB)
 	fmt = "k,o(b)";
       else if (coproc)
 	fmt = "E,o(b)";
Index: binutils-fsf-trunk-quilt/include/opcode/mips.h
===================================================================
--- binutils-fsf-trunk-quilt.orig/include/opcode/mips.h	2011-02-24 23:46:02.000000000 +0000
+++ binutils-fsf-trunk-quilt/include/opcode/mips.h	2011-02-24 23:46:08.000000000 +0000
@@ -864,6 +864,7 @@ enum
   M_MULOU_I,
   M_NOR_I,
   M_OR_I,
+  M_PREF_AB,
   M_REM_3,
   M_REM_3I,
   M_REMU_3,
Index: binutils-fsf-trunk-quilt/opcodes/mips-opc.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/opcodes/mips-opc.c	2011-02-24 23:46:02.000000000 +0000
+++ binutils-fsf-trunk-quilt/opcodes/mips-opc.c	2011-02-24 23:46:08.000000000 +0000
@@ -191,6 +191,7 @@ const struct mips_opcode mips_builtin_op
    instruction name anyhow.  */
 /* name,    args,	match,	    mask,	pinfo,          	pinfo2,		membership */
 {"pref",    "k,o(b)",   0xcc000000, 0xfc000000, RD_b,           	0,		I4_32|G3	},
+{"pref",    "k,A(b)",	0,    (int) M_PREF_AB,	INSN_MACRO,		0,		I4_32|G3	},
 {"prefx",   "h,t(b)",	0x4c00000f, 0xfc0007ff, RD_b|RD_t|FP_S,		0,		I4_33	},
 {"nop",     "",         0x00000000, 0xffffffff, 0,              	INSN2_ALIAS,	I1      }, /* sll */
 {"ssnop",   "",         0x00000040, 0xffffffff, 0,              	INSN2_ALIAS,	I1	}, /* sll */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS/GAS: Support 32-bit offset with PREF
  2011-02-25  0:43 [PATCH] MIPS/GAS: Support 32-bit offset with PREF Maciej W. Rozycki
@ 2011-02-26  9:19 ` Richard Sandiford
  2011-02-28 16:10   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2011-02-26  9:19 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: binutils

"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> 2011-02-25  Maciej W. Rozycki  <macro@codesourcery.com>
>
> 	gas/
> 	* config/tc-mips.c (macro): Handle M_PREF_AB.
>
> 	include/opcode/
> 	* mips.h (M_PREF_AB): New enum value.
>
> 	opcodes/
> 	* mips-opc.c (mips_builtin_opcodes): Add "pref" macro.

OK, thanks.

Richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS/GAS: Support 32-bit offset with PREF
  2011-02-26  9:19 ` Richard Sandiford
@ 2011-02-28 16:10   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2011-02-28 16:10 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: binutils

On Sat, 26 Feb 2011, Richard Sandiford wrote:

> > 2011-02-25  Maciej W. Rozycki  <macro@codesourcery.com>
> >
> > 	gas/
> > 	* config/tc-mips.c (macro): Handle M_PREF_AB.
> >
> > 	include/opcode/
> > 	* mips.h (M_PREF_AB): New enum value.
> >
> > 	opcodes/
> > 	* mips-opc.c (mips_builtin_opcodes): Add "pref" macro.
> 
> OK, thanks.

 Committed now, thanks.

  Maciej

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-28 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25  0:43 [PATCH] MIPS/GAS: Support 32-bit offset with PREF Maciej W. Rozycki
2011-02-26  9:19 ` Richard Sandiford
2011-02-28 16:10   ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).