public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: binutils@sourceware.org
Subject: [PATCH] Support for MIPS cache instruction macro
Date: Fri, 05 May 2006 17:26:00 -0000	[thread overview]
Message-ID: <20060505154511.GL18218@networkno.de> (raw)

Hello All,

I applied the appended patch which allows more flexible use of the
cache instruction.


Thiemo


2006-05-05  Thiemo Seufer  <ths@mips.com>
            David Ung  <davidu@mips.com>

	[ gas/ChangeLog ]
	* config/tc-mips.c (macro_build): Add case 'k' to handle cache
	instruction.
	(macro): Add new case M_CACHE_AB.

	[ opcodes/ChangeLog ]
	* mips-opc.c: Add macro for cache instruction.

	[ include/opcode/ChangeLog ]
	* mips.h (enum): Add macro M_CACHE_AB.


Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.330
diff -u -p -r1.330 tc-mips.c
--- gas/config/tc-mips.c	30 Apr 2006 18:34:39 -0000	1.330
+++ gas/config/tc-mips.c	2 May 2006 14:58:19 -0000
@@ -3196,6 +3565,10 @@ macro_build (expressionS *ep, const char
 	  insn.insn_opcode |= va_arg (args, unsigned long);
 	  continue;
 
+	case 'k':
+	  insn.insn_opcode |= va_arg (args, unsigned long) << OP_SH_CACHE;
+	  continue;
+
 	default:
 	  internalError ();
 	}
@@ -5820,6 +6193,9 @@ macro (struct mips_cl_insn *ip)
     case M_SCD_AB:
       s = "scd";
       goto st;
+    case M_CACHE_AB:
+      s = "cache";
+      goto st;
     case M_SDC1_AB:
       if (mips_opts.arch == CPU_R4650)
 	{
@@ -5857,6 +6233,8 @@ macro (struct mips_cl_insn *ip)
 	  || mask == M_L_DAB
 	  || mask == M_S_DAB)
 	fmt = "T,o(b)";
+      else if (mask == M_CACHE_AB)
+	fmt = "k,o(b)";
       else if (coproc)
 	fmt = "E,o(b)";
       else
Index: include/opcode/mips.h
===================================================================
RCS file: /cvs/src/src/include/opcode/mips.h,v
retrieving revision 1.48
diff -u -p -r1.48 mips.h
--- include/opcode/mips.h	30 Apr 2006 18:34:39 -0000	1.48
+++ include/opcode/mips.h	2 May 2006 14:58:20 -0000
@@ -642,6 +646,7 @@ enum
   M_BNE,
   M_BNE_I,
   M_BNEL_I,
+  M_CACHE_AB,
   M_DABS,
   M_DADD_I,
   M_DADDU_I,
Index: opcodes/mips-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/mips-opc.c,v
retrieving revision 1.55
diff -u -p -r1.55 mips-opc.c
--- opcodes/mips-opc.c	30 Apr 2006 18:34:39 -0000	1.55
+++ opcodes/mips-opc.c	2 May 2006 14:58:22 -0000
@@ -459,6 +460,7 @@ const struct mips_opcode mips_builtin_op
 {"flushid", "",		0xbc030000, 0xffffffff, 0, 			0,		L1	},
 {"wb", 	    "o(b)",	0xbc040000, 0xfc1f0000, SM|RD_b,		0,		L1	},
 {"cache",   "k,o(b)",   0xbc000000, 0xfc000000, RD_b,           	0,		I3|I32|T3},
+{"cache",   "k,A(b)",	0,    (int) M_CACHE_AB, INSN_MACRO,		0,		I3|I32|T3},
 {"ceil.l.d", "D,S",	0x4620000a, 0xffff003f, WR_D|RD_S|FP_D,		0,		I3|I33	},
 {"ceil.l.s", "D,S",	0x4600000a, 0xffff003f, WR_D|RD_S|FP_S|FP_D,	0,		I3|I33	},
 {"ceil.w.d", "D,S",	0x4620000e, 0xffff003f, WR_D|RD_S|FP_S|FP_D,	0,		I2	},

             reply	other threads:[~2006-05-05 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-05 17:26 Thiemo Seufer [this message]
2006-05-06  6:58 ` Eric Christopher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060505154511.GL18218@networkno.de \
    --to=ths@networkno.de \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).