This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] x86: Document movsx/movsxd/movzx for AT&T syntax
On Fri, Feb 14, 2020 at 3:50 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 13.02.2020 18:04, H.J. Lu wrote:
> > On Thu, Feb 13, 2020 at 9:00 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>
> >> On 13.02.2020 17:57, H.J. Lu wrote:
> >>> On Thu, Feb 13, 2020 at 8:49 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>>>
> >>>> On 13.02.2020 17:39, H.J. Lu wrote:
> >>>>> If a project checks assembler warnings, it will fail to build with
> >>>>> the new assembler. We don't want it.
> >>>>
> >>>> That's the case for all other new warnings, too. H.J., come on - there
> >>>> shouldn't be arbitrary / random differences in behavior. Things should
> >>>> be predictable for people.
> >>>
> >>> That is one reason I'd like to see new errors, not new warnings.
> >>
> >> I.e. to break the build for everyone when we detect issues in their
> >> that we previously didn't detect? That's precisely why things should
> >> be warnings at least initially, to give people time to fix their
> >> code without forcing them to do so right away.
> >
> > For this particular case, there is no issue.
>
> How do you know?
Assembler has been this way from the start. I am checking in
this patch to document different mnemonics of movsx, movsxd
and movzx in AT&T syntax.
> In the interest of avoiding to have the full patch blocked by you,
> I guess I'll make the adjustment (perhaps by splitting out the
> controversial part once again). But it's entirely bogus to do so,
> and normally I wouldn't even want to put my name under such a
> thing. I'll make this quite clear in the commit message and/or
> the code comment.
>
> Jan
--
H.J.
From bb6490b47dd7aaeed70f05b986c1d1c94fff6cf9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 14 Feb 2020 04:18:30 -0800
Subject: [PATCH] x86: Document movsx/movsxd/movzx for AT&T syntax
Document different mnemonics of movsx, movsxd and movzx in AT&T syntax.
PR gas/25438
* doc/c-i386.texi: Document movsx, movsxd and movzx for AT&T
syntax.
---
gas/doc/c-i386.texi | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 4eaf53311fd..dc685c7c212 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -835,6 +835,49 @@ are called @samp{cbtw}, @samp{cwtl}, @samp{cwtd}, @samp{cltd}, @samp{cltq}, and
@samp{cqto} in AT&T naming. @code{@value{AS}} accepts either naming for these
instructions.
+@cindex extension instructions, i386
+@cindex i386 extension instructions
+@cindex extension instructions, x86-64
+@cindex x86-64 extension instructions
+The Intel-syntax extension instructions
+
+@itemize @bullet
+@item
+@samp{movsx} --- sign-extend @samp{reg8/mem8} to @samp{reg16}.
+
+@samp{movsx} --- sign-extend @samp{reg8/mem8} to @samp{reg32}.
+
+@samp{movsx} --- sign-extend @samp{reg8/mem8} to @samp{reg64}
+(x86-64 only).
+
+@samp{movsx} --- sign-extend @samp{reg16/mem16} to @samp{reg32}
+
+@samp{movsx} --- sign-extend @samp{reg16/mem16} to @samp{reg64}
+(x86-64 only).
+
+@samp{movsxd} --- sign-extend @samp{reg32/mem32} to @samp{reg64}
+(x86-64 only).
+
+@samp{movzx} --- zero-extend @samp{reg8/mem8} to @samp{reg16}.
+
+@samp{movzx} --- zero-extend @samp{reg8/mem8} to @samp{reg32}.
+
+@samp{movzx} --- zero-extend @samp{reg8/mem8} to @samp{reg64}
+(x86-64 only).
+
+@samp{movzx} --- zero-extend @samp{reg16/mem16} to @samp{reg32}
+
+@samp{movzx} --- zero-extend @samp{reg16/mem16} to @samp{reg64}
+(x86-64 only).
+@end itemize
+
+@noindent
+are called @samp{movsbw/movsxb/movsx}, @samp{movsbl/movsxb/movsx},
+@samp{movsbq/movsb/movsx}, @samp{movswl/movsxw}, @samp{movswq/movsxw},
+@samp{movslq/movsxl}, @samp{movzbw/movzxb/movzx},
+@samp{movzbl/movzxb/movzx}, @samp{movzbq/movzxb/movzx},
+@samp{movzwl/movzxw} and @samp{movzwq/movzxw} in AT&T syntax.
+
@cindex jump instructions, i386
@cindex call instructions, i386
@cindex jump instructions, x86-64
--
2.24.1