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>,
	"Cui, Lili" <lili.cui@intel.com>
Subject: Re: [PATCH] Correct cpu_flags for CPU_ANY_AVX512BW_FLAGS
Date: Thu, 23 Jun 2022 18:56:07 -0700	[thread overview]
Message-ID: <CAMe9rOpgz030dg=+sZuvTsKuko=CuHcEqy8-kRMK91DzZWPmow@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOpWtSOVTv=ziPjkUdCg-Kg26wFCrkrgrbUg-TYq7kc_4w@mail.gmail.com>

On Thu, Jun 23, 2022 at 9:31 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Jun 23, 2022 at 9:08 AM Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 23.06.2022 18:04, H.J. Lu wrote:
> > > On Thu, Jun 23, 2022 at 1:08 AM Cui, Lili <lili.cui@intel.com> wrote:
> > >>
> > >>
> > >>
> > >>> -----Original Message-----
> > >>> From: Jan Beulich <jbeulich@suse.com>
> > >>> Sent: Thursday, June 23, 2022 3:30 PM
> > >>> To: Cui, Lili <lili.cui@intel.com>
> > >>> Cc: binutils@sourceware.org; hjl.tools@gmail.com
> > >>> Subject: Re: [PATCH] Correct cpu_flags for CPU_ANY_AVX512BW_FLAGS
> > >>>
> > >>> On 23.06.2022 09:14, Cui,Lili wrote:
> > >>>> This patch is to correct cpu_flags for CPU_ANY_AVX512BW_FLAGS.
> > >>>> Make check-gas is ok.
> > >>>> Ok for master?
> > >>>>
> > >>>> Thanks,
> > >>>> Lili.
> > >>>>
> > >>>> Change it from "CPU_ANY_AVX512_FP16_FLAGS" to "CpuAVX512_FP16"
> > >>>
> > >>> You don't say what's wrong with what there is right now. I for one think what
> > >>> we have is correct: If one disables BW, _all_ its dependents should be
> > >>> disabled as well, which transitively means all dependents of FP16.
> > >>>
> > >> Hi Jan,
> > >> Agree with that " If one disables BW, _all_ its dependents should be disabled as well ".
> > >> I saw the form of "CPU_ANY_AVX512F_FLAGS" today, and to be consistent with it, I thought "CPU_ANY_AVX512_FP16_FLAGS" was wrong at that time. But after reading your email, I found "CPU_ANY_AVX512F_FLAGS" to be the only one that uses cpu_flags instead of CPU_ANY* .
> > >>
> > >> { "CPU_ANY_AVX512F_FLAGS",
> > >> "CpuAVX512F|CpuAVX512CD|CpuAVX512ER|CpuAVX512PF|CpuAVX512DQ|CPU_ANY_AVX512BW_FLAGS|CpuAVX512VL|CpuAVX512IFMA|CpuAVX512VBMI|CpuAVX512_4FMAPS|CpuAVX512_4VNNIW|CpuAVX512_VPOPCNTDQ|CpuAVX512_VBMI2|CpuAVX512_VNNI|CpuAVX512_BITALG|CpuAVX512_BF16|CpuAVX512_VP2INTERSECT" },
> > >>
> > >> Regards,
> > >> Lili.
> > >>
> > >>> Jan
> > >>>
> > >>>> opcodes/
> > >>>>
> > >>>>     * i386-gen.c (cpu_flag_init): Change cpu_flags of
> > >>>>     CPU_ANY_AVX512BW_FLAGS.
> > >>>> ---
> > >>>>  opcodes/i386-gen.c | 2 +-
> > >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > >>>>
> > >>>> diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c index
> > >>>> d18a7d2754..5dc224efdb 100644
> > >>>> --- a/opcodes/i386-gen.c
> > >>>> +++ b/opcodes/i386-gen.c
> > >>>> @@ -382,7 +382,7 @@ static initializer cpu_flag_init[] =
> > >>>>    { "CPU_ANY_AVX512DQ_FLAGS",
> > >>>>      "CpuAVX512DQ" },
> > >>>>    { "CPU_ANY_AVX512BW_FLAGS",
> > >>>> -    "CpuAVX512BW|CPU_ANY_AVX512_FP16_FLAGS" },
> > >>>> +    "CpuAVX512BW|CpuAVX512_FP16" },
> > >>>>    { "CPU_ANY_AVX512VL_FLAGS",
> > >>>>      "CpuAVX512VL" },
> > >>>>    { "CPU_ANY_AVX512IFMA_FLAGS",
> > >>
> > >
> > > Since CPU_ANY_AVX512_FP16_FLAGS is the same as CpuAVX512_FP16,
> > > this change is nop.  On the other hand, CPU_ANY shouldn't be used to define
> > > another CPU_ANY.
> >
> > Why? Imo that's exactly how it should be, as long as the purpose of
> > CPU_ANY_* is the use for processing of negative .arch directives.
> >
>
> Assuming AVX512_FP16 also requires BMI2, when AVX512F is disabled,
> AVX512_FP16 should be disabled, but not BMI2.
>

I was wrong.  The current code isn't wrong since

 { "CPU_ANY_AVX512BW_FLAGS",
   "CpuAVX512BW|CPU_ANY_AVX512_FP16_FLAGS" },

indicates that disabling AVX512BW will also disable AVX512BW +
AVX512F16 + any ISAs which
depend on AVX512FP16.   If there is another ISA which depends on
AVX512FP16, we don't
need to change CPU_ANY_AVX512BW_FLAGS.

-- 
H.J.

  reply	other threads:[~2022-06-24  1:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  7:14 Cui,Lili
2022-06-23  7:29 ` Jan Beulich
2022-06-23  8:08   ` Cui, Lili
2022-06-23 16:04     ` H.J. Lu
2022-06-23 16:07       ` Jan Beulich
2022-06-23 16:31         ` H.J. Lu
2022-06-24  1:56           ` H.J. Lu [this message]
2022-06-24  2:03             ` Cui, Lili

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='CAMe9rOpgz030dg=+sZuvTsKuko=CuHcEqy8-kRMK91DzZWPmow@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).