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.
This commit is contained in:
Richard Sandiford 2013-08-06 19:27:07 +00:00
parent fdd57b168c
commit ee5734f078
9 changed files with 47 additions and 11 deletions

View file

@ -1,3 +1,11 @@
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.
2013-08-05 John Tytgat <john@bass-software.com>
* po/POTFILES.in: Regenerate.

View file

@ -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)

View file

@ -1,3 +1,9 @@
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.
2013-08-04 Jürgen Urban <JuergenUrban@gmx.de>
* gas/mips/r5900-vu0.d: Expect $vfN and $viN instead of numeric

View file

@ -71,7 +71,6 @@
.*: Error: Illegal operands `vaddaz\.xy \$ACCxyz,\$vf0xy,\$vf31z'
.*: Error: Illegal operands `vaddaz\.y \$ACCx,\$vf31y,\$vf0z'
.*: Error: Illegal operands `vaddaz\.yw \$ACCyw,\$vf0yw,\$a0'
.*: Error: Illegal operands `vaddaz\.yw \$ACC,\$0,\$31'
.*: Error: Illegal operands `vaddi\.w \$vf0w,\$vf31w,\$Q'
.*: Error: Illegal operands `vaddi\.w \$vf1w,\$vf2w,\$R'
.*: Error: Illegal operands `vaddi\.w \$vf31w,\$vf0w,\$ACC'
@ -637,7 +636,6 @@
.*: Error: Illegal operands `vsubax\.w \$ACCx,\$vf31x,\$vf0x'
.*: Error: Illegal operands `vsubax\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf0xyzw'
.*: Error: Illegal operands `vsubax\.xzw \$ACCxzw,\$vf1xzw,\$vf2xzw'
.*: Error: Illegal operands `vsubax\.y \$ACCy,\$vf1y,\$vf2'
.*: Error: Illegal operands `vsubax\.y \$ACCy,\$vf31y,\$vf0y'
.*: Error: Illegal operands `vsubax\.yw \$ACCyw,\$vf0yw,\$vf0yw'
.*: Error: Illegal operands `vsubay\.yw \$ACCyw,\$vf0yw,\$vf31yw'

View file

@ -77,7 +77,6 @@ text_label:
vaddaz.xy $ACCxyz, $vf0xy, $vf31z
vaddaz.y $ACCx, $vf31y, $vf0z
vaddaz.yw $ACCyw, $vf0yw, $a0
vaddaz.yw $ACC, $0, $31
vaddi.w $vf0w, $vf31w, $Q
vaddi.w $vf1w, $vf2w, $R
vaddi.w $vf31w, $vf0w, $ACC
@ -641,7 +640,6 @@ text_label:
vsubax.w $ACCx, $vf31x, $vf0x
vsubax.xyzw $ACCxyzw, $vf31xyzw, $vf0xyzw
vsubax.xzw $ACCxzw, $vf1xzw, $vf2xzw
vsubax.y $ACCy, $vf1y, $vf2
vsubax.y $ACCy, $vf31y, $vf0y
vsubax.yw $ACCyw, $vf0yw, $vf0yw
vsubay.yw $ACCyw, $vf0yw, $vf31yw

View file

@ -25,6 +25,7 @@ Disassembly of section \.text:
[0-9a-f]+ <[^>]*> 4a007ff8 vcallms 0xff8
[0-9a-f]+ <[^>]*> 4a00d839 vcallmsr \$vi27
[0-9a-f]+ <[^>]*> 4bc1f9ff vclipw\.xyz \$vf31xyz,\$vf1w
[0-9a-f]+ <[^>]*> 4bc1f9ff vclipw\.xyz \$vf31xyz,\$vf1w
[0-9a-f]+ <[^>]*> 4a2b0bbc vdiv \$Q,\$vf1y,\$vf11x
[0-9a-f]+ <[^>]*> 4be0f97c vftoi0\.xyzw \$vf0xyzw,\$vf31xyzw
[0-9a-f]+ <[^>]*> 4be0f97d vftoi4\.xyzw \$vf0xyzw,\$vf31xyzw
@ -56,12 +57,15 @@ Disassembly of section \.text:
[0-9a-f]+ <[^>]*> 4be1fa88 vmaddx\.xyzw \$vf10xyzw,\$vf31xyzw,\$vf1x
[0-9a-f]+ <[^>]*> 4be1fa89 vmaddy\.xyzw \$vf10xyzw,\$vf31xyzw,\$vf1y
[0-9a-f]+ <[^>]*> 4be1fa8a vmaddz\.xyzw \$vf10xyzw,\$vf31xyzw,\$vf1z
[0-9a-f]+ <[^>]*> 4be5198a vmaddz\.xyzw \$vf6xyzw,\$vf3xyzw,\$vf5z
[0-9a-f]+ <[^>]*> 4be0fabd vmadda\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf0xyzw
[0-9a-f]+ <[^>]*> 4be0fa3f vmaddai\.xyzw \$ACCxyzw,\$vf31xyzw,\$I
[0-9a-f]+ <[^>]*> 4be0fa3d vmaddaq\.xyzw \$ACCxyzw,\$vf31xyzw,\$Q
[0-9a-f]+ <[^>]*> 4be1f8bf vmaddaw\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1w
[0-9a-f]+ <[^>]*> 4be1f8bc vmaddax\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1x
[0-9a-f]+ <[^>]*> 4be508bc vmaddax\.xyzw \$ACCxyzw,\$vf1xyzw,\$vf5x
[0-9a-f]+ <[^>]*> 4be1f8bd vmadday\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1y
[0-9a-f]+ <[^>]*> 4be510bd vmadday\.xyzw \$ACCxyzw,\$vf2xyzw,\$vf5y
[0-9a-f]+ <[^>]*> 4be1f8be vmaddaz\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1z
[0-9a-f]+ <[^>]*> 4be0faab vmax\.xyzw \$vf10xyzw,\$vf31xyzw,\$vf0xyzw
[0-9a-f]+ <[^>]*> 4be0fa9d vmaxi\.xyzw \$vf10xyzw,\$vf31xyzw,\$I
@ -104,6 +108,7 @@ Disassembly of section \.text:
[0-9a-f]+ <[^>]*> 4be0f9fe vmulai\.xyzw \$ACCxyzw,\$vf31xyzw,\$I
[0-9a-f]+ <[^>]*> 4be0f9fc vmulaq\.xyzw \$ACCxyzw,\$vf31xyzw,\$Q
[0-9a-f]+ <[^>]*> 4be1f9bf vmulaw\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1w
[0-9a-f]+ <[^>]*> 4be021bf vmulaw\.xyzw \$ACCxyzw,\$vf4xyzw,\$vf0w
[0-9a-f]+ <[^>]*> 4be1f9bc vmulax\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1x
[0-9a-f]+ <[^>]*> 4be1f9bd vmulay\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1y
[0-9a-f]+ <[^>]*> 4be1f9be vmulaz\.xyzw \$ACCxyzw,\$vf31xyzw,\$vf1z

