* config/tc-s390.c (md_parse_option): Add cpu type z9-109.
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 12 Aug 2005 18:00:56 +0000 (18:00 +0000)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 12 Aug 2005 18:00:56 +0000 (18:00 +0000)
(md_gather_operands): Add support for optional operands.

gas/ChangeLog
gas/config/tc-s390.c

index bc98f76da43edf9a6d031b78738e499306068aa3..fa0b749a32a0fdd3c545752f0dcce24f985beb31 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-12 Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+       * config/tc-s390.c (md_parse_option):  Add cpu type z9-109.
+       (md_gather_operands): Add support for optional operands.
+
 2005-08-12  Dmitry Diky <diwil@spec.ru>
        * config/tc-msp430.c (msp430_enable_relax): New flag.
        (msp430_enable_polys): Likewise.
index 87c7a88f32ee55f5985997afad88aba925b7bb55..56b5b2594f8fa60824b771d1f09bf8e7771eab8b 100644 (file)
@@ -410,6 +410,8 @@ md_parse_option (c, arg)
            current_cpu = S390_OPCODE_Z900;
          else if (strcmp (arg + 5, "z990") == 0)
            current_cpu = S390_OPCODE_Z990;
+         else if (strcmp (arg + 5, "z9-109") == 0)
+           current_cpu = S390_OPCODE_Z9_109;
          else
            {
              as_bad (_("invalid switch -m%s"), arg);
@@ -1353,8 +1355,19 @@ md_gather_operands (str, insn, opcode)
              /* If there is a next operand it must be separated by a comma.  */
              if (opindex_ptr[1] != '\0')
                {
-                 if (*str++ != ',')
-                   as_bad (_("syntax error; expected ,"));
+                 if (*str != ',')
+                   {
+                     while (opindex_ptr[1] != '\0')
+                       {
+                         operand = s390_operands + *(++opindex_ptr);
+                         if (operand->flags & S390_OPERAND_OPTIONAL)
+                           continue;
+                         as_bad (_("syntax error; expected ,"));
+                         break;
+                       }
+                   }
+                 else
+                   str++;
                }
            }
          else
@@ -1386,8 +1399,19 @@ md_gather_operands (str, insn, opcode)
          /* If there is a next operand it must be separated by a comma.  */
          if (opindex_ptr[1] != '\0')
            {
-             if (*str++ != ',')
-               as_bad (_("syntax error; expected ,"));
+             if (*str != ',')
+               {
+                 while (opindex_ptr[1] != '\0')
+                   {
+                     operand = s390_operands + *(++opindex_ptr);
+                     if (operand->flags & S390_OPERAND_OPTIONAL)
+                       continue;
+                     as_bad (_("syntax error; expected ,"));
+                     break;
+                   }
+               }
+             else
+               str++;
            }
        }
       else
@@ -1405,8 +1429,19 @@ md_gather_operands (str, insn, opcode)
          /* If there is a next operand it must be separated by a comma.  */
          if (opindex_ptr[1] != '\0')
            {
-             if (*str++ != ',')
-               as_bad (_("syntax error; expected ,"));
+             if (*str != ',')
+               {
+                 while (opindex_ptr[1] != '\0')
+                   {
+                     operand = s390_operands + *(++opindex_ptr);
+                     if (operand->flags & S390_OPERAND_OPTIONAL)
+                       continue;
+                     as_bad (_("syntax error; expected ,"));
+                     break;
+                   }
+               }
+             else
+               str++;
            }
        }
     }