aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-08-06 19:27:07 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2013-08-06 19:27:07 +0000
commitee5734f078f7f09cf57d8e77bc85ffe20891c3b6 (patch)
treee6a9c4de66bd6584aa0a044460fc7fe9c6a2fc5f /gas/config/tc-mips.c
parentfdd57b168c4866442d6779e80ef0b9f6f853465f (diff)
downloadgdb-ee5734f078f7f09cf57d8e77bc85ffe20891c3b6.zip
gdb-ee5734f078f7f09cf57d8e77bc85ffe20891c3b6.tar.gz
gdb-ee5734f078f7f09cf57d8e77bc85ffe20891c3b6.tar.bz2
opcodes/
2013-08-06 Jürgen Urban <JuergenUrban@gmx.de> * mips-opc.c (mips_builtin_opcodes): Add a suffixless version of VCLIPW. gas/ 2013-08-06 Jürgen Urban <JuergenUrban@gmx.de> * config/tc-mips.c (match_vu0_suffix_operand): Allow single-channel suffixes to be elided too. (mips_lookup_insn): Don't reject INSN2_VU0_CHANNEL_SUFFIX here. (mips_ip): Assume .xyzw if no VU0 suffix is specified. Allow +N to be omitted too. gas/testsuite/ 2013-08-06 Jürgen Urban <JuergenUrban@gmx.de> * gas/mips/r5900-error-vu0.s, gas/mips/r5900-error-vu0.l, gas/mips/r5900-full-vu0.s, gas/mips/r5900-full-vu0.d: Allow single-channel suffixes to be elided.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 1c79634..f35dbe0 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -5242,9 +5242,9 @@ match_vu0_suffix_operand (struct mips_arg_info *arg,
(with X being 0). */
gas_assert (operand->size == 2 || operand->size == 4);
- /* The suffix can be omitted when matching a previous 4-bit mask. */
+ /* The suffix can be omitted when it is already part of the opcode. */
if (arg->token->type != OT_CHANNELS)
- return operand->size == 4 && match_p;
+ return match_p;
uval = arg->token->u.channels;
if (operand->size == 2)
@@ -12321,7 +12321,7 @@ mips_lookup_insn (struct hash_control *hash, const char *start,
/* Look up the instruction as-is. */
insn = (struct mips_opcode *) hash_find (hash, name);
- if (insn && (insn->pinfo2 & INSN2_VU0_CHANNEL_SUFFIX) == 0)
+ if (insn)
return insn;
dot = strchr (name, '.');
@@ -12359,7 +12359,7 @@ mips_lookup_insn (struct hash_control *hash, const char *start,
{
memcpy (name + opend - 2, name + opend, length - opend + 1);
insn = (struct mips_opcode *) hash_find (hash, name);
- if (insn && (insn->pinfo2 & INSN2_VU0_CHANNEL_SUFFIX) == 0)
+ if (insn)
{
forced_insn_length = suffix;
return insn;
@@ -12422,6 +12422,9 @@ mips_ip (char *str, struct mips_cl_insn *ip)
insn_error = _("Unrecognized opcode");
return;
}
+ /* When no opcode suffix is specified, assume ".xyzw". */
+ if ((insn->pinfo2 & INSN2_VU0_CHANNEL_SUFFIX) != 0 && opcode_extra == 0)
+ opcode_extra = 0xf << mips_vu0_channel_mask.lsb;
if (strcmp (insn->name, "li.s") == 0)
format = 'f';
@@ -12535,8 +12538,15 @@ mips_ip (char *str, struct mips_cl_insn *ip)
if (strcmp (args, "(b)") == 0)
args += 3;
- if (args[0] == '+' && args[1] == 'K')
- args += 2;
+ if (args[0] == '+')
+ switch (args[1])
+ {
+ case 'K':
+ case 'N':
+ /* The register suffix is optional. */
+ args += 2;
+ break;
+ }
/* Fail the match if there were too few operands. */
if (*args)