public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Subject: [PATCH] x86/Intel: adjustment to restricted suffix derivation
Date: Mon, 28 Nov 2022 15:24:31 +0100	[thread overview]
Message-ID: <661d0e07-cc75-0fba-941b-88160dbcbb13@suse.com> (raw)

In "x86/Intel: restrict suffix derivation" I think I screwed up
slightly, bringing a piece of code out of sync with its comment, and
resulting in a suffix potentially being derived when one isn't needed.
---
Really we could go further and check whether _any_ register-only operand
in a template permits for multiple sizes, thus implying that operand
size can be derived from it. But that would involve looping over all
operands, when we'd like to keep the checking here quick.

--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -841,11 +841,16 @@ i386_intel_operand (char *operand_string
 		  abort ();
 		}
 
+	      /* We can skip templates with swappable operands here, as one
+		 operand will be a register, which operand size can be
+		 determined from.  */
+	      if (t->opcode_modifier.d)
+		continue;
+
 	      /* In a few cases suffixes are permitted, but we can nevertheless
 		 derive that these aren't going to be needed.  This is only of
-		 interest for insns using ModR/M, plus we can skip templates with
-		 swappable operands here (simplifying subsequent logic).  */
-	      if (!t->opcode_modifier.modrm || t->opcode_modifier.d)
+		 interest for insns using ModR/M.  */
+	      if (!t->opcode_modifier.modrm)
 		break;
 
 	      if (!t->operand_types[op].bitfield.baseindex)

                 reply	other threads:[~2022-11-28 14:24 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=661d0e07-cc75-0fba-941b-88160dbcbb13@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@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).