aarch64: Rename za_tile_vector to za_index
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 30 Mar 2023 10:09:04 +0000 (11:09 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 30 Mar 2023 10:09:04 +0000 (11:09 +0100)
za_tile_vector is also used for indexing ZA as a whole, rather than
just for indexing tiles.  The former is more common than the latter
in SME2, so this patch generalises the name to "indexed_za".

The patch also names the associated structure, so that later patches
can reuse it during parsing.

gas/config/tc-aarch64.c
include/opcode/aarch64.h
opcodes/aarch64-asm.c
opcodes/aarch64-dis.c
opcodes/aarch64-opc.c

index 26588cb45969d05236917874e58647a6c6cdb01f..b06a9379f2ec5d86c2da39cf339985de973f9d28 100644 (file)
@@ -7185,9 +7185,9 @@ parse_operands (char *str, const aarch64_opcode *opcode)
            if (val == PARSE_FAIL)
                goto failure;
 
-           info->za_tile_vector.regno = val;
-           info->za_tile_vector.index.regno = index_base_reg;
-           info->za_tile_vector.index.imm = imm;
+           info->indexed_za.regno = val;
+           info->indexed_za.index.regno = index_base_reg;
+           info->indexed_za.index.imm = imm;
            info->qualifier = qualifier;
            break;
          }
@@ -7535,10 +7535,10 @@ parse_operands (char *str, const aarch64_opcode *opcode)
                                                   &qualifier);
            if (val == PARSE_FAIL)
              goto failure;
-           info->za_tile_vector.regno = val;
-           info->za_tile_vector.index.regno = vector_select_register;
-           info->za_tile_vector.index.imm = imm;
-           info->za_tile_vector.v = slice_indicator;
+           info->indexed_za.regno = val;
+           info->indexed_za.index.regno = vector_select_register;
+           info->indexed_za.index.imm = imm;
+           info->indexed_za.v = slice_indicator;
            info->qualifier = qualifier;
            break;
          }
@@ -7556,8 +7556,8 @@ parse_operands (char *str, const aarch64_opcode *opcode)
              val = parse_sme_za_array (&str, &imm);
              if (val == PARSE_FAIL)
                goto failure;
-             info->za_tile_vector.index.regno = val;
-             info->za_tile_vector.index.imm = imm;
+             info->indexed_za.index.regno = val;
+             info->indexed_za.index.imm = imm;
              break;
            }
 
index 691247aa9340b679f7ac80212cfc12ad814c9de4..4a554df2b369d6919354799cfb612d9a09739181 100644 (file)
@@ -1108,6 +1108,18 @@ extern const aarch64_cond aarch64_conds[16];
 const aarch64_cond* get_cond_from_value (aarch64_insn value);
 const aarch64_cond* get_inverted_cond (const aarch64_cond *cond);
 \f
+/* Information about a reference to part of ZA.  */
+struct aarch64_indexed_za
+{
+  int regno;      /* <ZAn> */
+  struct
+  {
+    int regno;    /* <Wv>  */
+    int imm;      /* <imm>  */
+  } index;
+  unsigned v : 1;      /* <HV> horizontal or vertical vector indicator.  */
+};
+
 /* Structure representing an operand.  */
 
 struct aarch64_opnd_info
@@ -1172,16 +1184,7 @@ struct aarch64_opnd_info
        } sysreg;
 
       /* ZA tile vector, e.g. <ZAn><HV>.D[<Wv>{, <imm>}]  */
-      struct
-       {
-         int regno;      /* <ZAn> */
-         struct
-         {
-           int regno;    /* <Wv>  */
-           int imm;      /* <imm>  */
-         } index;
-         unsigned v : 1;       /* <HV> horizontal or vertical vector indicator.  */
-       } za_tile_vector;
+      struct aarch64_indexed_za indexed_za;
 
       const aarch64_cond *cond;
       /* The encoding of the PSTATE field.  */
