aarch64: Make indexed_za use 64-bit immediates
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)
A later patch moves the range checking for ZA vector select
offsets from gas to libopcodes.  That in turn requires the
immediate field to be big enough to support all parsed values.

This shouldn't be a particularly size-sensitive structure,
so there should be no memory problems with doing this.

include/opcode/aarch64.h
opcodes/aarch64-opc.c

index 4a554df2b369d6919354799cfb612d9a09739181..aeb3d9a97215edc62dbd462ea83df58710e9db7c 100644 (file)
@@ -1115,7 +1115,7 @@ struct aarch64_indexed_za
   struct
   {
     int regno;    /* <Wv>  */
-    int imm;      /* <imm>  */
+    int64_t imm;  /* <imm>  */
   } index;
   unsigned v : 1;      /* <HV> horizontal or vertical vector indicator.  */
 };
index bbbac418f91bc69334170d7a2b0eba35e5bca72b..c92b4e80e350a29144ccf70ddd9fbbcf22bd2f63 100644 (file)
@@ -3560,7 +3560,7 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
                           opnd->indexed_za.v == 1 ? 'v' : 'h',
                           aarch64_get_qualifier_name (opnd->qualifier)),
                style_reg (styler, "w%d", opnd->indexed_za.index.regno),
-               style_imm (styler, "%d", opnd->indexed_za.index.imm),
+               style_imm (styler, "%" PRIi64, opnd->indexed_za.index.imm),
                opnd->type == AARCH64_OPND_SME_ZA_HV_idx_ldstr ? "}" : "");
       break;
 
@@ -3572,7 +3572,7 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
       snprintf (buf, size, "%s[%s, %s]",
                style_reg (styler, "za"),
                style_reg (styler, "w%d", opnd->indexed_za.index.regno),
-               style_imm (styler, "%d", opnd->indexed_za.index.imm));
+               style_imm (styler, "%" PRIi64, opnd->indexed_za.index.imm));
       break;
 
     case AARCH64_OPND_SME_SM_ZA:
@@ -3585,7 +3585,7 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
                style_reg (styler, "p%d.%s", opnd->indexed_za.regno,
                           aarch64_get_qualifier_name (opnd->qualifier)),
                style_reg (styler, "w%d", opnd->indexed_za.index.regno),
-               style_imm (styler, "%d", opnd->indexed_za.index.imm));
+               style_imm (styler, "%" PRIi64, opnd->indexed_za.index.imm));
       break;
 
     case AARCH64_OPND_CRn: