diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-12-05 15:09:48 +0100 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2016-12-05 15:16:28 +0100 |
commit | 0691188992efa4afab80bfdf966479bc331ce0a4 (patch) | |
tree | 343ab6c2ccc718858963d6fe801a296ada50a907 /gas | |
parent | 49e8a725825c77aacc7458b9d7771cb2fa2f64c7 (diff) | |
download | fsf-binutils-gdb-0691188992efa4afab80bfdf966479bc331ce0a4.zip fsf-binutils-gdb-0691188992efa4afab80bfdf966479bc331ce0a4.tar.gz fsf-binutils-gdb-0691188992efa4afab80bfdf966479bc331ce0a4.tar.bz2 |
[ARC] Don't check extAuxRegister second argument for sign.
gas/
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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 12 | ||||
-rw-r--r-- | gas/config/tc-arc.c | 27 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/textauxregister-1.d | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/textauxregister-1.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/textcondcode-err.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/textcoreregister-err.s | 2 |
6 files changed, 47 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a721bb2..18ff1b2 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,15 @@ +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. diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 13e925f..cebf198 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -4545,7 +4545,7 @@ arc_extinsn (int ignore ATTRIBUTE_UNUSED) create_extinst_section (&einsn); } -static void +static bfd_boolean tokenize_extregister (extRegister_t *ereg, int opertype) { char *name; @@ -4570,20 +4570,23 @@ tokenize_extregister (extRegister_t *ereg, int opertype) 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) @@ -4596,7 +4599,7 @@ tokenize_extregister (extRegister_t *ereg, int opertype) as_bad (_("expected comma after register number")); ignore_rest_of_line (); free (name); - return; + return FALSE; } input_line_pointer++; @@ -4617,7 +4620,7 @@ tokenize_extregister (extRegister_t *ereg, int opertype) as_bad (_("invalid mode")); ignore_rest_of_line (); free (name); - return; + return FALSE; } else { @@ -4635,7 +4638,7 @@ tokenize_extregister (extRegister_t *ereg, int opertype) as_bad (_("expected comma after register mode")); ignore_rest_of_line (); free (name); - return; + return FALSE; } input_line_pointer++; @@ -4650,7 +4653,7 @@ tokenize_extregister (extRegister_t *ereg, int opertype) as_bad (_("shortcut designator invalid")); ignore_rest_of_line (); free (name); - return; + return FALSE; } else { @@ -4662,6 +4665,7 @@ tokenize_extregister (extRegister_t *ereg, int opertype) ereg->name = name; ereg->number = number; ereg->imode = imode; + return TRUE; } /* Create an extension register/condition description in the arc @@ -4737,7 +4741,8 @@ arc_extcorereg (int opertype) struct arc_flag_operand *ccode; memset (&ereg, 0, sizeof (ereg)); - tokenize_extregister (&ereg, opertype); + if (!tokenize_extregister (&ereg, opertype)) + return; switch (opertype) { diff --git a/gas/testsuite/gas/arc/textauxregister-1.d b/gas/testsuite/gas/arc/textauxregister-1.d new file mode 100644 index 0000000..ce8e52e --- /dev/null +++ b/gas/testsuite/gas/arc/textauxregister-1.d @@ -0,0 +1,10 @@ +#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\] diff --git a/gas/testsuite/gas/arc/textauxregister-1.s b/gas/testsuite/gas/arc/textauxregister-1.s new file mode 100644 index 0000000..b4c5ead0 --- /dev/null +++ b/gas/testsuite/gas/arc/textauxregister-1.s @@ -0,0 +1,5 @@ + .extAuxRegister myreg1, 0x80018000, r|w + .extAuxRegister myreg2, -256, r|w + + lr r2, [myreg1] + lr r1, [myreg2] diff --git a/gas/testsuite/gas/arc/textcondcode-err.s b/gas/testsuite/gas/arc/textcondcode-err.s new file mode 100644 index 0000000..0a0a954 --- /dev/null +++ b/gas/testsuite/gas/arc/textcondcode-err.s @@ -0,0 +1,2 @@ +; { dg-do assemble { target arc*-*-* } } + .extCondCode cctst, -12 ; { dg-error "Error: extCondCode's second argument cannot be a negative number -12" } diff --git a/gas/testsuite/gas/arc/textcoreregister-err.s b/gas/testsuite/gas/arc/textcoreregister-err.s new file mode 100644 index 0000000..2b7d918 --- /dev/null +++ b/gas/testsuite/gas/arc/textcoreregister-err.s @@ -0,0 +1,2 @@ +; { 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" } |