+2016-12-05 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * testsuite/gas/arc/textauxregister-1.d: New file.
+ * testsuite/gas/arc/textauxregister-1.s: Likewise.
+ * testsuite/gas/arc/textcondcode-err.s: Likewise.
+ * testsuite/gas/arc/textcoreregister-err.s: Likewise.
+ * config/tc-arc.c (tokenize_extregister): Return bfd_boolean,
+ don't check second argument of extension auxiliary register for
+ signess.
+ (arc_extcorereg): Consider the return of tokenize_extregister
+ function call.
+
2016-12-05 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/tc-arm.c (arm_ext_v8_3, do_vjcvt): Define.
create_extinst_section (&einsn);
}
-static void
+static bfd_boolean
tokenize_extregister (extRegister_t *ereg, int opertype)
{
char *name;
if (*input_line_pointer != ',')
{
- as_bad (_("expected comma after register name"));
+ as_bad (_("expected comma after name"));
ignore_rest_of_line ();
free (name);
- return;
+ return FALSE;
}
input_line_pointer++;
number = get_absolute_expression ();
- if (number < 0)
+ if ((number < 0)
+ && (opertype != EXT_AUX_REGISTER))
{
- as_bad (_("negative operand number %d"), number);
+ as_bad (_("%s second argument cannot be a negative number %d"),
+ isCore_p ? "extCoreRegister's" : "extCondCode's",
+ number);
ignore_rest_of_line ();
free (name);
- return;
+ return FALSE;
}
if (isReg_p)
as_bad (_("expected comma after register number"));
ignore_rest_of_line ();
free (name);
- return;
+ return FALSE;
}
input_line_pointer++;
as_bad (_("invalid mode"));
ignore_rest_of_line ();
free (name);
- return;
+ return FALSE;
}
else
{
as_bad (_("expected comma after register mode"));
ignore_rest_of_line ();
free (name);
- return;
+ return FALSE;
}
input_line_pointer++;
as_bad (_("shortcut designator invalid"));
ignore_rest_of_line ();
free (name);
- return;
+ return FALSE;
}
else
{
ereg->name = name;
ereg->number = number;
ereg->imode = imode;
+ return TRUE;
}
/* Create an extension register/condition description in the arc
struct arc_flag_operand *ccode;
memset (&ereg, 0, sizeof (ereg));
- tokenize_extregister (&ereg, opertype);
+ if (!tokenize_extregister (&ereg, opertype))
+ return;
switch (opertype)
{
--- /dev/null
+#objdump: -dr
+
+.*: +file format .*arc.*
+
+
+Disassembly of section .text:
+
+[0-9a-f]+ <.text>:
+\s+0:\s+222a 0f80 8001 8000\s+lr\s+r2,\[myreg1\]
+\s+8:\s+21aa 003c\s+lr\s+r1,\[myreg2\]
--- /dev/null
+ .extAuxRegister myreg1, 0x80018000, r|w
+ .extAuxRegister myreg2, -256, r|w
+
+ lr r2, [myreg1]
+ lr r1, [myreg2]
--- /dev/null
+; { dg-do assemble { target arc*-*-* } }
+ .extCondCode cctst, -12 ; { dg-error "Error: extCondCode's second argument cannot be a negative number -12" }
--- /dev/null
+; { dg-do assemble { target arc*-*-* } }
+ .extCoreRegister r32c, -32, r|w, can_shortcut ; { dg-error "Error: extCoreRegister's second argument cannot be a negative number -32" }