public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Noah Goldstein via Libc-alpha <libc-alpha@sourceware.org>,
	hjl.tools@gmail.com, carlos@systemhalted.org
Subject: Re: [PATCH v2] x86: Add support for AVX10 version and vec size in cpu-features
Date: Thu, 7 Sep 2023 23:55:19 -0500	[thread overview]
Message-ID: <CAFUsyfJ1WiTEOM+wiuoou-tzTKqp=Y=k4fZx6AZ_08Ut4pzhQA@mail.gmail.com> (raw)
In-Reply-To: <CAFUsyfJwCQC4CN5ULk7e3gQ4vfnn-D+9pJ8rRLqLLnUjnqaSrQ@mail.gmail.com>

On Fri, Sep 1, 2023 at 1:52 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Fri, Aug 25, 2023 at 12:39 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > On Fri, Aug 25, 2023 at 2:12 AM Florian Weimer <fweimer@redhat.com> wrote:
> > >
> > > * Noah Goldstein via Libc-alpha:
> > >
> > > > +/* AVX10 version information is handled differently from all other CPUID
> > > > +   related logic.  Rather than being encoded in cpuid as discrete booleans, the
> > > > +   AVX10 version is encoded is a full byte that represents the version number
> > > > +   (greater than or equal to 1).  Since the CPUID API is only able to handle
> > > > +   boolean returns, we enumerate `x86_cpu_AVX10_V{1..255}` which can be queried
> > > > +   by the user and have special logic in `x86_cpu_{present,active}`.  This is
> > > > +   unpleasant on our end, but is the only way to make the existing API also
> > > > +   support version queries.  */
> > > > +
> > > > +  /* All 1s should never be a value feature index.  */
> > > > +  x86_cpu_AVX10_V255 = ~0,
> > > > +  x86_cpu_AVX10_V254 = x86_cpu_AVX10_V255 - 1,
> > > > +  x86_cpu_AVX10_V253 = x86_cpu_AVX10_V254 - 1,
> > > > +  x86_cpu_AVX10_V252 = x86_cpu_AVX10_V253 - 1,
> > > > +  x86_cpu_AVX10_V251 = x86_cpu_AVX10_V252 - 1,
> > >
> > > Is this really necessary?  We can define an x86_cpu_avx10_version inline
> > > function that calls __x86_get_cpuid_feature_leaf and extracts the
> > > version byte.  Is it really necessary to support something like this?
> > >
> >
> > I agree it's not the best API. My feelings are two fold on this.
> > 1) The existing API that users know should support the feature, even if its
> > not the best way for users query the logic. Adding support for specific version
> > queries in CPU_FEATURE_{ACTIVE,PRESENT} doesn't prevent us from
> > adding an API that allows for querying the full byte. But only adding the byte
> > might be disruptive to users that expect to be able to do all their querying
> > through the existing API.
> > 2) For a lot of use cases, this is sufficient. Currently we only have
> > two versions
> > and I think the common use case is not "is feature above level X?",
> > but "do I have
> > feature X?". The latter can reasonably be supported with a single query of:
> > CPU_FEATURE_{ACTIVE,PRESENT}(AVX10_<MIN_VERSION_WITH_X>).
> >
> > >   CPU_FEATURE_ACTIVE (AVX10_V2)
> > >
> > > This would be the alternative:
> > >
> > >   x86_cpu_avx10_version () >= 2
> > >
> > We do plan to propose a new byte API in a follow up :)
> >
> > > Let's hope that version 0 means no AVX10. 8-)
> > >
> > versions start at 1.
> >
> >
> >
> > > Thanks,
> > > Florian
> > >
>
> Ping.
> Florian, you okay with this going in?

Ping

  reply	other threads:[~2023-09-08  4:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 18:48 [PATCH v1] " Noah Goldstein
2023-08-24 19:01 ` H.J. Lu
2023-08-24 19:14   ` Noah Goldstein
2023-08-24 19:14 ` [PATCH v2] " Noah Goldstein
2023-08-25  7:12   ` Florian Weimer
2023-08-25 17:39     ` Noah Goldstein
2023-09-01 18:52       ` Noah Goldstein
2023-09-08  4:55         ` Noah Goldstein [this message]
2023-08-24 20:30 ` Noah Goldstein
2023-09-20 20:44 ` x86: Add support for AVX10 preset " Noah Goldstein
2023-09-20 20:44   ` x86: Add support for AVX10 version " Noah Goldstein
2023-09-25 20:49   ` x86: Add support for AVX10 preset and vec size " 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='CAFUsyfJ1WiTEOM+wiuoou-tzTKqp=Y=k4fZx6AZ_08Ut4pzhQA@mail.gmail.com' \
    --to=goldstein.w.n@gmail.com \
    --cc=carlos@systemhalted.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /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).