[AArch64][SVE 01/32] Remove parse_neon_operand_type
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 Sep 2016 15:47:57 +0000 (16:47 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 Sep 2016 15:47:57 +0000 (16:47 +0100)
A false return from parse_neon_operand_type had an overloaded
meaning: either the parsing failed, or there was nothing to parse
(which isn't necessarily an error).  The only caller, parse_typed_reg,
would therefore not consume the suffix if it was invalid but instead
(successfully) parse the register without a suffix.  It would still
leave inst.parsing_error with an error about the invalid suffix.

It seems wrong for a successful parse to leave an error message,
so this patch makes parse_typed_reg return PARSE_FAIL instead.

The patch doesn't seem to make much difference in practice.
Most possible follow-on errors use set_first_error and so the
error about the suffix tended to win despite the successful parse.

gas/
* config/tc-aarch64.c (parse_neon_operand_type): Delete.
(parse_typed_reg): Call parse_neon_type_for_operand directly.

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

index 8a4e15f48ec8019b37e124a2df369ccaa47674ea..0f68aba4a569522503ab64c215bc124cd43cacbf 100644 (file)
@@ -1,3 +1,8 @@
+2016-09-21  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/tc-aarch64.c (parse_neon_operand_type): Delete.
+       (parse_typed_reg): Call parse_neon_type_for_operand directly.
+
 2016-09-15  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * testsuite/gas/arc/textinsnxop.d: New file.
index 34fdc53e1211858a0e8f2cda73abf39b95aa4d7d..ce8e7132276894695e16859b9b02c73aad5861de 100644 (file)
@@ -821,31 +821,6 @@ elt_size:
   return TRUE;
 }
 
-/* Parse a single type, e.g. ".8b", leading period included.
-   Only applicable to Vn registers.
-
-   Return TRUE on success; otherwise return FALSE.  */
-static bfd_boolean
-parse_neon_operand_type (struct neon_type_el *vectype, char **ccp)
-{
-  char *str = *ccp;
-
-  if (*str == '.')
-    {
-      if (! parse_neon_type_for_operand (vectype, &str))
-       {
-         first_error (_("vector type expected"));
-         return FALSE;
-       }
-    }
-  else
-    return FALSE;
-
-  *ccp = str;
-
-  return TRUE;
-}
-
 /* Parse a register of the type TYPE.
 
    Return PARSE_FAIL if the string pointed by *CCP is not a valid register
@@ -889,9 +864,11 @@ parse_typed_reg (char **ccp, aarch64_reg_type type, aarch64_reg_type *rtype,
     }
   type = reg->type;
 
-  if (type == REG_TYPE_VN
-      && parse_neon_operand_type (&parsetype, &str))
+  if (type == REG_TYPE_VN && *str == '.')
     {
+      if (!parse_neon_type_for_operand (&parsetype, &str))
+       return PARSE_FAIL;
+
       /* Register if of the form Vn.[bhsdq].  */
       is_typed_vecreg = TRUE;
 
This page took 0.066485 seconds and 4 git commands to generate.