aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-s390.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2009-06-19 10:58:27 +0000
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-06-19 10:58:27 +0000
commit5e7c27a6076edbd535b3988449c0f24b40ac2371 (patch)
tree240dbfbd3b0d297356484021bdf93dc213315dc2 /gas/config/tc-s390.c
parentce21feb4baa0e93d4ce510f755cd5b92ec1580d0 (diff)
downloadgdb-5e7c27a6076edbd535b3988449c0f24b40ac2371.zip
gdb-5e7c27a6076edbd535b3988449c0f24b40ac2371.tar.gz
gdb-5e7c27a6076edbd535b3988449c0f24b40ac2371.tar.bz2
* config/tc-s390.c (md_gather_operands): Accept an instruction
without operands if all operands are tagged as optional.
Diffstat (limited to 'gas/config/tc-s390.c')
-rw-r--r--gas/config/tc-s390.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index da7d4c5..f5c2a2e 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -1188,7 +1188,24 @@ md_gather_operands (char *str,
if (ex.X_op == O_illegal)
as_bad (_("illegal operand"));
else if (ex.X_op == O_absent)
- as_bad (_("missing operand"));
+ {
+ /* No operands, check if all operands can be skipped. */
+ while (*opindex_ptr != 0 && operand->flags & S390_OPERAND_OPTIONAL)
+ {
+ if (operand->flags & S390_OPERAND_DISP)
+ {
+ /* An optional displacement makes the whole D(X,B)
+ D(L,B) or D(B) block optional. */
+ do {
+ operand = s390_operands + *(++opindex_ptr);
+ } while (!(operand->flags & S390_OPERAND_BASE));
+ }
+ operand = s390_operands + *(++opindex_ptr);
+ }
+ if (opindex_ptr[0] == '\0')
+ break;
+ as_bad (_("missing operand"));
+ }
else if (ex.X_op == O_register || ex.X_op == O_constant)
{
s390_lit_suffix (&str, &ex, ELF_SUFFIX_NONE);