View file

@ -25,7 +25,8 @@ text_label:
vcallms 0xff8
vcallmsr $vi27
vclipw.xyz $vf31xyz,$vf1w
vdiv $Q,$vf1y,$vf11x
vclipw $vf31xyz,$vf1w
vdiv $Q,$vf1y,$vf11x
vftoi0.xyzw $vf0xyzw,$vf31xyzw
vftoi4.xyzw $vf0xyzw,$vf31xyzw
vftoi12.xyzw $vf0xyzw,$vf31xyzw
@ -56,12 +57,15 @@ text_label:
vmaddx.xyzw $vf10xyzw,$vf31xyzw,$vf1x
vmaddy.xyzw $vf10xyzw,$vf31xyzw,$vf1y
vmaddz.xyzw $vf10xyzw,$vf31xyzw,$vf1z
vmaddz $vf6, $vf3, $vf5
vmadda.xyzw $ACCxyzw,$vf31xyzw,$vf0xyzw
vmaddai.xyzw $ACCxyzw,$vf31xyzw,$I
vmaddaq.xyzw $ACCxyzw,$vf31xyzw,$Q
vmaddaw.xyzw $ACCxyzw,$vf31xyzw,$vf1w
vmaddax.xyzw $ACCxyzw,$vf31xyzw,$vf1x
vmaddax $ACC, $vf1, $vf5
vmadday.xyzw $ACCxyzw,$vf31xyzw,$vf1y
vmadday $ACC, $vf2, $vf5
vmaddaz.xyzw $ACCxyzw,$vf31xyzw,$vf1z
vmax.xyzw $vf10xyzw,$vf31xyzw,$vf0xyzw
vmaxi.xyzw $vf10xyzw,$vf31xyzw,$I
@ -104,6 +108,7 @@ text_label:
vmulai.xyzw $ACCxyzw,$vf31xyzw,$I
vmulaq.xyzw $ACCxyzw,$vf31xyzw,$Q
vmulaw.xyzw $ACCxyzw,$vf31xyzw,$vf1w
vmulaw $ACC, $vf4, $vf0
vmulax.xyzw $ACCxyzw,$vf31xyzw,$vf1x
vmulay.xyzw $ACCxyzw,$vf31xyzw,$vf1y
vmulaz.xyzw $ACCxyzw,$vf31xyzw,$vf1z

View file

@ -1,3 +1,8 @@
2013-08-06 Jürgen Urban <JuergenUrban@gmx.de>
* mips-opc.c (mips_builtin_opcodes): Add a suffixless version of
VCLIPW.
2013-08-05 Eric Botcazou <ebotcazou@adacore.com>
Konrad Eisele <konrad@gaisler.com>

View file

@ -445,6 +445,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
{"vcallms", "+f", 0x4a000038, 0xffe0003f, CP, 0, VU0, 0, 0 },
{"vcallmsr", "+9", 0x4a000039, 0xffff07ff, CP, 0, VU0, 0, 0 },
{"vclipw.xyz", "+6+K,+7+N", 0x4bc001ff, 0xffe007ff, CP, 0, VU0, 0, 0 },
{"vclipw", "+6+K,+7+N", 0x4bc001ff, 0xffe007ff, CP, 0, VU0, 0, 0 },
{"vdiv", "+q,+6+L,+7+M", 0x4a0003bc, 0xfe0007ff, CP, 0, VU0, 0, 0 },
{"vftoi0", "+7+K,+6+K", 0x4a00017c, 0xfe0007ff, CP, VU0CH, VU0, 0, 0 },
{"vftoi4", "+7+K,+6+K", 0x4a00017d, 0xfe0007ff, CP, VU0CH, VU0, 0, 0 },