public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] i386: Call get_available_features for all CPUs with max_level >= 1 [PR100758]
Date: Thu, 9 Feb 2023 17:34:28 +0100	[thread overview]
Message-ID: <CAFULd4acJoev2+7CJc4-3K1EiWwiUJJtT9SFFsjrN9gKvAiVSA@mail.gmail.com> (raw)
In-Reply-To: <Y+UUmlOC6ii9/4Vx@tucnak>

On Thu, Feb 9, 2023 at 4:43 PM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Thu, Feb 09, 2023 at 07:30:52AM -0800, H.J. Lu wrote:
> > On Thu, Feb 9, 2023 at 4:12 AM Jakub Jelinek <jakub@redhat.com> wrote:
> > > get_available_features doesn't depend on cpu_model2->__cpu_{family,model}
> > > and just sets stuff up based on CPUID leaf 1, or some extended ones,
> > > so I wonder why are we calling it separately for Intel, AMD and Zhaoxin
> > > and not for all other CPUs too?  I think various programs in the wild
> > > which aren't using __builtin_cpu_{is,supports} just check the various CPUID
> > > leafs and query bits in there, without blacklisting unknown CPU vendors,
> > > so I think even __builtin_cpu_supports ("sse2") etc. should be reliable
> > > if those VENDOR_{CENTAUR,CYRIX,NSC,OTHER} CPUs set those bits in CPUID leaf
> > > 1 or some extended ones.  Calling it for all CPUs also means it can be
> > > inlined because there will be just a single caller.
> > >
> > > I will test on Intel but can't test it on non-Intel (or with some extra
> > > effort on AMD; for both of those arches it should be really no change in
> > > behavior).
> > >
> > > Thoughts on this?
> >
> > No objection here.   It just isn't easy to verify CPUID behavior on
> > other processors.
>
> Sure, worst case it can be reverted or exceptions could be added if some
> CPUs misbehave but then we'd hopefully have detailed into on how exactly it
> behaves.
>
> FYI, I've successfully bootstrapped/regtested this on Intel i9-7960X
> and Martin Liska has regtested it with just i386.exp tests on AMD.
>
> Uros, is this ok now?

OK. Let's go forward with the patch.

Thanks,
Uros.

>
> > > 2023-02-09  Jakub Jelinek  <jakub@redhat.com>
> > >
> > >         PR target/100758
> > >         * common/config/i386/cpuinfo.h (get_zhaoxin_cpu): Formatting fixes.
> > >         (cpu_indicator_init): Call get_available_features for all CPUs with
> > >         max_level >= 1, rather than just Intel, AMD or Zhaoxin.  Formatting
> > >         fixes.
>
>         Jakub
>

      reply	other threads:[~2023-02-09 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 12:11 Jakub Jelinek
2023-02-09 15:30 ` H.J. Lu
2023-02-09 15:43   ` Jakub Jelinek
2023-02-09 16:34     ` Uros Bizjak [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=CAFULd4acJoev2+7CJc4-3K1EiWwiUJJtT9SFFsjrN9gKvAiVSA@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=jakub@redhat.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).