public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Haochen Jiang <haochen.jiang@intel.com>
To: binutils@sourceware.org
Cc: jbeulich@suse.com, hjl.tools@gmail.com
Subject: [PATCH] x86: Remove unnecessary vex.w check for xh_mode in disassembler
Date: Mon,  5 Dec 2022 10:53:11 +0800	[thread overview]
Message-ID: <20221205025311.73743-1-haochen.jiang@intel.com> (raw)

Hi all,

For all the xh_mode usage in table, they are all using %XH, which will
print "{bad}" while EVEX.W=1. This makes this vex.w check unnecessary.

Another reason for removing this check is because xh_mode with
broadcast usage should not indicate the vex.w bit. Instead it should
be handled by a W table entry.

BRs,
Haochen

opcodes/ChangeLog:

	* i386-dis.c (OP_E_memory): Remove vex.w check for xh_mode.
---
 opcodes/i386-dis.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index e43666af84..e778e91920 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -12206,24 +12206,19 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag)
 	{
 	  if (bytemode == xh_mode)
 	    {
-	      if (ins->vex.w)
-		oappend (ins, "{bad}");
-	      else
+	      switch (ins->vex.length)
 		{
-		  switch (ins->vex.length)
-		    {
-		    case 128:
-		      oappend (ins, "{1to8}");
-		      break;
-		    case 256:
-		      oappend (ins, "{1to16}");
-		      break;
-		    case 512:
-		      oappend (ins, "{1to32}");
-		      break;
-		    default:
-		      abort ();
-		    }
+		case 128:
+		  oappend (ins, "{1to8}");
+		  break;
+		case 256:
+		  oappend (ins, "{1to16}");
+		  break;
+		case 512:
+		  oappend (ins, "{1to32}");
+		  break;
+		default:
+		  abort ();
 		}
 	    }
 	  else if (bytemode == q_mode
-- 
2.18.1


             reply	other threads:[~2022-12-05  2:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05  2:53 Haochen Jiang [this message]
2022-12-05 11:16 ` Jan Beulich
2022-12-06  1:36   ` Jiang, Haochen
2022-12-06  3:39     ` H.J. Lu
2022-12-06  6:14       ` Jiang, Haochen
2022-12-06  7:29     ` Jan Beulich
2022-12-06  8:00       ` Jiang, Haochen

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=20221205025311.73743-1-haochen.jiang@intel.com \
    --to=haochen.jiang@intel.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=jbeulich@suse.com \
    /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).