public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H. J. Lu" <hjl@lucon.org>
To: binutils@sources.redhat.com
Subject: PATCH: Display "xchg %ax,%ax" and "xchg %rax,%rax"
Date: Fri, 09 Jun 2006 06:56:00 -0000	[thread overview]
Message-ID: <20060609063838.GA10928@lucon.org> (raw)

This patch changes the disassembler to display "xchg %ax,%ax" and
"xchg %rax,%rax" instead of "data16 nop" and "rex64 nop" respectively
since nop is just an alias of "xchg %eax,%eax".


H.J.
----
gas/testsuite/

2006-06-08  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/opcode.s: Add "xchg   %ax,%ax".
	* gas/i386/opcode.d: Updated.

	* gas/i386/x86-64-opcode.s: Add "xchg %rax,%rax".
	* gas/i386/x86-64-opcode.d: Updated.

opcodes/

2006-06-08  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-dis.c (NOP_Fixup): Display "xchg %ax,%ax" and
	"xchg %rax,%rax" instead of "data16 nop" and "rex64 nop"
	respectively.

--- binutils/gas/testsuite/gas/i386/opcode.d.xchg	2005-03-29 12:09:20.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/opcode.d	2006-06-08 23:10:12.000000000 -0700
@@ -572,4 +572,5 @@ Disassembly of section .text:
  9b7:	66 0f bd 90 90 90 90 90 [ 	]*bsr    0x90909090\(%eax\),%dx
  9bf:	66 0f be 90 90 90 90 90 [ 	]*movsbw 0x90909090\(%eax\),%dx
  9c7:	66 0f c1 90 90 90 90 90 [ 	]*xadd   %dx,0x90909090\(%eax\)
+ 9cf:	66 90 [ 	]*xchg   %ax,%ax 
 	\.\.\.
--- binutils/gas/testsuite/gas/i386/opcode.s.xchg	2005-03-29 12:09:20.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/opcode.s	2006-06-08 23:27:00.000000000 -0700
@@ -566,5 +566,7 @@ foo:
  movsbw 0x90909090(%eax),%dx
  xadd   %dx,0x90909090(%eax)
 
+ xchg   %ax,%ax
+
 # Force a good alignment.
  .p2align 4,0
--- binutils/gas/testsuite/gas/i386/x86-64-opcode.d.xchg	2005-03-29 12:09:20.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/x86-64-opcode.d	2006-06-08 23:32:10.000000000 -0700
@@ -266,6 +266,6 @@ Disassembly of section .text:
 [	 ]*[0-9a-f]+:[	 ]+e6 00[	 ]+out[	 ]+%al,\$0[x0]*[	 ]*(#.*)*
 [	 ]*[0-9a-f]+:[	 ]+66 e7 00[	 ]+out[	 ]+%ax,\$0[x0]*[	 ]*(#.*)*
 [	 ]*[0-9a-f]+:[	 ]+e7 00[	 ]+out[	 ]+%eax,\$0[x0]*[	 ]*(#.*)*
-[	 ]*[0-9a-f]+:[	 ]+00 00[	 ]+.*
+[	 ]*[0-9a-f]+:[	 ]+48 90[	 ]+xchg[	 ]+%rax,%rax[	 ]*(#.*)*
 [	 ]*[0-9a-f]+:[	 ]+00 00[	 ]+.*
 [	 *]...
--- binutils/gas/testsuite/gas/i386/x86-64-opcode.s.xchg	2005-03-29 12:09:20.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/x86-64-opcode.s	2006-06-08 23:31:02.000000000 -0700
@@ -387,4 +387,8 @@
 
 	# IN
 
+
+
+	xchg %rax,%rax		      # --  --	 -- 48	 90
+
  .p2align 4,0
--- binutils/opcodes/i386-dis.c.xchg	2006-05-11 08:52:55.000000000 -0700
+++ binutils/opcodes/i386-dis.c	2006-06-08 23:24:31.000000000 -0700
@@ -4363,9 +4363,27 @@ OP_0fae (int bytemode, int sizeflag)
 static void
 NOP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
-  /* NOP with REPZ prefix is called PAUSE.  */
   if (prefixes == PREFIX_REPZ)
+    /* NOP with REPZ prefix is called PAUSE.  */
     strcpy (obuf, "pause");
+  else if (prefixes == PREFIX_DATA)
+    {
+      /* We display "xchg %ax,%ax" instead of "data16 nop".  */
+      prefixes = 0;
+      if (intel_syntax)
+	strcpy (obuf, "xchg   ax,ax");
+      else
+	strcpy (obuf, "xchg   %ax,%ax");
+    }
+  else if (rex == 0x48)
+    {
+      /* We display "xchg %rax,%rax" instead of "rex64 nop".  */
+      rex = 0;
+      if (intel_syntax)
+	strcpy (obuf, "xchg   rax,rax");
+      else
+	strcpy (obuf, "xchg   %rax,%rax");
+    }
 }
 
 static const char *const Suffix3DNow[] = {

             reply	other threads:[~2006-06-09  6:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-09  6:56 H. J. Lu [this message]
2006-06-09  9:23 ` Jan Beulich
2006-06-09 19:32   ` H. J. Lu
2006-06-09 21:08     ` H. J. Lu

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=20060609063838.GA10928@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sources.redhat.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).