]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
aarch64: Return QLF_ERR for error conditions
authorAlice Carlotti <alice.carlotti@arm.com>
Thu, 29 Jan 2026 12:10:43 +0000 (12:10 +0000)
committerAlice Carlotti <alice.carlotti@arm.com>
Fri, 15 May 2026 14:07:19 +0000 (15:07 +0100)
In vectype_to_qualifier and get_qualifier_from_partial_encoding, return
AARCH64_OPND_QLF_ERR instead of AARCH64_OPND_QLF_NIL to indicate an
error condition.

gas/config/tc-aarch64.c
opcodes/aarch64-dis.c

index b851868d3ff441c5fe3a13bafaa25fb433a03d5f..abc351f60b3f4cd2d6b9bb40205eb303f5bb6179 100644 (file)
@@ -879,7 +879,7 @@ vectype_to_qualifier (const struct vector_type_el *vectype)
 
  vectype_conversion_fail:
   first_error (_("bad vector arrangement type"));
-  return AARCH64_OPND_QLF_NIL;
+  return AARCH64_OPND_QLF_ERR;
 }
 
 /* Register parsing.  */
@@ -4703,7 +4703,7 @@ parse_reg_with_qual (char **str, aarch64_reg_type reg_type,
   else
     {
       *qualifier = vectype_to_qualifier (&vectype);
-      if (*qualifier == AARCH64_OPND_QLF_NIL)
+      if (*qualifier == AARCH64_OPND_QLF_ERR)
        return NULL;
     }
 
@@ -6974,7 +6974,7 @@ parse_operands (char *str, const aarch64_opcode *opcode)
          else
            {
              info->qualifier = vectype_to_qualifier (&vectype);
-             if (info->qualifier == AARCH64_OPND_QLF_NIL)
+             if (info->qualifier == AARCH64_OPND_QLF_ERR)
                goto failure;
            }
          break;
@@ -7067,7 +7067,7 @@ parse_operands (char *str, const aarch64_opcode *opcode)
              if (vectype.type == NT_invtype)
                goto failure;
              info->qualifier = vectype_to_qualifier (&vectype);
-             if (info->qualifier == AARCH64_OPND_QLF_NIL)
+             if (info->qualifier == AARCH64_OPND_QLF_ERR)
                goto failure;
            }
 
@@ -7197,7 +7197,7 @@ parse_operands (char *str, const aarch64_opcode *opcode)
                }
            }
          info->qualifier = vectype_to_qualifier (&vectype);
-         if (info->qualifier == AARCH64_OPND_QLF_NIL)
+         if (info->qualifier == AARCH64_OPND_QLF_ERR)
            goto failure;
          break;
 
@@ -8354,7 +8354,11 @@ parse_operands (char *str, const aarch64_opcode *opcode)
          if (vectype.type == NT_invtype)
            info->qualifier = AARCH64_OPND_QLF_NIL;
          else
-           info->qualifier = vectype_to_qualifier (&vectype);
+           {
+             info->qualifier = vectype_to_qualifier (&vectype);
+             if (info->qualifier == AARCH64_OPND_QLF_ERR)
+               goto failure;
+           }
          break;
 
        case AARCH64_OPND_BARRIER_GCSB:
index 3395cc3fde1bc3504881f233a9d12fc1d02ba36f..50f4943afd2295f997ee8ab4ac5e258d52053b57 100644 (file)
@@ -2512,7 +2512,7 @@ aarch64_ext_plain_shrimm (const aarch64_operand *self, aarch64_opnd_info *info,
    constrained field(s).  Given the VALUE of such a field or fields, the
    qualifiers CANDIDATES and the MASK (indicating which bits are valid for
    operand encoding), the function returns the matching qualifier or
-   AARCH64_OPND_QLF_NIL if nothing matches.
+   AARCH64_OPND_QLF_ERR if nothing matches.
 
    N.B. CANDIDATES is a group of possible qualifiers that are valid for
    one operand; it has a maximum of AARCH64_MAX_QLF_SEQ_NUM qualifiers and
@@ -2535,7 +2535,7 @@ get_qualifier_from_partial_encoding (aarch64_insn value,
       if ((standard_value & mask) == (value & mask))
        return candidates[i];
     }
-  return AARCH64_OPND_QLF_NIL;
+  return AARCH64_OPND_QLF_ERR;
 }
 
 /* Given a list of qualifier sequences, return all possible valid qualifiers
@@ -2562,7 +2562,6 @@ static int
 decode_sizeq (aarch64_inst *inst)
 {
   int idx;
-  enum aarch64_opnd_qualifier qualifier;
   aarch64_insn code;
   aarch64_insn value, mask;
   enum aarch64_field_kind fld_sz;
@@ -2613,9 +2612,10 @@ decode_sizeq (aarch64_inst *inst)
     }
 #endif /* DEBUG_AARCH64 */
 
-  qualifier = get_qualifier_from_partial_encoding (value, candidates, mask);
+  enum aarch64_opnd_qualifier qualifier
+    = get_qualifier_from_partial_encoding (value, candidates, mask);
 
-  if (qualifier == AARCH64_OPND_QLF_NIL)
+  if (qualifier == AARCH64_OPND_QLF_ERR)
     return 0;
 
   inst->operands[idx].qualifier = qualifier;