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: "Cui, Lili" <lili.cui@intel.com>, Binutils <binutils@sourceware.org>
Subject: Re: [PATCH 0/5] x86/Intel: AVX512 syntax enhancements
Date: Wed, 18 May 2022 08:07:47 -0700	[thread overview]
Message-ID: <CAMe9rOqRvKmxyRtykMKjh_t0Ps7WgjvV_ATKptK81aS_evBAQQ@mail.gmail.com> (raw)
In-Reply-To: <86a0e15c-016a-8355-434d-fd2bd0c6f0d1@suse.com>

On Tue, May 17, 2022 at 11:40 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 18.05.2022 05:15, Cui, Lili wrote:
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@suse.com>
> >> Sent: Tuesday, May 17, 2022 8:00 PM
> >> To: Cui, Lili <lili.cui@intel.com>
> >> Cc: H.J. Lu <hjl.tools@gmail.com>; Binutils <binutils@sourceware.org>
> >> Subject: Re: [PATCH 0/5] x86/Intel: AVX512 syntax enhancements
> >>
> >>> 1. If we use BCST instead {1to*}, it cannot directly reflect the broadcast
> >> number. When the register size is zmm, but broadcast number is not the
> >> same.
> >>>
> >>> -[      ]*[a-f0-9]+:[   ]*62 f5 54 58 58 31[     ]*vaddph zmm6,zmm5,WORD PTR
> >> \[ecx\]\{1to32\}
> >>> +[      ]*[a-f0-9]+:[   ]*62 f5 54 58 58 31[     ]*vaddph zmm6,zmm5,WORD
> >> BCST \[ecx\]
> >>>
> >>> -[      ]*[a-f0-9]+:[   ]*62 65 7d df 5b 72 80[          ]*vcvtph2dq
> >> zmm30\{k7\}\{z\},WORD PTR \[rdx-0x100\]\{1to16\}
> >>> +[      ]*[a-f0-9]+:[   ]*62 65 7d df 5b 72 80[          ]*vcvtph2dq
> >> zmm30\{k7\}\{z\},WORD BCST \[rdx-0x100\]
> >>
> >> This case is clearly disambiguated by the destination register.
> >> What I think you're worried about are conversions where the field size
> >> shrinks (e.g. from 32 bits to 16 bits, like in vcvtdq2ph). In this case you will
> >> note that for the purpose of keeping things unambiguous the disassembler
> >> will continue to emit {1to<N>}, and the assembler will continue to require
> >> that extra bit of information.
> >>
> >
> > The format of appending {1to<N>} for vcvtdq2ph special case is great.
> > There is no ambiguity for the format of vcvtph2dq zmm30{k7}{z},WORD BCST [rdx-0x100], but we cannot direct know the N ({1to<N>}) for this BCST format, although we can confirm it with the SDM. I just trying to say for the first impression, BAST format has this disadvantage.
>
> But that's no different for e.g. VADDPS - the element count isn't explicit
> anywhere, it's known from register kind only.
>
> I don't, btw, have insight into how MASM disambiguates VCVTDQ2PH and alike.
>
> >>> 2. Just remove the last comma, it's ok for me, I remember FP16 has an
> >> instruction with {sae} on the middle position for the ATT format. But the intel
> >> format is placed at the end, I don't know if there is any problem.
> >>>
> >>> -[      ]*[a-f0-9]+:[   ]*62 f5 54 18 58 f4[     ]*vaddph zmm6,zmm5,zmm4,\{rn-
> >> sae\}
> >>> +[      ]*[a-f0-9]+:[   ]*62 f5 54 18 58 f4[     ]*vaddph zmm6,zmm5,zmm4\{rn-
> >> sae\}
> >>>
> >>> FP16:
> >>> vcvtusi2sh %edx, {rn-sae}, %xmm29, %xmm30 vcvtusi2sh
> >>> xmm6,xmm5,edx\{rn-sae\}
> >>
> >> Well, yes, this is not only not a problem, but intended. See how the SDM
> >> places the rounding/SAE modifiers. It's also not FP16-specific in any way.
> >>
> >
> > Yes, SDM put the rounding/SAE behind the last register operand, if the last operand is immediate, it will put rounding/SAE before the immediate. But I don't quite understand why ATT format put it after %edx instead of before.
>
> That's a question I raised back at the time when introducing the Intel
> syntax alternative. I don't recall having got a good answer. I guess I
> can only forward to H.J. here ...

AT&T syntax order is always different.   SAE was new.  I don't remember exactly
how the choice was made.

-- 
H.J.

  reply	other threads:[~2022-05-18 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 11:44 Jan Beulich
2022-05-04 11:57 ` [PATCH 1/5] x86/Intel: adjust representation of embedded broadcast Jan Beulich
2022-05-04 11:58 ` [PATCH 2/5] x86/Intel: allow MASM " Jan Beulich
2022-05-04 11:59 ` [PATCH 3/5] x86/Intel: adjust representation of embedded rounding / SAE Jan Beulich
2022-05-04 12:00 ` [PATCH 4/5] x86: re-work AVX512 " Jan Beulich
2022-05-04 12:01 ` [PATCH 5/5] x86/Intel: allow MASM representation of " Jan Beulich
2022-05-10  2:37 ` [PATCH 0/5] x86/Intel: AVX512 syntax enhancements Cui, Lili
2022-05-17 12:00   ` Jan Beulich
2022-05-18  3:15     ` Cui, Lili
2022-05-18  6:40       ` Jan Beulich
2022-05-18 15:07         ` H.J. Lu [this message]
2022-05-25  7:44 ` Jan Beulich
2022-05-26 14:48   ` 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=CAMe9rOqRvKmxyRtykMKjh_t0Ps7WgjvV_ATKptK81aS_evBAQQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.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).