From ac9ab37463a327a97b696c8576bf3eb1054107b1 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 6 Aug 2013 19:27:06 +0000 Subject: =?UTF-8?q?opcodes/=202013-08-06=20=20J=C3=BCrgen=20Urban=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mips-opc.c (mips_builtin_opcodes): Add a suffixless version of VCLIPW. gas/ 2013-08-06 Jürgen Urban * 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 * 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. --- gas/config/tc-mips.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'gas/config') diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 1c79634bb8..f35dbe0784 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) -- cgit v1.2.1