This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Invalid movzx instruction in GAS-2.11.2
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Cc: bug-binutils at gnu dot org
- Date: Mon, 8 Jul 2002 20:09:37 +0930
- Subject: Re: Invalid movzx instruction in GAS-2.11.2
- References: <20020708000850.A9812@gkminix.han.de> <20020708100514.GR30362@bubble.sa.bigpond.net.au>
On Mon, Jul 08, 2002 at 07:35:14PM +0930, Alan Modra wrote:
> On Mon, Jul 08, 2002 at 12:08:50AM +0200, Gero Kuhlmann wrote:
> > .intel_syntax noprefix
> > .arch i386
> > .code16
> > .text
> >
> > label1:
> > movzx eax,word ptr [somevar]
> >
> > somevar: .word 0
> > ====================================================================
> >
> > It should produce '66 0F B7 06 xx xx' with 'xx xx' being the address
>
> Indeed. Fixed like this:
>
> gas/ChangeLog
> * config/tc-i386.c (process_suffix): Remove intel mode movsx and
> movzx fudges.
> (md_assemble): Instead, zap the suffix here.
>
> include/opcode/ChangeLog
> * i386.h: Remove IgnoreSize from movsx and movzx.
And an addition to the testsuite.
* gas/i386/intel16.s: New.
* gas/i386/intel16.d: New.
* gas/i386/i386.exp: Run it.
Index: gas/testsuite/gas/i386/i386.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/i386.exp,v
retrieving revision 1.14
diff -u -p -r1.14 i386.exp
--- gas/testsuite/gas/i386/i386.exp 23 May 2002 13:12:50 -0000 1.14
+++ gas/testsuite/gas/i386/i386.exp 8 Jul 2002 10:34:04 -0000
@@ -46,6 +46,7 @@ if [expr ([istarget "i*86-*-*"] || [ist
run_dump_test "naked"
run_dump_test "opcode"
run_dump_test "intel"
+ run_dump_test "intel16"
run_dump_test "prefix"
run_dump_test "amd"
run_dump_test "katmai"
Index: gas/testsuite/gas/i386/intel16.d
===================================================================
RCS file: gas/testsuite/gas/i386/intel16.d
diff -N gas/testsuite/gas/i386/intel16.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/i386/intel16.d 8 Jul 2002 10:34:04 -0000
@@ -0,0 +1,15 @@
+#objdump: -dw -mi8086
+#name: i386 intel16
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+000 <.text>:
+ 0: 66 0f bf 06 00 00 [ ]*movswl 0,%eax
+ 6: 66 0f be 06 00 00 [ ]*movsbl 0,%eax
+ c: 0f be 06 00 00 [ ]*movsbw 0,%ax
+ 11: 66 0f b7 06 00 00 [ ]*movzwl 0,%eax
+ 17: 66 0f b6 06 00 00 [ ]*movzbl 0,%eax
+ 1d: 0f b6 06 00 00 [ ]*movzbw 0,%ax
+ ...
Index: gas/testsuite/gas/i386/intel16.s
===================================================================
RCS file: gas/testsuite/gas/i386/intel16.s
diff -N gas/testsuite/gas/i386/intel16.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/i386/intel16.s 8 Jul 2002 10:34:04 -0000
@@ -0,0 +1,11 @@
+ .intel_syntax noprefix
+ .code16
+ .text
+
+ movsx eax,word ptr [0]
+ movsx eax,byte ptr [0]
+ movsx ax,byte ptr [0]
+ movzx eax,word ptr [0]
+ movzx eax,byte ptr [0]
+ movzx ax,byte ptr [0]
+ .p2align 4,0
--
Alan Modra
IBM OzLabs - Linux Technology Centre