public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] x86: Add FEATURE_AVX512VP2INTERSECT and update GFNI check
@ 2020-05-19 21:37 H.J. Lu
  2020-05-19 21:38 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2020-05-19 21:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak

Add FEATURE_AVX512VP2INTERSECT to libgcc so that enum processor_features
in libgcc matches enum processor_features in i386-builtins.c.  Update
GFNI check to support processors with SSE and AVX versions of GFNI.

	PR target/95212
	PR target/95220
	* config/i386/cpuinfo.c (get_available_features): Fix
	FEATURE_GFNI check.  Also check FEATURE_AVX512VP2INTERSECT.
	* config/i386/cpuinfo.h (processor_features): Add
	FEATURE_AVX512VP2INTERSECT.
---
 libgcc/config/i386/cpuinfo.c | 6 ++++--
 libgcc/config/i386/cpuinfo.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 00322c58622..26c1bdca361 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -349,6 +349,8 @@ get_available_features (unsigned int ecx, unsigned int edx,
 	}
       if (ebx & bit_BMI2)
 	set_feature (FEATURE_BMI2);
+      if (ecx & bit_GFNI)
+	set_feature (FEATURE_GFNI);
       if (avx512_usable)
 	{
 	  if (ebx & bit_AVX512F)
@@ -371,8 +373,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_GFNI)
-	    set_feature (FEATURE_GFNI);
 	  if (ecx & bit_VPCLMULQDQ)
 	    set_feature (FEATURE_VPCLMULQDQ);
 	  if (ecx & bit_AVX512VNNI)
@@ -385,6 +385,8 @@ get_available_features (unsigned int ecx, unsigned int edx,
 	    set_feature (FEATURE_AVX5124VNNIW);
 	  if (edx & bit_AVX5124FMAPS)
 	    set_feature (FEATURE_AVX5124FMAPS);
+	  if (edx & bit_AVX512VP2INTERSECT)
+	    set_feature (FEATURE_AVX512VP2INTERSECT);
 
 	  __cpuid_count (7, 1, eax, ebx, ecx, edx);
 	  if (eax & bit_AVX512BF16)
diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h
index 41c4a49a98d..fd6d12a7d68 100644
--- a/libgcc/config/i386/cpuinfo.h
+++ b/libgcc/config/i386/cpuinfo.h
@@ -122,6 +122,7 @@ enum processor_features
   FEATURE_VPCLMULQDQ,
   FEATURE_AVX512VNNI,
   FEATURE_AVX512BITALG,
+  FEATURE_AVX512VP2INTERSECT,
   FEATURE_AVX512BF16
 };
 
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86: Add FEATURE_AVX512VP2INTERSECT and update GFNI check
  2020-05-19 21:37 [PATCH] x86: Add FEATURE_AVX512VP2INTERSECT and update GFNI check H.J. Lu
@ 2020-05-19 21:38 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2020-05-19 21:38 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Tue, May 19, 2020 at 11:37 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Add FEATURE_AVX512VP2INTERSECT to libgcc so that enum processor_features
> in libgcc matches enum processor_features in i386-builtins.c.  Update
> GFNI check to support processors with SSE and AVX versions of GFNI.
>
>         PR target/95212
>         PR target/95220
>         * config/i386/cpuinfo.c (get_available_features): Fix
>         FEATURE_GFNI check.  Also check FEATURE_AVX512VP2INTERSECT.
>         * config/i386/cpuinfo.h (processor_features): Add
>         FEATURE_AVX512VP2INTERSECT.

OK for mainline and backports.

Thanks,
Uros.

> ---
>  libgcc/config/i386/cpuinfo.c | 6 ++++--
>  libgcc/config/i386/cpuinfo.h | 1 +
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
> index 00322c58622..26c1bdca361 100644
> --- a/libgcc/config/i386/cpuinfo.c
> +++ b/libgcc/config/i386/cpuinfo.c
> @@ -349,6 +349,8 @@ get_available_features (unsigned int ecx, unsigned int edx,
>         }
>        if (ebx & bit_BMI2)
>         set_feature (FEATURE_BMI2);
> +      if (ecx & bit_GFNI)
> +       set_feature (FEATURE_GFNI);
>        if (avx512_usable)
>         {
>           if (ebx & bit_AVX512F)
> @@ -371,8 +373,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_GFNI)
> -           set_feature (FEATURE_GFNI);
>           if (ecx & bit_VPCLMULQDQ)
>             set_feature (FEATURE_VPCLMULQDQ);
>           if (ecx & bit_AVX512VNNI)
> @@ -385,6 +385,8 @@ get_available_features (unsigned int ecx, unsigned int edx,
>             set_feature (FEATURE_AVX5124VNNIW);
>           if (edx & bit_AVX5124FMAPS)
>             set_feature (FEATURE_AVX5124FMAPS);
> +         if (edx & bit_AVX512VP2INTERSECT)
> +           set_feature (FEATURE_AVX512VP2INTERSECT);
>
>           __cpuid_count (7, 1, eax, ebx, ecx, edx);
>           if (eax & bit_AVX512BF16)
> diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h
> index 41c4a49a98d..fd6d12a7d68 100644
> --- a/libgcc/config/i386/cpuinfo.h
> +++ b/libgcc/config/i386/cpuinfo.h
> @@ -122,6 +122,7 @@ enum processor_features
>    FEATURE_VPCLMULQDQ,
>    FEATURE_AVX512VNNI,
>    FEATURE_AVX512BITALG,
> +  FEATURE_AVX512VP2INTERSECT,
>    FEATURE_AVX512BF16
>  };
>
> --
> 2.26.2
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-19 21:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 21:37 [PATCH] x86: Add FEATURE_AVX512VP2INTERSECT and update GFNI check H.J. Lu
2020-05-19 21:38 ` Uros Bizjak

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).