public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH v8 1/2] x86: replace adhoc (partly wrong) ambiguous operand checking for MOVSX/MOVZX
Date: Fri, 14 Feb 2020 12:31:00 -0000	[thread overview]
Message-ID: <CAMe9rOo0F_93k_YDiorUO-SRqqwJ57JnkAxeHGnQxuK-O9am3A@mail.gmail.com> (raw)
In-Reply-To: <3694020d-bd85-293a-00ae-bed85ce1e676@suse.com>

On Fri, Feb 14, 2020 at 4:26 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> For these to get treatment consistent with other operand size checking
> the special logic shouldn't live in md_assemble(), but process_suffix().
> And there's more logic involved than simply zapping the suffix.
>
> Note however that MOVS[BW]* and MOVZ[BW]* still won't be fully
> consistent, due to the objection to fold MOVS* templates just like was
> done for MOVZ* in c07315e0c6 ("x86: allow suffix-less movzw and 64-bit
> movzb").

We can revisit this issue as so many things have changed in this area.

> Note further that it is against my own intentions to have MOVSX/MOVZX
> silently default to a byte source in AT&T mode. This should happen only
> when the desination register is a 16-bit one. In all other cases there
                 ^^^^^^^^^^ Typo.
> is an ambiguity, and the user should be warned. But it was explicitly
> requested for this to be done in a way inconsistent with everything
> else.
>
> Note finally that the assembler change points out (and this patch fixes)
> a wrong Intel syntax test introduced by bc31405ebb2c ("x86-64: Properly
> encode and decode movsxd"): When source code specifies a 16-bit
> destination register, disassembly expectations shouldn't have been to
> find a 32-bit one.
>
> gas/
> 2020-02-XX  Jan Beulich  <jbeulich@suse.com>
>
>         PR gas/25438
>         * config/tc-i386.c (md_assemble): Move movsx/movzx special
>         casing ...
>         (process_suffix): ... here. Consider just the first operand
>         initially.
>         (check_long_reg): Drop opcode 0x63 special case again.
>         * testsuite/gas/i386/i386.s, testsuite/gas/i386/iamcu-1.s,
>         testsuite/gas/i386/ilp32/x86-64.s, testsuite/gas/i386/x86_64.s:
>         Move ambiguous operand size tests ...
>         * testsuite/gas/i386/noreg16.s, testsuite/gas/i386/noreg32.s,
>         testsuite/gas/i386/noreg64.s: ... here.
>         * testsuite/gas/i386/i386.d, testsuite/gas/i386/i386-intel.d
>         testsuite/gas/i386/iamcu-1.d, testsuite/gas/i386/ilp32/x86-64.d,
>         testsuite/gas/i386/k1om.d, testsuite/gas/i386/l1om.d,
>         testsuite/gas/i386/movx16.l, testsuite/gas/i386/movx32.l,
>         testsuite/gas/i386/movx64.l, testsuite/gas/i386/noreg16.d,
>         testsuite/gas/i386/noreg32.d, testsuite/gas/i386/noreg64.d,
>         testsuite/gas/i386/x86-64-movsxd.d,
>         testsuite/gas/i386/x86-64-movsxd-intel.d,
>         testsuite/gas/i386/x86_64.d, testsuite/gas/i386/x86_64-intel.d:
>         Adjust expectations.
>         * testsuite/gas/i386/movx16.s, testsuite/gas/i386/movx16.l,
>         testsuite/gas/i386/movx32.s, testsuite/gas/i386/movx32.l,
>         testsuite/gas/i386/movx64.s, testsuite/gas/i386/movx64.l: New.
>         * testsuite/gas/i386/i386.exp: Run new tests.
>
> opcodes/
> 2020-02-XX  Jan Beulich  <jbeulich@suse.com>
>
>         PR gas/25438
>         * i386-opc.tbl (movsx): Fold patterns. Also allow Reg32 as
>         destination for Cpu64-only variant.
>         (movsxd): Also allow Reg32 as destination. Drop Rex64.
>         (movzx): Fold patterns.
>         * i386-tbl.h: Re-generate.

OK.

Thanks.

-- 
H.J.

  reply	other threads:[~2020-02-14 12:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 12:21 [PATCH v8 0/2] " Jan Beulich
2020-02-14 12:26 ` [PATCH v8 2/2] x86/AT&T: don't default to byte source for ambiguous " Jan Beulich
2020-02-14 12:28   ` H.J. Lu
2020-02-14 13:13     ` Jan Beulich
2020-02-14 13:54     ` Jan Beulich
2020-02-14 14:16       ` H.J. Lu
2020-02-14 14:23         ` Jan Beulich
2020-02-14 14:26           ` H.J. Lu
2020-02-14 14:32             ` Jan Beulich
2020-02-14 14:38               ` H.J. Lu
2020-02-14 15:47                 ` Jan Beulich
2020-02-14 15:52                 ` Jan Beulich
2020-02-14 16:26                   ` H.J. Lu
2020-02-14 16:36                     ` Jan Beulich
2020-02-14 16:52                       ` H.J. Lu
2020-02-17 13:44                         ` Jan Beulich
2020-02-17 14:14                           ` H.J. Lu
2020-02-17 15:37                             ` Jan Beulich
2020-02-17 16:56                               ` H.J. Lu
2020-02-17 17:04                                 ` Jan Beulich
2020-02-17 17:19                                   ` H.J. Lu
2020-02-18  7:44                                     ` Jan Beulich
2020-02-14 12:26 ` [PATCH v8 1/2] x86: replace adhoc (partly wrong) ambiguous operand checking " Jan Beulich
2020-02-14 12:31   ` H.J. Lu [this message]
2020-02-14 12:34   ` H.J. Lu
2020-02-14 12:42     ` Jan Beulich
2020-02-14 12:49       ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOo0F_93k_YDiorUO-SRqqwJ57JnkAxeHGnQxuK-O9am3A@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).