[PATCH] x86: monitor/mwait corrections

Jan Beulich JBeulich@novell.com
Tue Mar 15 08:55:00 GMT 2005


Built and tested on x86_64-unknown-linux-gnu.

Jan

opcodes/
2005-03-15  Jan Beulich  <jbeulich@novell.com>

	* i386-dis.c (PNI_Fixup): Neither mwait nor monitor have any
	visible operands in Intel mode. The first operand of monitor is
	%rax in 64-bit mode.

---
/home/jbeulich/src/binutils/mainline/2005-03-08/opcodes/i386-dis.c	2005-03-04
15:53:09.000000000 +0100
+++ 2005-03-08/opcodes/i386-dis.c	2005-03-15 09:30:52.896909664
+0100
@@ -4372,16 +4372,32 @@ PNI_Fixup (int extrachar ATTRIBUTE_UNUSE
 	{
 	  /* mwait %eax,%ecx  */
 	  strcpy (p, "mwait");
+	  if (!intel_syntax)
+	    strcpy (op1out, names32[0]);
 	}
       else
 	{
 	  /* monitor %eax,%ecx,%edx"  */
 	  strcpy (p, "monitor");
-	  strcpy (op3out, names32[2]);
+	  if (!intel_syntax)
+	    {
+	      if (!mode_64bit)
+		strcpy (op1out, names32[0]);
+	      else if (!(prefixes & PREFIX_ADDR))
+		strcpy (op1out, names64[0]);
+	      else
+		{
+		  strcpy (op1out, names32[0]);
+		  used_prefixes |= PREFIX_ADDR;
+		}
+	      strcpy (op3out, names32[2]);
+	    }
+	}
+      if (!intel_syntax)
+	{
+	  strcpy (op2out, names32[1]);
+	  two_source_ops = 1;
 	}
-      strcpy (op1out, names32[0]);
-      strcpy (op2out, names32[1]);
-      two_source_ops = 1;
 
       codep++;
     }

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-x86-monitor.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050315/4aa99976/attachment.ksh>


More information about the Binutils mailing list