summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-06-12 18:55:44 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-06-12 18:55:44 +0000
commit46e883c5a969e151f282e0bf555cbd27bf10b66e (patch)
tree414a85d371f1eab1fbb2f9229bdb6123c1c72b74 /gas
parent4e9d3b813b857193778390d2a0f56000215bbab0 (diff)
downloadbinutils-gdb-46e883c5a969e151f282e0bf555cbd27bf10b66e.tar.gz
gas/
2006-06-12 H.J. Lu <hongjiu.lu@intel.com> * config/tc-i386.c (process_suffix): Don't add rex64 for "xchg %rax,%rax". gas/testsuite/ 2006-06-12 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 %ax,%ax, xchg %eax,%eax, xchg %rax,%rax, rex64 xchg %rax,%rax and xchg %rax,%r8. * gas/i386/x86-64-opcode.d: Updated. include/opcode/ 2006-06-12 H.J. Lu <hongjiu.lu@intel.com> * i386.h (i386_optab): Update comment for 64bit NOP. opcodes/ 2006-06-12 H.J. Lu <hongjiu.lu@intel.com> * i386-dis.c (NOP_Fixup): Removed. (NOP_Fixup1): New. (NOP_Fixup2): Likewise. (dis386): Use NOP_Fixup1 and NOP_Fixup2 on 0x90.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c10
-rw-r--r--gas/testsuite/ChangeLog9
-rw-r--r--gas/testsuite/gas/i386/opcode.d1
-rw-r--r--gas/testsuite/gas/i386/opcode.s2
-rw-r--r--gas/testsuite/gas/i386/x86-64-opcode.d9
-rw-r--r--gas/testsuite/gas/i386/x86-64-opcode.s8
7 files changed, 40 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a225bb09aa7..72942724ea5 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/tc-i386.c (process_suffix): Don't add rex64 for
+ "xchg %rax,%rax".
+
2006-06-09 Thiemo Seufer <ths@mips.com>
* config/tc-mips.c (mips_ip): Maintain argument count.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 694618f06c0..4a469088ce6 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2615,7 +2615,15 @@ process_suffix (void)
if (i.suffix == QWORD_MNEM_SUFFIX
&& flag_code == CODE_64BIT
&& (i.tm.opcode_modifier & NoRex64) == 0)
- i.rex |= REX_MODE64;
+ {
+ /* Special case for xchg %rax,%rax. It is NOP and doesn't
+ need rex64. */
+ if (i.operands != 2
+ || i.types [0] != (Acc | Reg64)
+ || i.types [1] != (Acc | Reg64)
+ || strcmp (i.tm.name, "xchg") != 0)
+ i.rex |= REX_MODE64;
+ }
/* Size floating point instruction. */
if (i.suffix == LONG_MNEM_SUFFIX)
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 1fd5057499b..2b16921e0bd 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-12 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 %ax,%ax, xchg %eax,%eax,
+ xchg %rax,%rax, rex64 xchg %rax,%rax and xchg %rax,%r8.
+ * gas/i386/x86-64-opcode.d: Updated.
+
2006-06-09 Thiemo Seufer <ths@mips.com>
Nigel Stephens <nigel@mips.com>
diff --git a/gas/testsuite/gas/i386/opcode.d b/gas/testsuite/gas/i386/opcode.d
index 808ddc5371a..fa58807c5ef 100644
--- a/gas/testsuite/gas/i386/opcode.d
+++ b/gas/testsuite/gas/i386/opcode.d
@@ -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
\.\.\.
diff --git a/gas/testsuite/gas/i386/opcode.s b/gas/testsuite/gas/i386/opcode.s
index 8d7cd050f16..a03ce13099f 100644
--- a/gas/testsuite/gas/i386/opcode.s
+++ b/gas/testsuite/gas/i386/opcode.s
@@ -566,5 +566,7 @@ foo:
movsbw 0x90909090(%eax),%dx
xadd %dx,0x90909090(%eax)
+ xchg %ax,%ax
+
# Force a good alignment.
.p2align 4,0
diff --git a/gas/testsuite/gas/i386/x86-64-opcode.d b/gas/testsuite/gas/i386/x86-64-opcode.d
index 13d58be1bdb..f6427d4e00d 100644
--- a/gas/testsuite/gas/i386/x86-64-opcode.d
+++ b/gas/testsuite/gas/i386/x86-64-opcode.d
@@ -266,6 +266,9 @@ 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]+:[ ]+00 00[ ]+.*
-[ *]...
+[ ]*[0-9a-f]+:[ ]+66 90[ ]+xchg[ ]+%ax,%ax[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+87 c0[ ]+xchg[ ]+%eax,%eax[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+90[ ]+nop[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+48 90[ ]+rex64 nop[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+49 90[ ]+xchg[ ]+%rax,%r8[ ]*(#.*)*
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-opcode.s b/gas/testsuite/gas/i386/x86-64-opcode.s
index 8b132b39046..8d3de00a8e6 100644
--- a/gas/testsuite/gas/i386/x86-64-opcode.s
+++ b/gas/testsuite/gas/i386/x86-64-opcode.s
@@ -387,4 +387,12 @@
# IN
+
+
+ xchg %ax,%ax # 66 -- -- -- 90
+ xchg %eax,%eax # -- -- -- -- 87 C0
+ xchg %rax,%rax # -- -- -- -- 90
+ rex64 xchg %rax,%rax # 48 -- -- -- 90
+ xchg %rax,%r8 # -- -- -- 49 90
+
.p2align 4,0