Message ID | 20220616220259.1289277-1-goldstein.w.n@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v1] x86: Add BMI1/BMI2 checks for ISA_V3 check | expand |
On Thu, Jun 16, 2022 at 3:03 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote: > > BMI1/BMI2 are part of the ISA V3 requirements: > https://en.wikipedia.org/wiki/X86-64 > > And defined by GCC when building with `-march=x86-64-v3` > --- > sysdeps/x86/isa-level.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/x86/isa-level.c b/sysdeps/x86/isa-level.c > index a6cb32b1b1..09cd72ab20 100644 > --- a/sysdeps/x86/isa-level.c > +++ b/sysdeps/x86/isa-level.c > @@ -47,7 +47,8 @@ > # endif > > # if ISA_V2 && defined __AVX__ && defined __AVX2__ && defined __F16C__ \ > - && defined __FMA__ && defined __LZCNT__ && defined HAVE_X86_MOVBE > + && defined __FMA__ && defined __LZCNT__ && defined HAVE_X86_MOVBE \ > + && defined __BMI__ && defined __BMI2__ > /* NB: ISAs in x86-64 ISA level v3 are used. */ > # define ISA_V3 GNU_PROPERTY_X86_ISA_1_V3 > # else > -- > 2.34.1 > LGTM. Thanks.
On Thu, Jun 16, 2022 at 3:40 PM H.J. Lu via Libc-alpha <libc-alpha@sourceware.org> wrote: > > On Thu, Jun 16, 2022 at 3:03 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote: > > > > BMI1/BMI2 are part of the ISA V3 requirements: > > https://en.wikipedia.org/wiki/X86-64 > > > > And defined by GCC when building with `-march=x86-64-v3` > > --- > > sysdeps/x86/isa-level.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/sysdeps/x86/isa-level.c b/sysdeps/x86/isa-level.c > > index a6cb32b1b1..09cd72ab20 100644 > > --- a/sysdeps/x86/isa-level.c > > +++ b/sysdeps/x86/isa-level.c > > @@ -47,7 +47,8 @@ > > # endif > > > > # if ISA_V2 && defined __AVX__ && defined __AVX2__ && defined __F16C__ \ > > - && defined __FMA__ && defined __LZCNT__ && defined HAVE_X86_MOVBE > > + && defined __FMA__ && defined __LZCNT__ && defined HAVE_X86_MOVBE \ > > + && defined __BMI__ && defined __BMI2__ > > /* NB: ISAs in x86-64 ISA level v3 are used. */ > > # define ISA_V3 GNU_PROPERTY_X86_ISA_1_V3 > > # else > > -- > > 2.34.1 > > > > LGTM. > > Thanks. > > -- > H.J. I would like to backport this patch to release branches. Any comments or objections? --Sunil
diff --git a/sysdeps/x86/isa-level.c b/sysdeps/x86/isa-level.c index a6cb32b1b1..09cd72ab20 100644 --- a/sysdeps/x86/isa-level.c +++ b/sysdeps/x86/isa-level.c @@ -47,7 +47,8 @@ # endif # if ISA_V2 && defined __AVX__ && defined __AVX2__ && defined __F16C__ \ - && defined __FMA__ && defined __LZCNT__ && defined HAVE_X86_MOVBE + && defined __FMA__ && defined __LZCNT__ && defined HAVE_X86_MOVBE \ + && defined __BMI__ && defined __BMI2__ /* NB: ISAs in x86-64 ISA level v3 are used. */ # define ISA_V3 GNU_PROPERTY_X86_ISA_1_V3 # else