This is the mail archive of the binutils@sourceware.org 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: PR gas/4027: objdump and as disgree on "test %eax,%ebx"


The real instruction is

test Reg, Reg|AnyMem,

and the pseudo one is

test Reg|AnyMem, Reg,

which is treated as

test Reg, Reg|AnyMem,

since there is no difference in results. But objdump doesn't know
about the pseudo instruction. I am checking in this patch to move
the real instruction before the pseudo one.


H.J.
---
gas/testsuite/

2007-02-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR gas/4027
	* gas/i386/opcode.s: Add more tests for "test".

	* i386/opcode-intel.d: Updated.
	* gas/i386/opcode-suffix.d: Likewise.
	* gas/i386/opcode.d: Likewise.

include/opcode/

2007-02-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR gas/4027
	* i386.h (i386_optab): Put the real "test" before the pseudo one.

--- binutils/gas/testsuite/gas/i386/opcode-intel.d.test	2006-12-29 13:48:59.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/opcode-intel.d	2007-02-11 20:32:03.000000000 -0800
@@ -608,4 +608,8 @@ Disassembly of section .text:
  *[0-9a-f]+:	0f 00 08[ 	]+str[ 	]+(WORD PTR )?\[eax\]
  *[0-9a-f]+:	0f ad d0 [ 	]*shrd[ 	]+eax,edx,cl
  *[0-9a-f]+:	0f a5 d0 [ 	]*shld[ 	]+eax,edx,cl
+ *[0-9a-f]+:	85 c3 [ 	]*test[ 	]+ebx,eax
+ *[0-9a-f]+:	85 d8 [ 	]*test[ 	]+eax,ebx
+ *[0-9a-f]+:	85 18 [ 	]*test[ 	]+(DWORD PTR )?\[eax\],ebx
+#pass
 	\.\.\.
--- binutils/gas/testsuite/gas/i386/opcode-suffix.d.test	2006-12-29 13:48:59.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/opcode-suffix.d	2007-02-11 20:32:23.000000000 -0800
@@ -585,4 +585,7 @@ Disassembly of section .text:
  *[0-9a-f]+:	0f 00 08[ 	]+strw[ 	]+\(%eax\)
  *[0-9a-f]+:	0f ad d0 [ 	]*shrdl[ 	]+%cl,%edx,%eax
  *[0-9a-f]+:	0f a5 d0 [ 	]*shldl[ 	]+%cl,%edx,%eax
-	\.\.\.
+ *[0-9a-f]+:	85 c3 [ 	]*testl[ 	]+%eax,%ebx
+ *[0-9a-f]+:	85 d8 [ 	]*testl[ 	]+%ebx,%eax
+ *[0-9a-f]+:	85 18 [ 	]*testl[ 	]+%ebx,\(%eax\)
+#pass
--- binutils/gas/testsuite/gas/i386/opcode.d.test	2006-12-29 13:48:59.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/opcode.d	2007-02-11 20:31:31.000000000 -0800
@@ -584,4 +584,7 @@ Disassembly of section .text:
  9ec:	0f 00 08 [ 	]*str    \(%eax\)
  9ef:	0f ad d0 [ 	]*shrd   %cl,%edx,%eax
  9f2:	0f a5 d0 [ 	]*shld   %cl,%edx,%eax
-	\.\.\.
+ 9f5:	85 c3 [ 	]*test   %eax,%ebx
+ 9f7:	85 d8 [ 	]*test   %ebx,%eax
+ 9f9:	85 18 [ 	]*test   %ebx,\(%eax\)
+#pass
--- binutils/gas/testsuite/gas/i386/opcode.s.test	2006-12-29 13:48:59.000000000 -0800
+++ binutils/gas/testsuite/gas/i386/opcode.s	2007-02-11 20:28:52.000000000 -0800
@@ -581,5 +581,9 @@ foo:
  shrd   %cl,%edx,%eax
  shld   %cl,%edx,%eax
 
+ test   %eax,%ebx
+ test   %ebx,%eax
+ test   (%eax),%ebx
+
 # Force a good alignment.
  .p2align 4,0
--- binutils/include/opcode/i386.h.test	2006-12-11 13:47:18.000000000 -0800
+++ binutils/include/opcode/i386.h	2007-02-11 20:17:38.000000000 -0800
@@ -251,8 +251,8 @@ static const template i386_optab[] =
 {"cmp",	   2,	0x3c, X, 0,	 bwlq_Suf|W,		{ EncImm, Acc, 0} },
 {"cmp",	   2,	0x80, 7, 0,	 bwlq_Suf|W|Modrm,	{ EncImm, Reg|AnyMem, 0} },
 
-{"test",   2,	0x84, X, 0,	 bwlq_Suf|W|Modrm,	{ Reg|AnyMem, Reg, 0} },
 {"test",   2,	0x84, X, 0,	 bwlq_Suf|W|Modrm,	{ Reg, Reg|AnyMem, 0} },
+{"test",   2,	0x84, X, 0,	 bwlq_Suf|W|Modrm,	{ AnyMem, Reg, 0} },
 {"test",   2,	0xa8, X, 0,	 bwlq_Suf|W,		{ EncImm, Acc, 0} },
 {"test",   2,	0xf6, 0, 0,	 bwlq_Suf|W|Modrm,	{ EncImm, Reg|AnyMem, 0} },
 


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