This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: allow suffix-less movzw and 64-bit movzb
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 30 Jun 2016 04:26:43 -0700
- Subject: Re: [PATCH] x86: allow suffix-less movzw and 64-bit movzb
- Authentication-results: sourceware.org; auth=none
- References: <5775139D02000078000FA084 at prv-mh dot provo dot novell dot com>
On Thu, Jun 30, 2016 at 3:42 AM, Jan Beulich <JBeulich@suse.com> wrote:
> ... 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.
>
> gas/testsuite/
> 2016-06-30 Jan Beulich <jbeulich@suse.com>
>
> * gas/i386/movz.s: New.
> * gas/i386/movz32.d: New.
> * gas/i386/movz64.d: New.
> * gas/i386/i386.exp: Run new tests. Invoke as for 64-bits tests
> with "--defsym x86_64=1 --strip-local-absolute".
>
> opcodes/
> 2016-06-30 Jan Beulich <jbeulich@suse.com>
>
> * i386-opc.tbl (movzbl, movzbw, movzbq, movzwl, movzwq): Remove.
> (movzb): Adjust to cover all permitted suffixes.
> (movzw): New.
> * i386-tbl.h: Re-generate.
>
> --- 2016-06-30/gas/testsuite/gas/i386/i386.exp 2016-06-30 11:25:50.000000000 +0200
> +++ 2016-06-30/gas/testsuite/gas/i386/i386.exp 2016-06-30 12:04:26.000000000 +0200
> @@ -59,6 +59,7 @@ if [expr ([istarget "i*86-*-*"] || [ist
> 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"
> @@ -482,7 +483,7 @@ if [expr ([istarget "i*86-*-*"] || [ista
>
> global ASFLAGS
> set old_ASFLAGS "$ASFLAGS"
> - set ASFLAGS "$ASFLAGS --64"
> + set ASFLAGS "$ASFLAGS --64 --defsym x86_64=1 --strip-local-absolute"
>
> run_dump_test "x86_64"
> run_dump_test "x86_64-intel"
> @@ -506,6 +507,7 @@ if [expr ([istarget "i*86-*-*"] || [ista
> 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"
> --- 2016-06-30/gas/testsuite/gas/i386/movz.s 1970-01-01 01:00:00.000000000 +0100
> +++ 2016-06-30/gas/testsuite/gas/i386/movz.s 2016-06-30 12:04:26.000000000 +0200
> @@ -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
> --- 2016-06-30/gas/testsuite/gas/i386/movz32.d 1970-01-01 01:00:00.000000000 +0100
> +++ 2016-06-30/gas/testsuite/gas/i386/movz32.d 2016-06-30 12:04:26.000000000 +0200
> @@ -0,0 +1,22 @@
> +#objdump: -d
> +#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
^
What is `?' for?
--
H.J.