aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2016-07-01 09:01:41 +0200
committerJan Beulich <jbeulich@suse.com>2016-07-01 09:01:41 +0200
commitc07315e0c610e0e3317b4c02266f81793df253d2 (patch)
tree5f1eefeefc8e0af00809dc03fcd28816395e7bef /gas
parent9243100aef7486524f1a7f87bbd2cce1fe980b75 (diff)
downloadgdb-c07315e0c610e0e3317b4c02266f81793df253d2.zip
gdb-c07315e0c610e0e3317b4c02266f81793df253d2.tar.gz
gdb-c07315e0c610e0e3317b4c02266f81793df253d2.tar.bz2
x86: allow suffix-less movzw and 64-bit movzb
... just like is already the case for 16- and 32-bit movzb: I can't see why omitting suffixes on this (and movs{b,w,l}) is not allowed, when it is allowed for all other instructions where the suffix is redundant with (one of) the operands.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/testsuite/gas/i386/i386.exp2
-rw-r--r--gas/testsuite/gas/i386/movz.s33
-rw-r--r--gas/testsuite/gas/i386/movz32.d22
-rw-r--r--gas/testsuite/gas/i386/movz64.d30
5 files changed, 94 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a654185..db25ef2 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,12 @@
2016-07-01 Jan Beulich <jbeulich@suse.com>
+ * testsuite/gas/i386/movz.s: New.
+ * testsuite/gas/i386/movz32.d: New.
+ * testsuite/gas/i386/movz64.d: New.
+ * testsuite/gas/i386/i386.exp: Run new tests.
+
+2016-07-01 Jan Beulich <jbeulich@suse.com>
+
* config/tc-i386.c (struct _i386_insn): New field memop1_string.
(md_assemble): Free first memory operand string.
(i386_index_check): Use repprefixok to distingush xlat from
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 393910c..871004b 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -59,6 +59,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "amd"
run_dump_test "katmai"
run_dump_test "jump"
+ run_dump_test "movz32"
run_dump_test "relax-1"
run_dump_test "relax-2"
run_dump_test "ssemmx2"
@@ -507,6 +508,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-segovr"
run_list_test "x86-64-inval-seg" "-al"
run_dump_test "x86-64-branch"
+ run_dump_test "movz64"
run_dump_test "x86-64-relax-1"
run_dump_test "svme64"
run_dump_test "x86-64-amdfam10"
diff --git a/gas/testsuite/gas/i386/movz.s b/gas/testsuite/gas/i386/movz.s
new file mode 100644
index 0000000..108be75
--- /dev/null
+++ b/gas/testsuite/gas/i386/movz.s
@@ -0,0 +1,33 @@
+ .text
+movz:
+ movzb %al,%ax
+ movzb (%eax),%ax
+ movzb %al,%eax
+ movzb (%eax),%eax
+.ifdef x86_64
+ movzb %al,%rax
+ movzb (%rax),%rax
+.endif
+
+ movzbw %al,%ax
+ movzbw (%eax),%ax
+ movzbl %al,%eax
+ movzbl (%eax),%eax
+.ifdef x86_64
+ movzbq %al,%rax
+ movzbq (%rax),%rax
+.endif
+
+ movzw %ax,%eax
+ movzw (%eax),%eax
+.ifdef x86_64
+ movzw %ax,%rax
+ movzw (%rax),%rax
+.endif
+
+ movzwl %ax,%eax
+ movzwl (%eax),%eax
+.ifdef x86_64
+ movzwq %ax,%rax
+ movzwq (%rax),%rax
+.endif
diff --git a/gas/testsuite/gas/i386/movz32.d b/gas/testsuite/gas/i386/movz32.d
new file mode 100644
index 0000000..592baa0
--- /dev/null
+++ b/gas/testsuite/gas/i386/movz32.d
@@ -0,0 +1,22 @@
+#objdump: -dw
+#source: movz.s
+#name: x86 mov with zero-extend (32-bit object)
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <movz>:
+[ ]*[a-f0-9]+: 66 0f b6 c0 * movzbw %al,%ax
+[ ]*[a-f0-9]+: 66 0f b6 00 * movzbw \(%eax\),%ax
+[ ]*[a-f0-9]+: 0f b6 c0 * movzbl %al,%eax
+[ ]*[a-f0-9]+: 0f b6 00 * movzbl \(%eax\),%eax
+[ ]*[a-f0-9]+: 66 0f b6 c0 * movzbw %al,%ax
+[ ]*[a-f0-9]+: 66 0f b6 00 * movzbw \(%eax\),%ax
+[ ]*[a-f0-9]+: 0f b6 c0 * movzbl %al,%eax
+[ ]*[a-f0-9]+: 0f b6 00 * movzbl \(%eax\),%eax
+[ ]*[a-f0-9]+: 0f b7 c0 * movzwl %ax,%eax
+[ ]*[a-f0-9]+: 0f b7 00 * movzwl \(%eax\),%eax
+[ ]*[a-f0-9]+: 0f b7 c0 * movzwl %ax,%eax
+[ ]*[a-f0-9]+: 0f b7 00 * movzwl \(%eax\),%eax
+#pass
diff --git a/gas/testsuite/gas/i386/movz64.d b/gas/testsuite/gas/i386/movz64.d
new file mode 100644
index 0000000..d8ec2ba
--- /dev/null
+++ b/gas/testsuite/gas/i386/movz64.d
@@ -0,0 +1,30 @@
+#objdump: -dw
+#source: movz.s
+#name: x86 mov with zero-extend (64-bit object)
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <movz>:
+[ ]*[a-f0-9]+: 66 0f b6 c0 * movzbw %al,%ax
+[ ]*[a-f0-9]+: 67 66 0f b6 00 * movzbw \(%eax\),%ax
+[ ]*[a-f0-9]+: 0f b6 c0 * movzbl %al,%eax
+[ ]*[a-f0-9]+: 67 0f b6 00 * movzbl \(%eax\),%eax
+[ ]*[a-f0-9]+: 48 0f b6 c0 * movzbq %al,%rax
+[ ]*[a-f0-9]+: 48 0f b6 00 * movzbq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f b6 c0 * movzbw %al,%ax
+[ ]*[a-f0-9]+: 67 66 0f b6 00 * movzbw \(%eax\),%ax
+[ ]*[a-f0-9]+: 0f b6 c0 * movzbl %al,%eax
+[ ]*[a-f0-9]+: 67 0f b6 00 * movzbl \(%eax\),%eax
+[ ]*[a-f0-9]+: 48 0f b6 c0 * movzbq %al,%rax
+[ ]*[a-f0-9]+: 48 0f b6 00 * movzbq \(%rax\),%rax
+[ ]*[a-f0-9]+: 0f b7 c0 * movzwl %ax,%eax
+[ ]*[a-f0-9]+: 67 0f b7 00 * movzwl \(%eax\),%eax
+[ ]*[a-f0-9]+: 48 0f b7 c0 * movzwq %ax,%rax
+[ ]*[a-f0-9]+: 48 0f b7 00 * movzwq \(%rax\),%rax
+[ ]*[a-f0-9]+: 0f b7 c0 * movzwl %ax,%eax
+[ ]*[a-f0-9]+: 67 0f b7 00 * movzwl \(%eax\),%eax
+[ ]*[a-f0-9]+: 48 0f b7 c0 * movzwq %ax,%rax
+[ ]*[a-f0-9]+: 48 0f b7 00 * movzwq \(%rax\),%rax
+#pass