This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Support for MIPS cache instruction macro
- From: Thiemo Seufer <ths at networkno dot de>
- To: binutils at sourceware dot org
- Date: Fri, 5 May 2006 16:45:11 +0100
- Subject: [PATCH] Support for MIPS cache instruction macro
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 },