x86: Update VPCLMULQDQ check

Message ID 20200520015748.5729-1-hjl.tools@gmail.com
State New
Headers show
Series
  • x86: Update VPCLMULQDQ check
Related show

Commit Message

Jose E. Marchesi via Gcc-patches May 20, 2020, 1:57 a.m.
Update VPCLMULQDQ check to support processors with AVX version of
VPCLMULQDQ.

	PR target/91695
	* config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ
	check.
---
 libgcc/config/i386/cpuinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.26.2

Comments

Jose E. Marchesi via Gcc-patches May 20, 2020, 6 a.m. | #1
On Wed, May 20, 2020 at 3:57 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> Update VPCLMULQDQ check to support processors with AVX version of

> VPCLMULQDQ.

>

>         PR target/91695

>         * config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ

>         check.


OK.

Thanks,
Uros.

> ---

>  libgcc/config/i386/cpuinfo.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c

> index 26c1bdca361..cf5f0884bb4 100644

> --- a/libgcc/config/i386/cpuinfo.c

> +++ b/libgcc/config/i386/cpuinfo.c

> @@ -346,6 +346,8 @@ get_available_features (unsigned int ecx, unsigned int edx,

>         {

>           if (ebx & bit_AVX2)

>             set_feature (FEATURE_AVX2);

> +         if (ecx & bit_VPCLMULQDQ)

> +           set_feature (FEATURE_VPCLMULQDQ);

>         }

>        if (ebx & bit_BMI2)

>         set_feature (FEATURE_BMI2);

> @@ -373,8 +375,6 @@ get_available_features (unsigned int ecx, unsigned int edx,

>             set_feature (FEATURE_AVX512VBMI);

>           if (ecx & bit_AVX512VBMI2)

>             set_feature (FEATURE_AVX512VBMI2);

> -         if (ecx & bit_VPCLMULQDQ)

> -           set_feature (FEATURE_VPCLMULQDQ);

>           if (ecx & bit_AVX512VNNI)

>             set_feature (FEATURE_AVX512VNNI);

>           if (ecx & bit_AVX512BITALG)

> --

> 2.26.2

>
Jose E. Marchesi via Gcc-patches May 20, 2020, 11:14 a.m. | #2
On Tue, May 19, 2020 at 11:00 PM Uros Bizjak <ubizjak@gmail.com> wrote:
>

> On Wed, May 20, 2020 at 3:57 AM H.J. Lu <hjl.tools@gmail.com> wrote:

> >

> > Update VPCLMULQDQ check to support processors with AVX version of

> > VPCLMULQDQ.

> >

> >         PR target/91695

> >         * config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ

> >         check.

>

> OK.


I checked it into master branch.  OK for backport to release branches?

Thanks.

> Thanks,

> Uros.

>

> > ---

> >  libgcc/config/i386/cpuinfo.c | 4 ++--

> >  1 file changed, 2 insertions(+), 2 deletions(-)

> >

> > diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c

> > index 26c1bdca361..cf5f0884bb4 100644

> > --- a/libgcc/config/i386/cpuinfo.c

> > +++ b/libgcc/config/i386/cpuinfo.c

> > @@ -346,6 +346,8 @@ get_available_features (unsigned int ecx, unsigned int edx,

> >         {

> >           if (ebx & bit_AVX2)

> >             set_feature (FEATURE_AVX2);

> > +         if (ecx & bit_VPCLMULQDQ)

> > +           set_feature (FEATURE_VPCLMULQDQ);

> >         }

> >        if (ebx & bit_BMI2)

> >         set_feature (FEATURE_BMI2);

> > @@ -373,8 +375,6 @@ get_available_features (unsigned int ecx, unsigned int edx,

> >             set_feature (FEATURE_AVX512VBMI);

> >           if (ecx & bit_AVX512VBMI2)

> >             set_feature (FEATURE_AVX512VBMI2);

> > -         if (ecx & bit_VPCLMULQDQ)

> > -           set_feature (FEATURE_VPCLMULQDQ);

> >           if (ecx & bit_AVX512VNNI)

> >             set_feature (FEATURE_AVX512VNNI);

> >           if (ecx & bit_AVX512BITALG)

> > --

> > 2.26.2

> >




-- 
H.J.
Jose E. Marchesi via Gcc-patches May 20, 2020, 11:17 a.m. | #3
On Wed, May 20, 2020 at 1:15 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> On Tue, May 19, 2020 at 11:00 PM Uros Bizjak <ubizjak@gmail.com> wrote:

> >

> > On Wed, May 20, 2020 at 3:57 AM H.J. Lu <hjl.tools@gmail.com> wrote:

> > >

> > > Update VPCLMULQDQ check to support processors with AVX version of

> > > VPCLMULQDQ.

> > >

> > >         PR target/91695

> > >         * config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ

> > >         check.

> >

> > OK.

>

> I checked it into master branch.  OK for backport to release branches?


Yes.

Uros.

Patch

diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 26c1bdca361..cf5f0884bb4 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -346,6 +346,8 @@  get_available_features (unsigned int ecx, unsigned int edx,
 	{
 	  if (ebx & bit_AVX2)
 	    set_feature (FEATURE_AVX2);
+	  if (ecx & bit_VPCLMULQDQ)
+	    set_feature (FEATURE_VPCLMULQDQ);
 	}
       if (ebx & bit_BMI2)
 	set_feature (FEATURE_BMI2);
@@ -373,8 +375,6 @@  get_available_features (unsigned int ecx, unsigned int edx,
 	    set_feature (FEATURE_AVX512VBMI);
 	  if (ecx & bit_AVX512VBMI2)
 	    set_feature (FEATURE_AVX512VBMI2);
-	  if (ecx & bit_VPCLMULQDQ)
-	    set_feature (FEATURE_VPCLMULQDQ);
 	  if (ecx & bit_AVX512VNNI)
 	    set_feature (FEATURE_AVX512VNNI);
 	  if (ecx & bit_AVX512BITALG)