public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Cui, Lili" <lili.cui@intel.com>
Cc: Binutils <binutils@sourceware.org>,
	"H.J. Lu" <hjl.tools@gmail.com>, Hongtao Liu <crazylht@gmail.com>
Subject: Re: [PATCH] x86/Intel: SHLD/SHRD have dual meaning
Date: Mon, 22 Apr 2024 10:45:19 +0200	[thread overview]
Message-ID: <7ef5ed97-e1b8-43d6-b369-f8858ddb7ace@suse.com> (raw)
In-Reply-To: <SJ0PR11MB560099E06545D2591C9B56CE9E122@SJ0PR11MB5600.namprd11.prod.outlook.com>

On 22.04.2024 09:43, Cui, Lili wrote:
>> 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.
>>
> 
> If the user messes them up, we can't figure out the original intention because the input is exactly the same, maybe we can find a suitable place to inform the user that shl + apx ndd does not support suffix?

See my other reply to Hongtao. Plus, as said before, I'd much prefer if we
wouldn't start special-casing any specific insns in this regard. (Which
isn't to say that may not end up being necessary here.)

Jan

      parent reply	other threads:[~2024-04-22  8:45 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
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 [this message]

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=7ef5ed97-e1b8-43d6-b369-f8858ddb7ace@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=crazylht@gmail.com \
    --cc=hjl.tools@gmail.com \
    --cc=lili.cui@intel.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).