index bfabcb9e3a2b1e0f3aef6533f57924324b4939b1..73ee15a025797ed451864bc1f980876ea298bfa2 100644 (file)
@@ -1340,10 +1340,10 @@ aarch64_ins_sme_za_hv_tiles (const aarch64_operand *self,
 {
   int fld_size;
   int fld_q;
-  int fld_v = info->za_tile_vector.v;
-  int fld_rv = info->za_tile_vector.index.regno - 12;
-  int fld_zan_imm = info->za_tile_vector.index.imm;
-  int regno = info->za_tile_vector.regno;
+  int fld_v = info->indexed_za.v;
+  int fld_rv = info->indexed_za.index.regno - 12;
+  int fld_zan_imm = info->indexed_za.index.imm;
+  int regno = info->indexed_za.regno;
 
   switch (info->qualifier)
     {
@@ -1410,8 +1410,8 @@ aarch64_ins_sme_za_array (const aarch64_operand *self,
                           const aarch64_inst *inst ATTRIBUTE_UNUSED,
                           aarch64_operand_error *errors ATTRIBUTE_UNUSED)
 {
-  int regno = info->za_tile_vector.index.regno - 12;
-  int imm = info->za_tile_vector.index.imm;
+  int regno = info->indexed_za.index.regno - 12;
+  int imm = info->indexed_za.index.imm;
   insert_field (self->fields[0], code, regno, 0);
   insert_field (self->fields[1], code, imm, 0);
   return true;
@@ -1464,9 +1464,9 @@ aarch64_ins_sme_pred_reg_with_index (const aarch64_operand *self,
                                      const aarch64_inst *inst ATTRIBUTE_UNUSED,
                                      aarch64_operand_error *errors ATTRIBUTE_UNUSED)
 {
-  int fld_pn = info->za_tile_vector.regno;
-  int fld_rm = info->za_tile_vector.index.regno - 12;
-  int imm = info->za_tile_vector.index.imm;
+  int fld_pn = info->indexed_za.regno;
+  int fld_rm = info->indexed_za.index.regno - 12;
+  int imm = info->indexed_za.index.imm;
   int fld_i1, fld_tszh, fld_tshl;
 
   insert_field (self->fields[0], code, fld_rm, 0);
index 01881ea377d97dcba0ea67a80c77033a73e976d5..eabcc9ee5863098b823e90d64d35dd7963abeb69 100644 (file)
@@ -1786,34 +1786,34 @@ aarch64_ext_sme_za_hv_tiles (const aarch64_operand *self,
   /* Deduce qualifier encoded in size and Q fields.  */
   if (fld_size == 0)
     {
-      info->za_tile_vector.regno = 0;
-      info->za_tile_vector.index.imm = fld_zan_imm;
+      info->indexed_za.regno = 0;
+      info->indexed_za.index.imm = fld_zan_imm;
     }
   else if (fld_size == 1)
     {
-      info->za_tile_vector.regno = fld_zan_imm >> 3;
-      info->za_tile_vector.index.imm = fld_zan_imm & 0x07;
+      info->indexed_za.regno = fld_zan_imm >> 3;
+      info->indexed_za.index.imm = fld_zan_imm & 0x07;
     }
   else if (fld_size == 2)
     {
-      info->za_tile_vector.regno = fld_zan_imm >> 2;
-      info->za_tile_vector.index.imm = fld_zan_imm & 0x03;
+      info->indexed_za.regno = fld_zan_imm >> 2;
+      info->indexed_za.index.imm = fld_zan_imm & 0x03;
     }
   else if (fld_size == 3 && fld_q == 0)
     {
-      info->za_tile_vector.regno = fld_zan_imm >> 1;
-      info->za_tile_vector.index.imm = fld_zan_imm & 0x01;
+      info->indexed_za.regno = fld_zan_imm >> 1;
+      info->indexed_za.index.imm = fld_zan_imm & 0x01;
     }
   else if (fld_size == 3 && fld_q == 1)
     {
-      info->za_tile_vector.regno = fld_zan_imm;
-      info->za_tile_vector.index.imm = 0;
+      info->indexed_za.regno = fld_zan_imm;
+      info->indexed_za.index.imm = 0;
     }
   else
     return false;
 
-  info->za_tile_vector.index.regno = fld_rv + 12;
-  info->za_tile_vector.v = fld_v;
+  info->indexed_za.index.regno = fld_rv + 12;
+  info->indexed_za.v = fld_v;
 
   return true;
 }
@@ -1847,8 +1847,8 @@ aarch64_ext_sme_za_array (const aarch64_operand *self,
 {
   int regno = extract_field (self->fields[0], code, 0) + 12;
   int imm = extract_field (self->fields[1], code, 0);
-  info->za_tile_vector.index.regno = regno;
-  info->za_tile_vector.index.imm = imm;
+  info->indexed_za.index.regno = regno;
+  info->indexed_za.index.imm = imm;
   return true;
 }
 
@@ -1902,8 +1902,8 @@ aarch64_ext_sme_pred_reg_with_index (const aarch64_operand *self,
   aarch64_insn fld_tszl = extract_field (self->fields[4], code, 0);
   int imm;
 
-  info->za_tile_vector.regno = fld_pn;
-  info->za_tile_vector.index.regno = fld_rm + 12;
+  info->indexed_za.regno = fld_pn;
+  info->indexed_za.index.regno = fld_rm + 12;
 
   if (fld_tszl & 0x1)
     imm = (fld_i1 << 3) | (fld_tszh << 2) | (fld_tszl >> 1);
@@ -1916,7 +1916,7 @@ aarch64_ext_sme_pred_reg_with_index (const aarch64_operand *self,
   else
     return false;
 
-  info->za_tile_vector.index.imm = imm;
+  info->indexed_za.index.imm = imm;
   return true;
 }
 
index a0e6240592c08938597ebe9b3c1719b5775a228f..bbbac418f91bc69334170d7a2b0eba35e5bca72b 100644 (file)
@@ -2770,7 +2770,7 @@ aarch64_match_operands_constraint (aarch64_inst *inst,
         case sme_str:
           assert (inst->operands[0].type == AARCH64_OPND_SME_ZA_array);
           assert (inst->operands[1].type == AARCH64_OPND_SME_ADDR_RI_U4xVL);
-          if (inst->operands[0].za_tile_vector.index.imm
+          if (inst->operands[0].indexed_za.index.imm
               != inst->operands[1].addr.offset.imm)
             {
               if (mismatch_detail)
@@ -3556,11 +3556,11 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
       snprintf (buf, size, "%s%s[%s, %s]%s",
                opnd->type == AARCH64_OPND_SME_ZA_HV_idx_ldstr ? "{" : "",
                style_reg (styler, "za%d%c.%s",
-                          opnd->za_tile_vector.regno,
-                          opnd->za_tile_vector.v == 1 ? 'v' : 'h',
+                          opnd->indexed_za.regno,
+                          opnd->indexed_za.v == 1 ? 'v' : 'h',
                           aarch64_get_qualifier_name (opnd->qualifier)),
-               style_reg (styler, "w%d", opnd->za_tile_vector.index.regno),
-               style_imm (styler, "%d", opnd->za_tile_vector.index.imm),
+               style_reg (styler, "w%d", opnd->indexed_za.index.regno),
+               style_imm (styler, "%d", opnd->indexed_za.index.imm),
                opnd->type == AARCH64_OPND_SME_ZA_HV_idx_ldstr ? "}" : "");
       break;
 
@@ -3571,8 +3571,8 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
     case AARCH64_OPND_SME_ZA_array:
       snprintf (buf, size, "%s[%s, %s]",
                style_reg (styler, "za"),
-               style_reg (styler, "w%d", opnd->za_tile_vector.index.regno),
-               style_imm (styler, "%d", opnd->za_tile_vector.index.imm));
+               style_reg (styler, "w%d", opnd->indexed_za.index.regno),
+               style_imm (styler, "%d", opnd->indexed_za.index.imm));
       break;
 
     case AARCH64_OPND_SME_SM_ZA:
@@ -3582,10 +3582,10 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
 
     case AARCH64_OPND_SME_PnT_Wm_imm:
       snprintf (buf, size, "%s[%s, %s]",
-               style_reg (styler, "p%d.%s", opnd->za_tile_vector.regno,
+               style_reg (styler, "p%d.%s", opnd->indexed_za.regno,
                           aarch64_get_qualifier_name (opnd->qualifier)),
-                style_reg (styler, "w%d", opnd->za_tile_vector.index.regno),
-                style_imm (styler, "%d", opnd->za_tile_vector.index.imm));
+               style_reg (styler, "w%d", opnd->indexed_za.index.regno),
+               style_imm (styler, "%d", opnd->indexed_za.index.imm));
       break;
 
     case AARCH64_OPND_CRn: