This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: i386: Document memory size reference in assembler
- From: "Jan Beulich" <JBeulich at suse dot com>
- To: "Lili Cui" <lili dot cui at intel dot com>
- Cc: "Annita Zhang" <annita dot zhang at intel dot com>, "Hongjiu Lu" <hongjiu dot lu at intel dot com>, "Hongtao Liu" <hongtao dot liu at intel dot com>, "Wei3 Xiao" <wei3 dot xiao at intel dot com>,<binutils at sourceware dot org>
- Date: Mon, 24 Jun 2019 01:05:09 -0600
- Subject: Re: i386: Document memory size reference in assembler
- References: <B1254C1F3D65A641B4143C8E9793D9FD481580DF@shsmsx102.ccr.corp.intel.com>
>>> On 24.06.19 at 05:30, <lili.cui@intel.com> wrote:
> --- a/gas/doc/c-i386.texi
> +++ b/gas/doc/c-i386.texi
> @@ -583,12 +583,16 @@ instruction, do @emph{not} have reversed order.
> @ref{i386-Bugs}.
> @item
> In AT&T syntax the size of memory operands is determined from the last
> character of the instruction mnemonic. Mnemonic suffixes of @samp{b},
> -@samp{w}, @samp{l} and @samp{q} specify byte (8-bit), word (16-bit), long
> -(32-bit) and quadruple word (64-bit) memory references. Intel syntax accomplishes
> -this by prefixing memory operands (@emph{not} the instruction mnemonics) with
> -@samp{byte ptr}, @samp{word ptr}, @samp{dword ptr} and @samp{qword ptr}. Thus,
> -Intel @samp{mov al, byte ptr @var{foo}} is @samp{movb @var{foo}, %al} in AT&T
> -syntax.
> +@samp{w}, @samp{l}, @samp{q}, @samp{x}, @samp{y} and @samp{z} specify
> +byte (8-bit), word (16-bit), long (32-bit), quadruple word (64-bit),
> +xmm (128-bit vector), ymm (256-bit vector) and zmm (512-bit vector)
> +memory references. Intel syntax accomplishes this by prefixing memory
> +operands (@emph{not}the instruction mnemonics) with @samp{byte ptr},
> +@samp{word ptr}, @samp{dword ptr}, @samp{qword ptr}, @samp{xmmword ptr},
> +@samp{ymmword ptr} and @samp{zmmword ptr}. Thus, Intel syntax
> +@samp{mov al, byte ptr @var{foo}} is @samp{movb @var{foo}, %al} in
> +AT&T syntax. In Intel syntax, @samp{fword ptr}, @samp{tword ptr} and
> +@samp{oword ptr} specify 48-bit, 80-bit and 128-bit memory references.
This makes it sound as if the x/y/z suffixes were universally applicable,
just like the b/w/d/q ones are, but that's not the case: They're used
(permitted) only when there's no other way to disambiguate an insn.
Jan