This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix x86-64 disasm for MOVD with REX prefix


Hi,

The following patch fix disassembly for MOVD with REX prefix. Maybe a new
r_mode would be better?

Bye,
Gwenole.

2003-02-04  Gwenole Beauchesne  <gbeauchesne@mandrakesoft.com>

	* opcodes/i386-dis.c (twobyte): MOVD may have a REX prefix.
	(OP_E): Handle MOVD operand size as only 32 or 64 bits.
	* gas/i386/x86-64-opcode.d: More test cases for x86-64 MOVD opcodes.
	* gas/i386/x86-64-opcode.s: Likewise.
	
--- binutils-2.13.90.0.16/gas/testsuite/gas/i386/x86-64-opcode.s.x86_64-disasm-movd	2002-05-23 18:10:11.000000000 -0400
+++ binutils-2.13.90.0.16/gas/testsuite/gas/i386/x86-64-opcode.s	2003-02-03 18:55:03.000000000 -0500
@@ -387,4 +387,16 @@
 
 	# IN
 
+	# More MOVD
+	MOVD %rax,%xmm0		      #	 --  --	 66 48	 0F 6E C0			 ; Data128 = ZEXT(Data32). OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %rax,%xmm15	      #	 --  --	 66 4C	 0F 6E F8			 ; REX to access upper XMM reg. Data128 = ZEXT(Data32). OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %rax,%xmm8		      #	 --  --	 66 4C	 0F 6E C0			 ; REX to access upper XMM reg. Data128 = ZEXT(Data32). OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %rax,%xmm7		      #	 --  --	 66 48	 0F 6E F8			 ; Data128 = ZEXT(Data32). OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %xmm0,%rax		      #	 --  --	 66 48	 0F 7E C0			 ; OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %xmm15,%rax	      #	 --  --	 66 4C	 0F 7E F8			 ; REX to access upper XMM reg. OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %xmm8,%rax		      #	 --  --	 66 4C	 0F 7E C0			 ; REX to access upper XMM reg. OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %xmm7,%rax		      #	 --  --	 66 48	 0F 7E F8			 ; OVR 128bit MMinstr. REX for 64-bit operand size.
+	MOVD %xmm7,%r8		      #	 --  --	 66 41	 0F 7E F8			 ; OVR 128bit MMinstr. REX for 64-bit operand size.
+
+
  .p2align 4,0
--- binutils-2.13.90.0.16/gas/testsuite/gas/i386/x86-64-opcode.d.x86_64-disasm-movd	2002-05-23 18:10:11.000000000 -0400
+++ binutils-2.13.90.0.16/gas/testsuite/gas/i386/x86-64-opcode.d	2003-02-03 18:55:56.000000000 -0500
@@ -266,4 +266,13 @@ Disassembly of section .text:
 [	 ]*43a:[	 ]+e6 00[	 ]+out[	 ]+%al,\$0[x0]*[	 ]*(#.*)*
 [	 ]*43c:[	 ]+66 e7 00[	 ]+out[	 ]+%ax,\$0[x0]*[	 ]*(#.*)*
 [	 ]*43f:[	 ]+e7 00[	 ]+out[	 ]+%eax,\$0[x0]*[	 ]*(#.*)*
+[	 ]*441:[	 ]+66 48 0f 6e c0[	 ]+movd[	 ]+%rax,%xmm0[	 ]*(#.*)*
+[	 ]*446:[	 ]+66 4c 0f 6e f8[	 ]+movd[	 ]+%rax,%xmm15[	 ]*(#.*)*
+[	 ]*44b:[	 ]+66 4c 0f 6e c0[	 ]+movd[	 ]+%rax,%xmm8[	 ]*(#.*)*
+[	 ]*450:[	 ]+66 48 0f 6e f8[	 ]+movd[	 ]+%rax,%xmm7[	 ]*(#.*)*
+[	 ]*455:[	 ]+66 48 0f 7e c0[	 ]+movd[	 ]+%xmm0,%rax[	 ]*(#.*)*
+[	 ]*45a:[	 ]+66 4c 0f 7e f8[	 ]+movd[	 ]+%xmm15,%rax[	 ]*(#.*)*
+[	 ]*45f:[	 ]+66 4c 0f 7e c0[	 ]+movd[	 ]+%xmm8,%rax[	 ]*(#.*)*
+[	 ]*464:[	 ]+66 48 0f 7e f8[	 ]+movd[	 ]+%xmm7,%rax[	 ]*(#.*)*
+[	 ]*469:[	 ]+66 49 0f 7e f8[	 ]+movd[	 ]+%xmm7,%r8[	 ]*(#.*)*
 [	 *]...
--- binutils-2.13.90.0.16/opcodes/i386-dis.c.x86_64-disasm-movd	2002-11-26 12:20:33.000000000 -0500
+++ binutils-2.13.90.0.16/opcodes/i386-dis.c	2003-02-03 18:35:25.000000000 -0500
@@ -878,7 +878,7 @@ static const struct dis386 dis386_twobyt
   { "packssdw",		MX, EM, XX },
   { PREGRP26 },
   { PREGRP24 },
-  { "movd",		MX, Ed, XX },
+  { "movd",		MX, Ev, XX },
   { PREGRP19 },
   /* 70 */
   { PREGRP22 },
@@ -1611,9 +1611,9 @@ static const struct dis386 prefix_user_t
   },
   /* PREGRP23 */
   {
-    { "movd", Ed, MX, XX },
+    { "movd", Ev, MX, XX },
     { "movq", XM, EX, XX },
-    { "movd", Ed, XM, XX },
+    { "movd", Ev, XM, XX },
     { "(bad)", Ed, XM, XX },
   },
   /* PREGRP24 */
@@ -3003,7 +3003,8 @@ OP_E (bytemode, sizeflag)
 	  USED_REX (REX_MODE64);
 	  if (rex & REX_MODE64)
 	    oappend (names64[rm + add]);
-	  else if (sizeflag & DFLAG)
+	  else if ((sizeflag & DFLAG)
+	           || (codep[-2] == 0x6E || codep[-2] == 0x7E) /* movd */)
 	    oappend (names32[rm + add]);
 	  else
 	    oappend (names16[rm + add]);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]