From: Richard Sandiford Date: Thu, 30 Mar 2023 10:09:04 +0000 (+0100) Subject: aarch64: Rename za_tile_vector to za_index X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=575c497a4acde05bc67da24ae2d3af5288e8f763;p=binutils-gdb.git aarch64: Rename za_tile_vector to za_index 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. --- diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 26588cb4596..b06a9379f2e 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -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; } diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index 691247aa934..4a554df2b36 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -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); +/* Information about a reference to part of ZA. */ +struct aarch64_indexed_za +{ + int regno; /* */ + struct + { + int regno; /* */ + int imm; /* */ + } index; + unsigned v : 1; /* 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. .D[{, }] */ - struct - { - int regno; /* */ - struct - { - int regno; /* */ - int imm; /* */ - } index; - unsigned v : 1; /* horizontal or vertical vector indicator. */ - } za_tile_vector; + struct aarch64_indexed_za indexed_za; const aarch64_cond *cond; /* The encoding of the PSTATE field. */ diff --git a/opcodes/aarch64-asm.c b/opcodes/aarch64-asm.c index bfabcb9e3a2..73ee15a0257 100644 --- a/opcodes/aarch64-asm.c +++ b/opcodes/aarch64-asm.c @@ -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); diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c index 01881ea377d..eabcc9ee586 100644 --- a/opcodes/aarch64-dis.c +++ b/opcodes/aarch64-dis.c @@ -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; } diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index a0e6240592c..bbbac418f91 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -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: