public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] aarch64: Add REG_TYPE_ZATHV
Date: Thu, 30 Mar 2023 10:11:14 +0000 (GMT)	[thread overview]
Message-ID: <20230330101114.6D3243858CDB@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=83dbd40dea2a00be854e4ffe204b9d456fcca17e

commit 83dbd40dea2a00be854e4ffe204b9d456fcca17e
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Thu Mar 30 11:09:03 2023 +0100

    aarch64: Add REG_TYPE_ZATHV
    
    This patch adds a multi-register type that includes both REG_TYPE_ZATH
    and REG_TYPE_ZATV.  This slightly simplifies the existing code, but the
    main purpose is to enable later patches.

Diff:
---
 gas/config/tc-aarch64.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index c8b4129202c..98091f564d9 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -326,6 +326,8 @@ struct reloc_entry
   MULTI_REG_TYPE(R_N, REG_TYPE(R_32) | REG_TYPE(R_64)			\
 		 | REG_TYPE(SP_32) | REG_TYPE(SP_64)			\
 		 | REG_TYPE(Z_32) | REG_TYPE(Z_64))			\
+  /* A horizontal or vertical slice of a ZA tile.  */			\
+  MULTI_REG_TYPE(ZATHV, REG_TYPE(ZATH) | REG_TYPE(ZATV))		\
   /* Pseudo type to mark the end of the enumerator sequence.  */	\
   BASIC_REG_TYPE(MAX)
 
@@ -4248,7 +4250,7 @@ parse_reg_with_qual (char **str, aarch64_reg_type reg_type,
   char *q;
 
   reg_entry *reg = parse_reg (str);
-  if (reg != NULL && reg->type == reg_type)
+  if (reg != NULL && aarch64_check_reg_type (reg, reg_type))
     {
       if (!skip_past_char (str, '.'))
         {
@@ -4440,26 +4442,19 @@ parse_sme_za_hv_tiles_operand (char **str,
                                int *imm,
                                aarch64_opnd_qualifier_t *qualifier)
 {
-  char *qh, *qv;
   int regno;
   int regno_limit;
   int64_t imm_limit;
   int64_t imm_value;
   const reg_entry *reg;
 
-  qh = qv = *str;
-  if ((reg = parse_reg_with_qual (&qh, REG_TYPE_ZATH, qualifier)) != NULL)
-    {
-      *slice_indicator = HV_horizontal;
-      *str = qh;
-    }
-  else if ((reg = parse_reg_with_qual (&qv, REG_TYPE_ZATV, qualifier)) != NULL)
-    {
-      *slice_indicator = HV_vertical;
-      *str = qv;
-    }
-  else
+  reg = parse_reg_with_qual (str, REG_TYPE_ZATHV, qualifier);
+  if (!reg)
     return PARSE_FAIL;
+
+  *slice_indicator = (aarch64_check_reg_type (reg, REG_TYPE_ZATH)
+		      ? HV_horizontal
+		      : HV_vertical);
   regno = reg->number;
 
   switch (*qualifier)

                 reply	other threads:[~2023-03-30 10:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230330101114.6D3243858CDB@sourceware.org \
    --to=rsandifo@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).