This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] MIPS: MCU ASE support
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: binutils at sourceware dot org, Chao-ying Fu <fu at mips dot com>, Rich Fuhler <rich at mips dot com>, David Lau <davidlau at mips dot com>, Kevin Mills <kevinm at mips dot com>, Catherine Moore <clm at codesourcery dot com>, Nathan Sidwell <nathan at codesourcery dot com>
- Date: Mon, 26 Jul 2010 11:56:54 +0100 (BST)
- Subject: [PATCH] MIPS: MCU ASE support
Hi,
This change adds MCU ASE support on top of the standard MIPS ISA and the
microMIPS ASE.
Regression-tested succesfully on mips-sde-elf and mips-linux-gnu targets.
gas/
2010-07-26 Chao-ying Fu <fu@mips.com>
Maciej W. Rozycki <macro@codesourcery.com>
* config/tc-mips.c (mips_set_options): Add ase_mcu.
(mips_opts): Initialise ase_mcu to -1.
(ISA_SUPPORTS_MCU_ASE): New macro.
(MIPS_CPU_ASE_MCU): Likewise.
(is_opcode_valid): Handle MCU.
(macro_build): Likewise.
(macro, micromips_macro): Likewise.
(validate_mips_insn, validate_micromips_insn): Likewise.
(mips_ip, micromips_ip): Likewise.
(options): Add OPTION_MCU and OPTION_NO_MCU.
(md_longopts): Add mmcu and mno-mcu.
(md_parse_option): Handle OPTION_MCU and OPTION_NO_MCU.
(mips_after_parse_args): Handle MCU.
(s_mipsset): Likewise.
(md_show_usage): Handle MCU options.
* doc/as.texinfo: Document -mmcu and -mno-mcu options.
* doc/c-mips.texi: Likewise, and document ".set mcu" and
".set nomcu" directives.
gas/testsuite/
2010-07-26 Maciej W. Rozycki <macro@codesourcery.com>
Chao-ying Fu <fu@mips.com>
* gas/mips/micromips@mcu.d: New test.
* gas/mips/mcu.d: Likewise.
* gas/mips/mcu.s: New test source.
* gas/mips/mips.exp: Run the new tests.
include/opcode/
2010-07-26 Chao-ying Fu <fu@mips.com>
Maciej W. Rozycki <macro@codesourcery.com>
* mips.h (OP_MASK_3BITPOS, OP_SH_3BITPOS): New macros.
(OP_MASK_OFFSET12, OP_SH_OFFSET12): Likewise.
(INSN_ASE_MASK): Add the MCU bit.
(INSN_MCU): New macro.
(M_ACLR_AB, M_ACLR_OB, M_ASET_AB, M_ASET_OB): New enum values.
(MICROMIPSOP_MASK_3BITPOS, MICROMIPSOP_SH_3BITPOS): New macros.
opcodes/
2010-07-26 Chao-ying Fu <fu@mips.com>
Maciej W. Rozycki <macro@codesourcery.com>
* mips-dis.c (mips_arch_choices): Enable MCU for "mips32r2"
and "mips64r2".
(print_insn_args, print_insn_micromips): Handle MCU.
* micromips-opc.c (MC): New macro.
(micromips_opcodes): Add "aclr", "aset" and "iret".
* mips-opc.c (MC): New macro.
(mips_builtin_opcodes): Add "aclr", "aset" and "iret".
Maciej
binutils-fsf-2.20.51-20100726-mcu-3.patch
Index: binutils-fsf-trunk-quilt/gas/config/tc-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/config/tc-mips.c 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/config/tc-mips.c 2010-07-26 02:37:09.000000000 +0100
@@ -202,6 +202,7 @@ struct mips_set_options
int ase_dsp;
int ase_dspr2;
int ase_mt;
+ int ase_mcu;
/* Whether we are assembling for the mips16 processor. 0 if we are
not, 1 if we are, and -1 if the value has not been initialized.
Changed by `.set mips16' and `.set nomips16', and the -mips16 and
@@ -276,8 +277,8 @@ static struct mips_set_options mips_opts
{
/* isa */ ISA_UNKNOWN, /* ase_mips3d */ -1, /* ase_mdmx */ -1,
/* ase_smartmips */ 0, /* ase_dsp */ -1, /* ase_dspr2 */ -1, /* ase_mt */ -1,
- /* mips16 */ -1, /* micromips */ -1, /* noreorder */ 0, /* at */ ATREG,
- /* warn_about_macros */ 0, /* nomove */ 0, /* nobopt */ 0,
+ /* ase_mcu */ -1, /* mips16 */ -1, /* micromips */ -1, /* noreorder */ 0,
+ /* at */ ATREG, /* warn_about_macros */ 0, /* nomove */ 0, /* nobopt */ 0,
/* noautoextend */ 0, /* gp32 */ 0, /* fp32 */ 0, /* arch */ CPU_UNKNOWN,
/* sym32 */ FALSE, /* soft_float */ FALSE, /* single_float */ FALSE
};
@@ -354,6 +355,9 @@ static int file_ase_mt;
#define ISA_SUPPORTS_MT_ASE (mips_opts.isa == ISA_MIPS32R2 \
|| mips_opts.isa == ISA_MIPS64R2)
+#define ISA_SUPPORTS_MCU_ASE (mips_opts.isa == ISA_MIPS32R2 \
+ || mips_opts.isa == ISA_MIPS64R2)
+
/* The argument of the -march= flag. The architecture we are assembling. */
static int file_mips_arch = CPU_UNKNOWN;
static const char *mips_arch_string;
@@ -1325,6 +1329,7 @@ struct mips_cpu_info
#define MIPS_CPU_ASE_MIPS3D 0x0010 /* CPU implements MIPS-3D ASE */
#define MIPS_CPU_ASE_MDMX 0x0020 /* CPU implements MDMX ASE */
#define MIPS_CPU_ASE_DSPR2 0x0040 /* CPU implements DSP R2 ASE */
+#define MIPS_CPU_ASE_MCU 0x0080 /* CPU implements MCU ASE */
static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *);
static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
@@ -2075,6 +2080,8 @@ is_opcode_valid (const struct mips_opcod
isa |= INSN_MIPS3D;
if (mips_opts.ase_smartmips)
isa |= INSN_SMARTMIPS;
+ if (mips_opts.ase_mcu)
+ isa |= INSN_MCU;
/* Don't accept instructions based on the ISA if the CPU does not implement
all the coprocessor insns. */
@@ -4566,6 +4573,14 @@ macro_build (expressionS *ep, const char
INSERT_OPERAND (CACHE, insn, va_arg (args, unsigned long));
continue;
+ case '\\':
+ INSERT_OPERAND (3BITPOS, insn, va_arg (args, int));
+ continue;
+
+ case '~':
+ INSERT_OPERAND (OFFSET12, insn, va_arg (args, unsigned long));
+ continue;
+
default:
internalError ();
}
@@ -5564,6 +5579,7 @@ macro (struct mips_cl_insn *ip)
unsigned int tempreg;
int mask;
int used_at = 0;
+ int is_ab = 0;
expressionS expr1;
const char *s;
const char *s2;
@@ -7128,6 +7144,41 @@ macro (struct mips_cl_insn *ip)
break;
+ case M_ACLR_AB:
+ is_ab = 1;
+ case M_ACLR_OB:
+ s = "aclr";
+ goto all_mem_op;
+ case M_ASET_AB:
+ is_ab = 1;
+ case M_ASET_OB:
+ s = "aset";
+ all_mem_op:
+ used_at = 1;
+ if (offset_expr.X_op == O_constant)
+ {
+ load_register (AT, &offset_expr, HAVE_64BIT_ADDRESSES);
+ if (breg != 0)
+ macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
+ }
+ else if (offset_expr.X_op == O_symbol)
+ {
+ if (is_ab == 1)
+ {
+ load_address (AT, &offset_expr, &used_at);
+ if (breg != 0)
+ macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
+ }
+ else
+ macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j", AT, breg,
+ offset_reloc[0]);
+ }
+ else
+ abort ();
+
+ macro_build (NULL, s, "\\,~(b)", treg, (unsigned long) 0, AT);
+ break;
+
case M_LB_AB:
s = "lb";
goto ld;
@@ -9379,6 +9430,8 @@ validate_mips_insn (const struct mips_op
case '$': USE_BITS (OP_MASK_MT_H, OP_SH_MT_H); break;
case '*': USE_BITS (OP_MASK_MTACC_T, OP_SH_MTACC_T); break;
case '&': USE_BITS (OP_MASK_MTACC_D, OP_SH_MTACC_D); break;
+ case '\\': USE_BITS (OP_MASK_3BITPOS, OP_SH_3BITPOS); break;
+ case '~': USE_BITS (OP_MASK_OFFSET12, OP_SH_OFFSET12); break;
case 'g': USE_BITS (OP_MASK_RD, OP_SH_RD); break;
default:
as_bad (_("internal: bad mips opcode (unknown operand type `%c'): %s %s"),
@@ -9537,6 +9590,7 @@ validate_micromips_insn (const struct mi
case 'S': USE_BITS (FS); break;
case 'T': USE_BITS (FT); break;
case 'V': USE_BITS (FS); break;
+ case '\\': USE_BITS (3BITPOS); break;
case 'a': USE_BITS (TARGET); break;
case 'b': USE_BITS (RS); break;
case 'c': USE_BITS (BREAKCODE); break;
@@ -9978,6 +10032,18 @@ mips_ip (char *str, struct mips_cl_insn
as_bad (_("Invalid dsp/smartmips acc register"));
break;
+ case '\\': /* 3-bit bit position */
+ my_getExpression (&imm_expr, s);
+ check_absolute_expr (ip, &imm_expr);
+ if ((unsigned long) imm_expr.X_add_number > OP_MASK_3BITPOS)
+ as_bad (_("Bit position for %s not in range 0..7 (%lu)"),
+ ip->insn_mo->name,
+ (unsigned long) imm_expr.X_add_number);
+ INSERT_OPERAND (3BITPOS, *ip, imm_expr.X_add_number);
+ imm_expr.X_op = O_absent;
+ s = expr_end;
+ continue;
+
case ',':
++argnum;
if (*s++ == *args)
@@ -10978,6 +11044,33 @@ do_msbd:
s = expr_end;
continue;
+ case '~': /* 12-bit offset */
+ {
+ int i;
+ /* Check whether there is only a single bracketed expression
+ left. If so, it must be the base register and the
+ constant must be zero. */
+ if (*s == '(' && strchr (s + 1, '(') == 0)
+ continue;
+
+ /* If this value won't fit into a 12 bit offset, then go
+ find a macro that will generate the 32 bit offset
+ code pattern. */
+ i = my_getSmallExpression (&imm_expr, imm_reloc, s);
+ if ((i == 0 && (imm_expr.X_op != O_constant
+ || imm_expr.X_add_number >= 0x800
+ || imm_expr.X_add_number < -0x800))
+ || i > 0)
+ {
+ imm_expr.X_op = O_absent;
+ break;
+ }
+ INSERT_OPERAND (OFFSET12, *ip, imm_expr.X_add_number);
+ imm_expr.X_op = O_absent;
+ s = expr_end;
+ continue;
+ }
+
case 'p': /* pc relative offset */
*offset_reloc = BFD_RELOC_16_PCREL_S2;
my_getExpression (&offset_expr, s);
@@ -12227,6 +12320,8 @@ enum options
OPTION_NO_DSPR2,
OPTION_MICROMIPS,
OPTION_NO_MICROMIPS,
+ OPTION_MCU,
+ OPTION_NO_MCU,
OPTION_COMPAT_ARCH_BASE,
OPTION_M4650,
OPTION_NO_M4650,
@@ -12319,6 +12414,8 @@ struct option md_longopts[] =
{"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2},
{"mmicromips", no_argument, NULL, OPTION_MICROMIPS},
{"mno-micromips", no_argument, NULL, OPTION_NO_MICROMIPS},
+ {"mmcu", no_argument, NULL, OPTION_MCU},
+ {"mno-mcu", no_argument, NULL, OPTION_NO_MCU},
/* Old-style architecture options. Don't add more of these. */
{"m4650", no_argument, NULL, OPTION_M4650},
@@ -12571,6 +12668,14 @@ md_parse_option (int c, char *arg)
mips_opts.ase_mt = 0;
break;
+ case OPTION_MCU:
+ mips_opts.ase_mcu = 1;
+ break;
+
+ case OPTION_NO_MCU:
+ mips_opts.ase_mcu = 0;
+ break;
+
case OPTION_MICROMIPS:
if (mips_opts.mips16 == 1)
{
@@ -13062,6 +13167,12 @@ mips_after_parse_args (void)
as_warn (_("%s ISA does not support MT ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
+ if (mips_opts.ase_mcu == -1)
+ mips_opts.ase_mcu = (arch_info->flags & MIPS_CPU_ASE_MCU) ? 1 : 0;
+ if (mips_opts.ase_mcu && !ISA_SUPPORTS_MCU_ASE)
+ as_warn ("%s ISA does not support MCU ASE",
+ mips_cpu_info_from_isa (mips_opts.isa)->name);
+
file_mips_isa = mips_opts.isa;
file_ase_mips16 = mips_opts.mips16;
file_ase_micromips = mips_opts.micromips;
@@ -14097,6 +14208,10 @@ s_mipsset (int x ATTRIBUTE_UNUSED)
}
else if (strcmp (name, "nomt") == 0)
mips_opts.ase_mt = 0;
+ else if (strcmp (name, "mcu") == 0)
+ mips_opts.ase_mcu = 1;
+ else if (strcmp (name, "nomcu") == 0)
+ mips_opts.ase_mcu = 0;
else if (strncmp (name, "mips", 4) == 0 || strncmp (name, "arch=", 5) == 0)
{
int reset = 0;
@@ -17252,6 +17367,9 @@ MIPS options:\n\
-mmt generate MT instructions\n\
-mno-mt do not generate MT instructions\n"));
fprintf (stream, _("\
+-mmcu generate MCU instructions\n\
+-mno-mcu do not generate MCU instructions\n"));
+ fprintf (stream, _("\
-mfix-loongson2f-jump work around Loongson2F JUMP instructions\n\
-mfix-loongson2f-nop work around Loongson2F NOP errata\n\
-mfix-vr4120 work around certain VR4120 errata\n\
@@ -17707,6 +17825,19 @@ micromips_ip (char *str, struct mips_cl_
s = expr_end;
continue;
+ case '\\': /* 3-bit bit position. */
+ my_getExpression (&imm_expr, s);
+ check_absolute_expr (ip, &imm_expr);
+ if ((unsigned long) imm_expr.X_add_number
+ > MICROMIPSOP_MASK_3BITPOS)
+ as_bad (_("Bit position for %s not in range 0..7 (%lu)"),
+ ip->insn_mo->name,
+ (unsigned long) imm_expr.X_add_number);
+ MICROMIPS_INSERT_OPERAND (3BITPOS, *ip, imm_expr.X_add_number);
+ imm_expr.X_op = O_absent;
+ s = expr_end;
+ continue;
+
case '|': /* 10-bit lower break code */
my_getExpression (&imm_expr, s);
check_absolute_expr (ip, &imm_expr);
@@ -19538,6 +19669,10 @@ micromips_macro_build (expressionS *ep,
va_arg (*args, unsigned long));
continue;
+ case '\\':
+ MICROMIPS_INSERT_OPERAND (3BITPOS, insn, va_arg (*args, int));
+ continue;
+
case 'q':
MICROMIPS_INSERT_OPERAND (TRAP, insn, va_arg (*args, int));
continue;
@@ -21932,6 +22067,18 @@ micromips_macro (struct mips_cl_insn *ip
s = "swm";
fmt = "n,~(b)";
goto all_mem_op;
+ case M_ACLR_AB:
+ is_ab = 1;
+ case M_ACLR_OB:
+ s = "aclr";
+ fmt = "\\,~(b)";
+ goto all_mem_op;
+ case M_ASET_AB:
+ is_ab = 1;
+ case M_ASET_OB:
+ s = "aset";
+ fmt = "\\,~(b)";
+ goto all_mem_op;
case M_LDL_AB:
is_ab = 1;
case M_LDL_OB:
Index: binutils-fsf-trunk-quilt/gas/doc/as.texinfo
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/doc/as.texinfo 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/doc/as.texinfo 2010-07-26 02:37:09.000000000 +0100
@@ -398,6 +398,7 @@ gcc(1), ld(1), and the Info entries for
[@b{-mdsp}] [@b{-mno-dsp}]
[@b{-mdspr2}] [@b{-mno-dspr2}]
[@b{-mmt}] [@b{-mno-mt}]
+ [@b{-mmcu}] [@b{-mno-mcu}]
[@b{-mfix7000}] [@b{-mno-fix7000}]
[@b{-mfix-vr4120}] [@b{-mno-fix-vr4120}]
[@b{-mfix-vr4130}] [@b{-mno-fix-vr4130}]
@@ -1145,6 +1146,12 @@ Generate code for the MT Application Spe
This tells the assembler to accept MT instructions.
@samp{-mno-mt} turns off this option.
+@item -mmcu
+@itemx -mno-mcu
+Generate code for the MCU Application Specific Extension.
+This tells the assembler to accept MCU instructions.
+@samp{-mno-mcu} turns off this option.
+
@item --construct-floats
@itemx --no-construct-floats
The @samp{--no-construct-floats} option disables the construction of
Index: binutils-fsf-trunk-quilt/gas/doc/c-mips.texi
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/doc/c-mips.texi 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/doc/c-mips.texi 2010-07-26 02:37:09.000000000 +0100
@@ -174,6 +174,12 @@ Generate code for the MT Application Spe
This tells the assembler to accept MT instructions.
@samp{-mno-mt} turns off this option.
+@item -mmcu
+@itemx -mno-mcu
+Generate code for the MCU Application Specific Extension.
+This tells the assembler to accept MCU instructions.
+@samp{-mno-mcu} turns off this option.
+
@item -mfix7000
@itemx -mno-fix7000
Cause nops to be inserted if the read of the destination register
@@ -655,6 +661,14 @@ from the MT Application Specific Extensi
in the assembly. The @code{.set nomt} directive prevents MT
instructions from being accepted.
+@cindex MIPS MCU instruction generation override
+@kindex @code{.set mcu}
+@kindex @code{.set nomcu}
+The directive @code{.set mcu} makes the assembler accept instructions
+from the MCU Application Specific Extension from that point on
+in the assembly. The @code{.set nomcu} directive prevents MCU
+instructions from being accepted.
+
Traditional @sc{mips} assemblers do not support these directives.
@node MIPS floating-point
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mcu.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mcu.d 2010-07-26 02:37:09.000000000 +0100
@@ -0,0 +1,128 @@
+#objdump: -dr --show-raw-insn
+#name: MCU for MIPS32r2
+#as: -32
+#source: mcu.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+[ 0-9a-f]+: 42000038 iret
+[ 0-9a-f]+: 04070000 aclr 0x0,0\(zero\)
+[ 0-9a-f]+: 04070000 aclr 0x0,0\(zero\)
+[ 0-9a-f]+: 04070000 aclr 0x0,0\(zero\)
+[ 0-9a-f]+: 04071000 aclr 0x1,0\(zero\)
+[ 0-9a-f]+: 04072000 aclr 0x2,0\(zero\)
+[ 0-9a-f]+: 04073000 aclr 0x3,0\(zero\)
+[ 0-9a-f]+: 04074000 aclr 0x4,0\(zero\)
+[ 0-9a-f]+: 04075000 aclr 0x5,0\(zero\)
+[ 0-9a-f]+: 04076000 aclr 0x6,0\(zero\)
+[ 0-9a-f]+: 04077000 aclr 0x7,0\(zero\)
+[ 0-9a-f]+: 04477000 aclr 0x7,0\(v0\)
+[ 0-9a-f]+: 07e77000 aclr 0x7,0\(ra\)
+[ 0-9a-f]+: 07e777ff aclr 0x7,2047\(ra\)
+[ 0-9a-f]+: 07e77800 aclr 0x7,-2048\(ra\)
+[ 0-9a-f]+: 24010800 li at,2048
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 2401f7ff li at,-2049
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 24017fff li at,32767
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 24018000 li at,-32768
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 3401ffff li at,0xffff
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 3c010001 lui at,0x1
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 3c01ffff lui at,0xffff
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 24018000 li at,-32768
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 3c01ffff lui at,0xffff
+[ 0-9a-f]+: 34210001 ori at,at,0x1
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 24018001 li at,-32767
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 3c01f000 lui at,0xf000
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 2401ffff li at,-1
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 3c011234 lui at,0x1234
+[ 0-9a-f]+: 34215678 ori at,at,0x5678
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 24610000 addiu at,v1,0
+[ ]*[0-9a-f]+: R_MIPS_LO16 foo
+[ 0-9a-f]+: 04270000 aclr 0x0,0\(at\)
+[ 0-9a-f]+: 24610000 addiu at,v1,0
+[ ]*[0-9a-f]+: R_MIPS_LO16 foo
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 04078000 aset 0x0,0\(zero\)
+[ 0-9a-f]+: 04078000 aset 0x0,0\(zero\)
+[ 0-9a-f]+: 04078000 aset 0x0,0\(zero\)
+[ 0-9a-f]+: 04079000 aset 0x1,0\(zero\)
+[ 0-9a-f]+: 0407a000 aset 0x2,0\(zero\)
+[ 0-9a-f]+: 0407b000 aset 0x3,0\(zero\)
+[ 0-9a-f]+: 0407c000 aset 0x4,0\(zero\)
+[ 0-9a-f]+: 0407d000 aset 0x5,0\(zero\)
+[ 0-9a-f]+: 0407e000 aset 0x6,0\(zero\)
+[ 0-9a-f]+: 0407f000 aset 0x7,0\(zero\)
+[ 0-9a-f]+: 0447f000 aset 0x7,0\(v0\)
+[ 0-9a-f]+: 07e7f000 aset 0x7,0\(ra\)
+[ 0-9a-f]+: 07e7f7ff aset 0x7,2047\(ra\)
+[ 0-9a-f]+: 07e7f800 aset 0x7,-2048\(ra\)
+[ 0-9a-f]+: 24010800 li at,2048
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 2401f7ff li at,-2049
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 24017fff li at,32767
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 24018000 li at,-32768
+[ 0-9a-f]+: 003f0821 addu at,at,ra
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 3401ffff li at,0xffff
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 3c010001 lui at,0x1
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 3c01ffff lui at,0xffff
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 24018000 li at,-32768
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 3c01ffff lui at,0xffff
+[ 0-9a-f]+: 34210001 ori at,at,0x1
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 24018001 li at,-32767
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 3c01f000 lui at,0xf000
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 2401ffff li at,-1
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+[ 0-9a-f]+: 3c011234 lui at,0x1234
+[ 0-9a-f]+: 34215678 ori at,at,0x5678
+[ 0-9a-f]+: 00240821 addu at,at,a0
+[ 0-9a-f]+: 04278000 aset 0x0,0\(at\)
+ \.\.\.
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mcu.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mcu.s 2010-07-26 02:37:09.000000000 +0100
@@ -0,0 +1,69 @@
+ .text
+ .set mcu
+ .ent foo
+ .globl foo
+foo:
+ iret
+
+ aclr 0, 0
+ aclr 0, ($0)
+ aclr 0, 0($0)
+ aclr 1, 0($0)
+ aclr 2, 0($0)
+ aclr 3, 0($0)
+ aclr 4, 0($0)
+ aclr 5, 0($0)
+ aclr 6, 0($0)
+ aclr 7, 0($0)
+ aclr 7, 0($2)
+ aclr 7, 0($31)
+ aclr 7, 2047($31)
+ aclr 7, -2048($31)
+ aclr 7, 2048($31)
+ aclr 7, -2049($31)
+ aclr 7, 32767($31)
+ aclr 7, -32768($31)
+ aclr 7, 65535($4)
+ aclr 7, 65536($4)
+ aclr 7, 0xffff0000($4)
+ aclr 7, 0xffff8000($4)
+ aclr 7, 0xffff0001($4)
+ aclr 7, 0xffff8001($4)
+ aclr 7, 0xf0000000($4)
+ aclr 7, 0xffffffff($4)
+ aclr 7, 0x12345678($4)
+
+ aclr 1, %lo(foo)($3)
+ aset 1, %lo(foo)($3)
+
+ aset 0, 0
+ aset 0, ($0)
+ aset 0, 0($0)
+ aset 1, 0($0)
+ aset 2, 0($0)
+ aset 3, 0($0)
+ aset 4, 0($0)
+ aset 5, 0($0)
+ aset 6, 0($0)
+ aset 7, 0($0)
+ aset 7, 0($2)
+ aset 7, 0($31)
+ aset 7, 2047($31)
+ aset 7, -2048($31)
+ aset 7, 2048($31)
+ aset 7, -2049($31)
+ aset 7, 32767($31)
+ aset 7, -32768($31)
+ aset 7, 65535($4)
+ aset 7, 65536($4)
+ aset 7, 0xffff0000($4)
+ aset 7, 0xffff8000($4)
+ aset 7, 0xffff0001($4)
+ aset 7, 0xffff8001($4)
+ aset 7, 0xf0000000($4)
+ aset 7, 0xffffffff($4)
+ aset 7, 0x12345678($4)
+ .end foo
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/micromips@mcu.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/micromips@mcu.d 2010-07-26 02:37:09.000000000 +0100
@@ -0,0 +1,128 @@
+#objdump: -dr --show-raw-insn
+#name: MCU for MIPS32r2
+#as: -32
+#source: mcu.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+[ 0-9a-f]+: 0000 d37c iret
+[ 0-9a-f]+: 2000 b000 aclr 0x0,0\(zero\)
+[ 0-9a-f]+: 2000 b000 aclr 0x0,0\(zero\)
+[ 0-9a-f]+: 2000 b000 aclr 0x0,0\(zero\)
+[ 0-9a-f]+: 2020 b000 aclr 0x1,0\(zero\)
+[ 0-9a-f]+: 2040 b000 aclr 0x2,0\(zero\)
+[ 0-9a-f]+: 2060 b000 aclr 0x3,0\(zero\)
+[ 0-9a-f]+: 2080 b000 aclr 0x4,0\(zero\)
+[ 0-9a-f]+: 20a0 b000 aclr 0x5,0\(zero\)
+[ 0-9a-f]+: 20c0 b000 aclr 0x6,0\(zero\)
+[ 0-9a-f]+: 20e0 b000 aclr 0x7,0\(zero\)
+[ 0-9a-f]+: 20e2 b000 aclr 0x7,0\(v0\)
+[ 0-9a-f]+: 20ff b000 aclr 0x7,0\(ra\)
+[ 0-9a-f]+: 20ff b7ff aclr 0x7,2047\(ra\)
+[ 0-9a-f]+: 20ff b800 aclr 0x7,-2048\(ra\)
+[ 0-9a-f]+: 3020 0800 li at,2048
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3020 f7ff li at,-2049
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3020 7fff li at,32767
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3020 8000 li at,-32768
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 5020 ffff li at,0xffff
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 0001 lui at,0x1
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 ffff lui at,0xffff
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3020 8000 li at,-32768
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 ffff lui at,0xffff
+[ 0-9a-f]+: 5021 0001 ori at,at,0x1
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3020 8001 li at,-32767
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 f000 lui at,0xf000
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3020 ffff li at,-1
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 1234 lui at,0x1234
+[ 0-9a-f]+: 5021 5678 ori at,at,0x5678
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 b000 aclr 0x7,0\(at\)
+[ 0-9a-f]+: 3023 0000 addiu at,v1,0
+[ ]*[0-9a-f]+: R_MICROMIPS_LO16 foo
+[ 0-9a-f]+: 2021 b000 aclr 0x1,0\(at\)
+[ 0-9a-f]+: 3023 0000 addiu at,v1,0
+[ ]*[0-9a-f]+: R_MICROMIPS_LO16 foo
+[ 0-9a-f]+: 2021 3000 aset 0x1,0\(at\)
+[ 0-9a-f]+: 2000 3000 aset 0x0,0\(zero\)
+[ 0-9a-f]+: 2000 3000 aset 0x0,0\(zero\)
+[ 0-9a-f]+: 2000 3000 aset 0x0,0\(zero\)
+[ 0-9a-f]+: 2020 3000 aset 0x1,0\(zero\)
+[ 0-9a-f]+: 2040 3000 aset 0x2,0\(zero\)
+[ 0-9a-f]+: 2060 3000 aset 0x3,0\(zero\)
+[ 0-9a-f]+: 2080 3000 aset 0x4,0\(zero\)
+[ 0-9a-f]+: 20a0 3000 aset 0x5,0\(zero\)
+[ 0-9a-f]+: 20c0 3000 aset 0x6,0\(zero\)
+[ 0-9a-f]+: 20e0 3000 aset 0x7,0\(zero\)
+[ 0-9a-f]+: 20e2 3000 aset 0x7,0\(v0\)
+[ 0-9a-f]+: 20ff 3000 aset 0x7,0\(ra\)
+[ 0-9a-f]+: 20ff 37ff aset 0x7,2047\(ra\)
+[ 0-9a-f]+: 20ff 3800 aset 0x7,-2048\(ra\)
+[ 0-9a-f]+: 3020 0800 li at,2048
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 3020 f7ff li at,-2049
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 3020 7fff li at,32767
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 3020 8000 li at,-32768
+[ 0-9a-f]+: 03e1 0950 addu at,at,ra
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 5020 ffff li at,0xffff
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 0001 lui at,0x1
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 ffff lui at,0xffff
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 3020 8000 li at,-32768
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 ffff lui at,0xffff
+[ 0-9a-f]+: 5021 0001 ori at,at,0x1
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 3020 8001 li at,-32767
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 f000 lui at,0xf000
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 3020 ffff li at,-1
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+[ 0-9a-f]+: 41a1 1234 lui at,0x1234
+[ 0-9a-f]+: 5021 5678 ori at,at,0x5678
+[ 0-9a-f]+: 0081 0950 addu at,at,a0
+[ 0-9a-f]+: 20e1 3000 aset 0x7,0\(at\)
+ \.\.\.
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mips.exp
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/testsuite/gas/mips/mips.exp 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mips.exp 2010-07-26 02:37:09.000000000 +0100
@@ -906,4 +906,7 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "micromips-branch-relax-pic"
run_dump_test "micromips-branch-delay"
}
+
+ run_dump_test_arches "mcu" [mips_arch_list_matching mips32r2 \
+ !octeon]
}
Index: binutils-fsf-trunk-quilt/include/opcode/mips.h
===================================================================
--- binutils-fsf-trunk-quilt.orig/include/opcode/mips.h 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/include/opcode/mips.h 2010-07-26 02:37:09.000000000 +0100
@@ -183,6 +183,12 @@
#define OP_SH_MTACC_D 13
#define OP_MASK_MTACC_D 0x3
+/* MIPS MCU ASE */
+#define OP_MASK_3BITPOS 0x7
+#define OP_SH_3BITPOS 12
+#define OP_MASK_OFFSET12 0xfff
+#define OP_SH_OFFSET12 0
+
#define OP_OP_COP0 0x10
#define OP_OP_COP1 0x11
#define OP_OP_COP2 0x12
@@ -376,6 +382,10 @@ struct mips_opcode
"+t" 5 bit coprocessor 0 destination register (OP_*_RT)
"+T" 5 bit coprocessor 0 destination register (OP_*_RT) - disassembly only
+ MCU ASE usage:
+ "~" 12 bit offset (OP_*_OFFSET12)
+ "\" 3 bit position for aset and aclr (OP_*_3BITPOS)
+
UDI immediates:
"+1" UDI immediate bits 6-10
"+2" UDI immediate bits 6-15
@@ -404,7 +414,7 @@ struct mips_opcode
Characters used so far, for quick reference when adding more:
"1234567890"
- "%[]<>(),+:'@!$*&"
+ "%[]<>(),+:'@!$*&\~"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklopqrstuvwxz"
@@ -595,7 +605,7 @@ static const unsigned int mips_isa_table
#define INSN_OCTEON 0x00000800
/* Masks used for MIPS-defined ASEs. */
-#define INSN_ASE_MASK 0x3c00f000
+#define INSN_ASE_MASK 0x3c00f010
/* DSP ASE */
#define INSN_DSP 0x00001000
@@ -642,6 +652,9 @@ static const unsigned int mips_isa_table
/* RMI Xlr instruction */
#define INSN_XLR 0x00000020
+/* MCU (MicroController) ASE */
+#define INSN_MCU 0x00000010
+
/* MIPS ISA defines, use instead of hardcoding ISA level. */
#define ISA_UNKNOWN 0 /* Gas internal use. */
@@ -741,9 +754,13 @@ static const unsigned int mips_isa_table
enum
{
M_ABS,
+ M_ACLR_AB,
+ M_ACLR_OB,
M_ADD_I,
M_ADDU_I,
M_AND_I,
+ M_ASET_AB,
+ M_ASET_OB,
M_BALIGN,
M_BC1FL,
M_BC1TL,
@@ -1237,6 +1254,8 @@ extern const int bfd_mips16_num_opcodes;
#define MICROMIPSOP_SH_COPSEL 11
#define MICROMIPSOP_MASK_OFFSET12 0xfff
#define MICROMIPSOP_SH_OFFSET12 0
+#define MICROMIPSOP_MASK_3BITPOS 0x7
+#define MICROMIPSOP_SH_3BITPOS 21
#define MICROMIPSOP_MASK_STYPE 0x1f
#define MICROMIPSOP_SH_STYPE 16
#define MICROMIPSOP_MASK_OFFSET10 0x3ff
@@ -1402,6 +1421,7 @@ extern const int bfd_mips16_num_opcodes;
"<" 5-bit shift amount (MICROMIPSOP_*_SHAMT)
">" shift amount between 32 and 63, stored after subtracting 32
(MICROMIPSOP_*_SHAMT)
+ "\" 3-bit position for ASET and ACLR (MICROMIPSOP_*_3BITPOS)
"|" 10-bit lower breakpoint code (MICROMIPSOP_*_BREAKCODE2)
"~" 12-bit signed offset (MICROMIPSOP_*_OFFSET12)
"a" 26-bit target address (MICROMIPSOP_*_TARGET)
@@ -1491,7 +1511,7 @@ extern const int bfd_mips16_num_opcodes;
Characters used so far, for quick reference when adding more:
"1234567890"
- "<>(),+.|~"
+ "<>(),+.\|~"
"ABCDEFGHIJKLMN RST V "
"abcd f hijklmnopqrstuvw z"
Index: binutils-fsf-trunk-quilt/opcodes/micromips-opc.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/opcodes/micromips-opc.c 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/opcodes/micromips-opc.c 2010-07-26 02:37:09.000000000 +0100
@@ -93,6 +93,9 @@
#define I1 INSN_ISA1
#define I3 INSN_ISA3
+/* MIPS MCU (MicroController) ASE support. */
+#define MC INSN_MCU
+
const struct mips_opcode micromips_opcodes[] =
{
/* These instructions appear first so that the disassembler will find
@@ -127,6 +130,9 @@ const struct mips_opcode micromips_opcod
{"abs.d", "T,V", 0x5400237b, 0xfc00ffff, WR_T|RD_S|FP_D, 0, I1 },
{"abs.s", "T,V", 0x5400037b, 0xfc00ffff, WR_T|RD_S|FP_S, 0, I1 },
{"abs.ps", "T,V", 0x5400437b, 0xfc00ffff, WR_T|RD_S|FP_D, 0, I1 },
+{"aclr", "\\,~(b)", 0x2000b000, 0xff00f000, SM|RD_b, 0, MC },
+{"aclr", "\\,o(b)", 0, (int) M_ACLR_OB, INSN_MACRO, 0, MC },
+{"aclr", "\\,A(b)", 0, (int) M_ACLR_AB, INSN_MACRO, 0, MC },
{"add", "d,v,t", 0x00000110, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
{"add", "t,r,I", 0, (int) M_ADD_I, INSN_MACRO, 0, I1 },
{"add.d", "D,V,T", 0x54000130, 0xfc0007ff, WR_D|RD_S|RD_T|FP_D, 0, I1 },
@@ -157,6 +163,9 @@ const struct mips_opcode micromips_opcod
{"and", "t,r,I", 0, (int) M_AND_I, INSN_MACRO, 0, I1 },
{"andi", "md,mc,mC", 0x2c00, 0xfc00, 0, MOD_md|MOD_mc, I1 },
{"andi", "t,r,i", 0xd0000000, 0xfc000000, WR_t|RD_s, 0, I1 },
+{"aset", "\\,~(b)", 0x20003000, 0xff00f000, SM|RD_b, 0, MC },
+{"aset", "\\,o(b)", 0, (int) M_ASET_OB, INSN_MACRO, 0, MC },
+{"aset", "\\,A(b)", 0, (int) M_ASET_AB, INSN_MACRO, 0, MC },
/* b is at the top of the table. */
/* bal is at the top of the table. */
{"bc1f", "p", 0x43800000, 0xffff0000, CBD|RD_CC|FP_S, 0, I1 },
@@ -495,6 +504,7 @@ const struct mips_opcode micromips_opcod
{"floor.w.d","T,V", 0x54004b3b, 0xfc00ffff, WR_T|RD_S|FP_S|FP_D, 0, I1 },
{"floor.w.s","T,V", 0x54000b3b, 0xfc00ffff, WR_T|RD_S|FP_S, 0, I1 },
{"ins", "t,r,+A,+B", 0x0000000c, 0xfc00003f, WR_t|RD_s, 0, I1 },
+{"iret", "", 0x0000d37c, 0xffffffff, 0, 0, MC },
{"jr", "mj", 0x4580, 0xffe0, UBD, MOD_mj, I1 },
{"jr", "s", 0x00000f3c, 0xffe0ffff, UBD|RD_s, BD32, I1 }, /* jalr */
{"jrs", "s", 0x00004f3c, 0xffe0ffff, UBD|RD_s, BD16, I1 }, /* jalrs */
Index: binutils-fsf-trunk-quilt/opcodes/mips-dis.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/opcodes/mips-dis.c 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/opcodes/mips-dis.c 2010-07-26 02:37:09.000000000 +0100
@@ -564,7 +564,7 @@ const struct mips_arch_choice mips_arch_
{ "mips32r2", 1, bfd_mach_mipsisa32r2, CPU_MIPS32R2,
(ISA_MIPS32R2 | INSN_SMARTMIPS | INSN_DSP | INSN_DSPR2
- | INSN_MIPS3D | INSN_MT),
+ | INSN_MIPS3D | INSN_MT | INSN_MCU),
mips_cp0_names_mips3264r2,
mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
mips_hwr_names_mips3264r2 },
@@ -578,7 +578,7 @@ const struct mips_arch_choice mips_arch_
{ "mips64r2", 1, bfd_mach_mipsisa64r2, CPU_MIPS64R2,
(ISA_MIPS64R2 | INSN_MIPS3D | INSN_DSP | INSN_DSPR2
- | INSN_DSP64 | INSN_MT | INSN_MDMX),
+ | INSN_DSP64 | INSN_MT | INSN_MDMX | INSN_MCU),
mips_cp0_names_mips3264r2,
mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
mips_hwr_names_mips3264r2 },
@@ -1117,6 +1117,18 @@ print_insn_args (const char *d,
(*info->fprintf_func) (info->stream, "%d", delta);
break;
+ case '~':
+ delta = (l >> OP_SH_OFFSET12) & OP_MASK_OFFSET12;
+ if (delta & 0x800)
+ delta |= ~0x7ff;
+ (*info->fprintf_func) (info->stream, "%d", delta);
+ break;
+
+ case '\\':
+ (*info->fprintf_func) (info->stream, "0x%lx",
+ (l >> OP_SH_3BITPOS) & OP_MASK_3BITPOS);
+ break;
+
case '\'':
(*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_RDDSP) & OP_MASK_RDDSP);
@@ -2335,6 +2347,10 @@ print_insn_micromips (bfd_vma memaddr, s
iprintf (is, "0x%lx", GET_OP (insn, SHAMT));
break;
+ case '\\':
+ iprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
+ break;
+
case '|':
iprintf (is, "0x%lx", GET_OP (insn, BREAKCODE2));
break;
Index: binutils-fsf-trunk-quilt/opcodes/mips-opc.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/opcodes/mips-opc.c 2010-07-26 02:23:50.000000000 +0100
+++ binutils-fsf-trunk-quilt/opcodes/mips-opc.c 2010-07-26 02:37:09.000000000 +0100
@@ -163,6 +163,9 @@
/* MIPS MT ASE support. */
#define MT32 INSN_MT
+/* MIPS MCU (MicroController) ASE support. */
+#define MC INSN_MCU
+
/* The order of overloaded instructions matters. Label arguments and
register arguments look the same. Instructions that can have either
for arguments must apear in the correct order in this table for the
@@ -203,6 +206,9 @@ const struct mips_opcode mips_builtin_op
{"abs.d", "D,V", 0x46200005, 0xffff003f, WR_D|RD_S|FP_D, 0, I1 },
{"abs.ps", "D,V", 0x46c00005, 0xffff003f, WR_D|RD_S|FP_D, 0, I5_33|IL2F },
{"abs.ps", "D,V", 0x45600005, 0xffff003f, WR_D|RD_S|FP_D, 0, IL2E },
+{"aclr", "\\,~(b)", 0x04070000, 0xfc1f8000, LDD|SM|RD_b, 0, MC },
+{"aclr", "\\,o(b)", 0, (int) M_ACLR_OB, INSN_MACRO, 0, MC },
+{"aclr", "\\,A(b)", 0, (int) M_ACLR_AB, INSN_MACRO, 0, MC },
{"add", "d,v,t", 0x00000020, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
{"add", "t,r,I", 0, (int) M_ADD_I, INSN_MACRO, 0, I1 },
{"add", "D,S,T", 0x45c00000, 0xffe0003f, RD_S|RD_T|WR_D|FP_S, 0, IL2E },
@@ -243,6 +249,9 @@ const struct mips_opcode mips_builtin_op
{"and.ob", "D,S,k", 0x4bc0000c, 0xffe0003f, WR_D|RD_S|RD_T, 0, N54 },
{"and.qh", "X,Y,Q", 0x7820000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
{"andi", "t,r,i", 0x30000000, 0xfc000000, WR_t|RD_s, 0, I1 },
+{"aset", "\\,~(b)", 0x04078000, 0xfc1f8000, LDD|SM|RD_b, 0, MC },
+{"aset", "\\,o(b)", 0, (int) M_ASET_OB, INSN_MACRO, 0, MC },
+{"aset", "\\,A(b)", 0, (int) M_ASET_AB, INSN_MACRO, 0, MC },
{"baddu", "d,v,t", 0x70000028, 0xfc0007ff, WR_d|RD_s|RD_t, 0, IOCT },
/* b is at the top of the table. */
/* bal is at the top of the table. */
@@ -709,6 +718,7 @@ const struct mips_opcode mips_builtin_op
{"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
{"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 },
{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 },
+{"iret", "", 0x42000038, 0xffffffff, 0, 0, MC },
{"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 },
/* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with
the same hazard barrier effect. */