summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-03-21 20:45:14 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-03-21 20:45:14 +0000
commit8b38ad713b4d7d3cf34d59efcdeb562cad46b364 (patch)
tree5dbe615ac85a15bd01cc0c6cacf1c3933e3f3571 /gas
parentffa8bd48e33d601fc4fccc3ad14449c80483daa2 (diff)
downloadbinutils-gdb-8b38ad713b4d7d3cf34d59efcdeb562cad46b364.tar.gz
gas/
2003-03-21 H.J. Lu <hongjiu.lu@intel.com> PR binutils/4218 * config/tc-i386.c (match_template): Properly handle 64bit mode "xchg %eax, %eax". gas/testsuite/ 2003-03-21 H.J. Lu <hongjiu.lu@intel.com> PR binutils/4218 * gas/i386/nops.s: Add testcases for nop r/m. * gas/i386/x86-64-nops.s: Likewise. * gas/i386/x86-64-opcode.s: Add testcases for xchg with %ax, %eax and %rax. * gas/i386/nops.d: Updated. * gas/i386/x86-64-nops.d: Likewise. * gas/i386/x86-64-opcode.d: Likewise. opcodes/ 2003-03-21 H.J. Lu <hongjiu.lu@intel.com> PR binutils/4218 * i386-dis.c (PREGRP38): New. (dis386): Use PREGRP38 for 0x90. (prefix_user_table): Add PREGRP38. (print_insn): Set uses_REPZ_prefix to 1 for pause. (NOP_Fixup1): Properly handle REX bits. (NOP_Fixup2): Likewise. * i386-opc.c (i386_optab): Allow %eax with xchg in 64bit. Allow register with nop.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-i386.c9
-rw-r--r--gas/testsuite/ChangeLog13
-rw-r--r--gas/testsuite/gas/i386/nops.d7
-rw-r--r--gas/testsuite/gas/i386/nops.s8
-rw-r--r--gas/testsuite/gas/i386/x86-64-nops.d20
-rw-r--r--gas/testsuite/gas/i386/x86-64-nops.s21
-rw-r--r--gas/testsuite/gas/i386/x86-64-opcode.d10
-rw-r--r--gas/testsuite/gas/i386/x86-64-opcode.s10
9 files changed, 104 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ca2f6dd2614..01ac7bf0db0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/4218
+ * config/tc-i386.c (match_template): Properly handle 64bit mode
+ "xchg %eax, %eax".
+
2007-03-21 Anton Ertl <anton@mips.complang.tuw>
PR gas/4124
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 63d95fa2c71..c3da74a6fcf 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2621,6 +2621,15 @@ match_template (void)
continue;
break;
case 2:
+ /* xchg %eax, %eax is a special case. It is an aliase for nop
+ only in 32bit mode and we can use opcode 0x90. In 64bit
+ mode, we can't use 0x90 for xchg %eax, %eax since it should
+ zero-extend %eax to %rax. */
+ if (flag_code == CODE_64BIT
+ && t->base_opcode == 0x90
+ && i.types [0] == (Acc | Reg32)
+ && i.types [1] == (Acc | Reg32))
+ continue;
case 3:
case 4:
overlap1 = i.types[1] & operand_types[1];
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e7024ee4f25..48425b14687 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,18 @@
2003-03-21 H.J. Lu <hongjiu.lu@intel.com>
+ PR binutils/4218
+ * gas/i386/nops.s: Add testcases for nop r/m.
+ * gas/i386/x86-64-nops.s: Likewise.
+
+ * gas/i386/x86-64-opcode.s: Add testcases for xchg with %ax,
+ %eax and %rax.
+
+ * gas/i386/nops.d: Updated.
+ * gas/i386/x86-64-nops.d: Likewise.
+ * gas/i386/x86-64-opcode.d: Likewise.
+
+2003-03-21 H.J. Lu <hongjiu.lu@intel.com>
+
* gas/i386/i386.exp: Run nops-3.
* gas/i386/nops-3.d: New file.
diff --git a/gas/testsuite/gas/i386/nops.d b/gas/testsuite/gas/i386/nops.d
index 74eaf86e2df..dc01585a69d 100644
--- a/gas/testsuite/gas/i386/nops.d
+++ b/gas/testsuite/gas/i386/nops.d
@@ -14,4 +14,11 @@ Disassembly of section .text:
[ ]*19:[ ]+0f 1f 84 00 00 00 00 00[ ]+nopl[ ]+0x0\(%eax,%eax,1\)
[ ]*21:[ ]+66 0f 1f 84 00 00 00 00 00[ ]+nopw[ ]+0x0\(%eax,%eax,1\)
[ ]*2a:[ ]+66 2e 0f 1f 84 00 00 00 00 00[ ]+nopw[ ]+%cs:0x0\(%eax,%eax,1\)
+[ ]*34:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
+[ ]*37:[ ]+0f 1f c0[ ]+nop[ ]+%eax
+[ ]*3a:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
+[ ]*3e:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
+[ ]*41:[ ]+66 0f 1f 00[ ]+nopw[ ]+\(%eax\)
+[ ]*45:[ ]+0f 1f c0[ ]+nop[ ]+%eax
+[ ]*48:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
#pass
diff --git a/gas/testsuite/gas/i386/nops.s b/gas/testsuite/gas/i386/nops.s
index e4eec093ebd..9dddb42b9ea 100644
--- a/gas/testsuite/gas/i386/nops.s
+++ b/gas/testsuite/gas/i386/nops.s
@@ -9,4 +9,12 @@
.byte 0x66, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
.byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
+ nop (%eax)
+ nop %eax
+ nop %ax
+ nopl (%eax)
+ nopw (%eax)
+ nopl %eax
+ nopw %ax
+
.p2align 4
diff --git a/gas/testsuite/gas/i386/x86-64-nops.d b/gas/testsuite/gas/i386/x86-64-nops.d
index e51c0c1f954..91636192535 100644
--- a/gas/testsuite/gas/i386/x86-64-nops.d
+++ b/gas/testsuite/gas/i386/x86-64-nops.d
@@ -14,4 +14,24 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/testsuite/gas/i386/x86-64-nops.s b/gas/testsuite/gas/i386/x86-64-nops.s
index e4eec093ebd..2268e7f5769 100644
--- a/gas/testsuite/gas/i386/x86-64-nops.s
+++ b/gas/testsuite/gas/i386/x86-64-nops.s
@@ -9,4 +9,25 @@
.byte 0x66, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
.byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
+ nop (%rax)
+ nop %rax
+ nop %eax
+ nop %ax
+ nopq (%rax)
+ nopl (%rax)
+ nopw (%rax)
+ nopq %rax
+ nopl %eax
+ nopw %ax
+ nop (%r10)
+ nop %r10
+ nop %r10d
+ nop %r10w
+ nopq (%r10)
+ nopl (%r10)
+ nopw (%r10)
+ nopq %r10
+ nopl %r10d
+ nopw %r10w
+
.p2align 4
diff --git a/gas/testsuite/gas/i386/x86-64-opcode.d b/gas/testsuite/gas/i386/x86-64-opcode.d
index d3bd17f5a76..126b3638230 100644
--- a/gas/testsuite/gas/i386/x86-64-opcode.d
+++ b/gas/testsuite/gas/i386/x86-64-opcode.d
@@ -274,6 +274,16 @@ Disassembly of section .text:
[ ]*[0-9a-f]+:[ ]+90[ ]+nop[ ]*(#.*)*
[ ]*[0-9a-f]+:[ ]+48 90[ ]+rex64 nop[ ]*(#.*)*
[ ]*[0-9a-f]+:[ ]+49 90[ ]+xchg[ ]+%rax,%r8[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+41 90[ ]+xchg[ ]+%eax,%r8d[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+41 90[ ]+xchg[ ]+%eax,%r8d[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+41 91[ ]+xchg[ ]+%eax,%r9d[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+41 91[ ]+xchg[ ]+%eax,%r9d[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+93[ ]+xchg[ ]+%eax,%ebx[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+93[ ]+xchg[ ]+%eax,%ebx[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+66 41 90[ ]+xchg[ ]+%ax,%r8w[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+66 41 90[ ]+xchg[ ]+%ax,%r8w[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+66 41 91[ ]+xchg[ ]+%ax,%r9w[ ]*(#.*)*
+[ ]*[0-9a-f]+:[ ]+66 41 91[ ]+xchg[ ]+%ax,%r9w[ ]*(#.*)*
[ ]*[0-9a-f]+:[ ]+48 0f 01 e0[ ]+smsw[ ]+%rax[ ]*(#.*)*
[ ]*[0-9a-f]+:[ ]+0f 01 e0[ ]+smsw[ ]+%eax[ ]*(#.*)*
[ ]*[0-9a-f]+:[ ]+66 0f 01 e0[ ]+smsw[ ]+%ax[ ]*(#.*)*
diff --git a/gas/testsuite/gas/i386/x86-64-opcode.s b/gas/testsuite/gas/i386/x86-64-opcode.s
index e40dc29c82c..dd373427dde 100644
--- a/gas/testsuite/gas/i386/x86-64-opcode.s
+++ b/gas/testsuite/gas/i386/x86-64-opcode.s
@@ -397,6 +397,16 @@
xchg %rax,%rax # -- -- -- -- 90
rex64 xchg %rax,%rax # -- -- -- 48 90
xchg %rax,%r8 # -- -- -- 49 90
+ xchg %eax,%r8d # -- -- -- 41 90
+ xchg %r8d,%eax # -- -- -- 41 90
+ xchg %eax,%r9d # -- -- -- 41 91
+ xchg %r9d,%eax # -- -- -- 41 91
+ xchg %ebx,%eax # -- -- -- 93
+ xchg %eax,%ebx # -- -- -- 93
+ xchg %ax,%r8w # -- -- -- 66 41 90
+ xchg %r8w,%ax # -- -- -- 66 41 90
+ xchg %ax,%r9w # -- -- -- 66 41 91
+ xchg %r9w,%ax # -- -- -- 66 41 91
smsw %rax # -- -- -- 48 0F 01 e0
smsw %eax # -- -- -- -- 0F 01 e0