public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Hongtao Liu <crazylht@gmail.com>
Cc: Binutils <binutils@sourceware.org>, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [PATCH] x86/Intel: SHLD/SHRD have dual meaning
Date: Mon, 22 Apr 2024 08:51:46 +0200	[thread overview]
Message-ID: <563b29cc-d3b5-45b7-b354-1ca8f3a2dcf4@suse.com> (raw)
In-Reply-To: <CAMZc-byAu47UwYShHXi=y1CF5EkZ50V5cLWSvFW__K_YUbB6Kg@mail.gmail.com>

On 22.04.2024 06:09, Hongtao Liu wrote:
> On Fri, Apr 19, 2024 at 5:29 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> Since we uniformly permit D suffixes in Intel mode whenever in AT&T mode
>> an L suffix may be used, we need to be consistent with this.
> I think we need to forbid the D suffix for APX NDD SHL/SHR under Intel
> mode to avoid ambiguity.

Hmm. Special casing just two insns is out of question imo (in fact that's
what is - unintentionally - partly happening prior to the change here).

> Neither SHL (always SAL), nor SHR with a D suffix (Intel mode) is
> generated by GCC.

While this may be deemed helpful, I actually view it as a mistake, even if
only from a cosmetic perspective: SHL is the main insn; SAL is merely an
alias (questionably using extension opcode 4 rather than 6 in gas).

Still extending what you suggest - limiting the restriction to APX - may
be an option, albeit ...

>> ---
>> The alternative, more intrusive and more risky (in terms of perceived or
>> even real regressions) route would be to mark the few insns which permit
>> suffixes even in Intel syntax, and reject suffix uses when that
>> indicator isn't set.

... as implied here I'd still consider this inconsistent.

Furthermore the point in time when suffixes are processed off of the
incoming mnemonic is too early to know whether an insn is having an APX
representation. Hence doing said extension of what you suggest would likely
end up quite hacky.

Jan

  reply	other threads:[~2024-04-22  6:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  9:28 Jan Beulich
2024-04-22  4:09 ` Hongtao Liu
2024-04-22  6:51   ` Jan Beulich [this message]
2024-04-22  7:43     ` Cui, Lili
2024-04-22  7:47       ` Hongtao Liu
2024-04-22  8:42         ` Jan Beulich
2024-04-22 11:36           ` Hongtao Liu
2024-04-22  8:45       ` Jan Beulich

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=563b29cc-d3b5-45b7-b354-1ca8f3a2dcf4@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=crazylht@gmail.com \
    --cc=hjl.tools@gmail.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).