x86: Handle -mavx512vpopcntdq for -march=native

Message ID 20200521125445.14526-1-hjl.tools@gmail.com
State New
Headers show
Series
  • x86: Handle -mavx512vpopcntdq for -march=native
Related show

Commit Message

Christophe Lyon via Gcc-patches May 21, 2020, 12:54 p.m.
Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.

	PR target/95258
	* config/i386/driver-i386.c (host_detect_local_cpu): Detect
	AVX512VPOPCNTDQ.
---
 gcc/config/i386/driver-i386.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

-- 
2.26.2

Comments

Christophe Lyon via Gcc-patches May 22, 2020, 7:42 a.m. | #1
On Thu, May 21, 2020 at 2:54 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.

>

>         PR target/95258

>         * config/i386/driver-i386.c (host_detect_local_cpu): Detect

>         AVX512VPOPCNTDQ.


OK.

Thanks,
Uros.

> ---

>  gcc/config/i386/driver-i386.c | 9 ++++++---

>  1 file changed, 6 insertions(+), 3 deletions(-)

>

> diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c

> index 7612ddfb846..3a816400729 100644

> --- a/gcc/config/i386/driver-i386.c

> +++ b/gcc/config/i386/driver-i386.c

> @@ -420,6 +420,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>    unsigned int has_avx5124fmaps = 0, has_avx5124vnniw = 0;

>    unsigned int has_gfni = 0, has_avx512vbmi2 = 0;

>    unsigned int has_avx512bitalg = 0;

> +  unsigned int has_avx512vpopcntdq = 0;

>    unsigned int has_shstk = 0;

>    unsigned int has_avx512vnni = 0, has_vaes = 0;

>    unsigned int has_vpclmulqdq = 0;

> @@ -528,6 +529,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>        has_vaes = ecx & bit_VAES;

>        has_vpclmulqdq = ecx & bit_VPCLMULQDQ;

>        has_avx512bitalg = ecx & bit_AVX512BITALG;

> +      has_avx512vpopcntdq = ecx & bit_AVX512VPOPCNTDQ;

>        has_movdiri = ecx & bit_MOVDIRI;

>        has_movdir64b = ecx & bit_MOVDIR64B;

>        has_enqcmd = ecx & bit_ENQCMD;

> @@ -1189,6 +1191,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>        const char *avx512vp2intersect = has_avx512vp2intersect ? " -mavx512vp2intersect" : " -mno-avx512vp2intersect";

>        const char *tsxldtrk = has_tsxldtrk ? " -mtsxldtrk " : " -mno-tsxldtrk";

>        const char *avx512bitalg = has_avx512bitalg ? " -mavx512bitalg" : " -mno-avx512bitalg";

> +      const char *avx512vpopcntdq = has_avx512vpopcntdq ? " -mavx512vpopcntdq" : " -mno-avx512vpopcntdq";

>        const char *movdiri = has_movdiri ? " -mmovdiri" : " -mno-movdiri";

>        const char *movdir64b = has_movdir64b ? " -mmovdir64b" : " -mno-movdir64b";

>        const char *enqcmd = has_enqcmd ? " -menqcmd" : " -mno-enqcmd";

> @@ -1210,9 +1213,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>                         avx512ifma, avx512vbmi, avx5124fmaps, avx5124vnniw,

>                         clwb, mwaitx, clzero, pku, rdpid, gfni, shstk,

>                         avx512vbmi2, avx512vnni, vaes, vpclmulqdq,

> -                       avx512bitalg, movdiri, movdir64b, waitpkg, cldemote,

> -                       ptwrite, avx512bf16, enqcmd, avx512vp2intersect,

> -                       serialize, tsxldtrk, NULL);

> +                       avx512bitalg, avx512vpopcntdq, movdiri, movdir64b,

> +                       waitpkg, cldemote, ptwrite, avx512bf16, enqcmd,

> +                       avx512vp2intersect, serialize, tsxldtrk, NULL);

>      }

>

>  done:

> --

> 2.26.2

>
Christophe Lyon via Gcc-patches May 23, 2020, 3:06 p.m. | #2
On Fri, May 22, 2020 at 12:42 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>

> On Thu, May 21, 2020 at 2:54 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> >

> > Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.

> >

> >         PR target/95258

> >         * config/i386/driver-i386.c (host_detect_local_cpu): Detect

> >         AVX512VPOPCNTDQ.

>

> OK.

>


OK for backports?

Thanks.

>

> > ---

> >  gcc/config/i386/driver-i386.c | 9 ++++++---

> >  1 file changed, 6 insertions(+), 3 deletions(-)

> >

> > diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c

> > index 7612ddfb846..3a816400729 100644

> > --- a/gcc/config/i386/driver-i386.c

> > +++ b/gcc/config/i386/driver-i386.c

> > @@ -420,6 +420,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >    unsigned int has_avx5124fmaps = 0, has_avx5124vnniw = 0;

> >    unsigned int has_gfni = 0, has_avx512vbmi2 = 0;

> >    unsigned int has_avx512bitalg = 0;

> > +  unsigned int has_avx512vpopcntdq = 0;

> >    unsigned int has_shstk = 0;

> >    unsigned int has_avx512vnni = 0, has_vaes = 0;

> >    unsigned int has_vpclmulqdq = 0;

> > @@ -528,6 +529,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >        has_vaes = ecx & bit_VAES;

> >        has_vpclmulqdq = ecx & bit_VPCLMULQDQ;

> >        has_avx512bitalg = ecx & bit_AVX512BITALG;

> > +      has_avx512vpopcntdq = ecx & bit_AVX512VPOPCNTDQ;

> >        has_movdiri = ecx & bit_MOVDIRI;

> >        has_movdir64b = ecx & bit_MOVDIR64B;

> >        has_enqcmd = ecx & bit_ENQCMD;

> > @@ -1189,6 +1191,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >        const char *avx512vp2intersect = has_avx512vp2intersect ? " -mavx512vp2intersect" : " -mno-avx512vp2intersect";

> >        const char *tsxldtrk = has_tsxldtrk ? " -mtsxldtrk " : " -mno-tsxldtrk";

> >        const char *avx512bitalg = has_avx512bitalg ? " -mavx512bitalg" : " -mno-avx512bitalg";

> > +      const char *avx512vpopcntdq = has_avx512vpopcntdq ? " -mavx512vpopcntdq" : " -mno-avx512vpopcntdq";

> >        const char *movdiri = has_movdiri ? " -mmovdiri" : " -mno-movdiri";

> >        const char *movdir64b = has_movdir64b ? " -mmovdir64b" : " -mno-movdir64b";

> >        const char *enqcmd = has_enqcmd ? " -menqcmd" : " -mno-enqcmd";

> > @@ -1210,9 +1213,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >                         avx512ifma, avx512vbmi, avx5124fmaps, avx5124vnniw,

> >                         clwb, mwaitx, clzero, pku, rdpid, gfni, shstk,

> >                         avx512vbmi2, avx512vnni, vaes, vpclmulqdq,

> > -                       avx512bitalg, movdiri, movdir64b, waitpkg, cldemote,

> > -                       ptwrite, avx512bf16, enqcmd, avx512vp2intersect,

> > -                       serialize, tsxldtrk, NULL);

> > +                       avx512bitalg, avx512vpopcntdq, movdiri, movdir64b,

> > +                       waitpkg, cldemote, ptwrite, avx512bf16, enqcmd,

> > +                       avx512vp2intersect, serialize, tsxldtrk, NULL);

> >      }

> >

> >  done:

> > --

> > 2.26.2

> >




-- 
H.J.
Christophe Lyon via Gcc-patches May 24, 2020, 9:27 a.m. | #3
On Sat, May 23, 2020 at 5:07 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> On Fri, May 22, 2020 at 12:42 AM Uros Bizjak <ubizjak@gmail.com> wrote:

> >

> > On Thu, May 21, 2020 at 2:54 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> > >

> > > Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.

> > >

> > >         PR target/95258

> > >         * config/i386/driver-i386.c (host_detect_local_cpu): Detect

> > >         AVX512VPOPCNTDQ.

> >

> > OK.

> >

>

> OK for backports?


OK.

Thanks,
Uros.

> Thanks.

>

> >

> > > ---

> > >  gcc/config/i386/driver-i386.c | 9 ++++++---

> > >  1 file changed, 6 insertions(+), 3 deletions(-)

> > >

> > > diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c

> > > index 7612ddfb846..3a816400729 100644

> > > --- a/gcc/config/i386/driver-i386.c

> > > +++ b/gcc/config/i386/driver-i386.c

> > > @@ -420,6 +420,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> > >    unsigned int has_avx5124fmaps = 0, has_avx5124vnniw = 0;

> > >    unsigned int has_gfni = 0, has_avx512vbmi2 = 0;

> > >    unsigned int has_avx512bitalg = 0;

> > > +  unsigned int has_avx512vpopcntdq = 0;

> > >    unsigned int has_shstk = 0;

> > >    unsigned int has_avx512vnni = 0, has_vaes = 0;

> > >    unsigned int has_vpclmulqdq = 0;

> > > @@ -528,6 +529,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> > >        has_vaes = ecx & bit_VAES;

> > >        has_vpclmulqdq = ecx & bit_VPCLMULQDQ;

> > >        has_avx512bitalg = ecx & bit_AVX512BITALG;

> > > +      has_avx512vpopcntdq = ecx & bit_AVX512VPOPCNTDQ;

> > >        has_movdiri = ecx & bit_MOVDIRI;

> > >        has_movdir64b = ecx & bit_MOVDIR64B;

> > >        has_enqcmd = ecx & bit_ENQCMD;

> > > @@ -1189,6 +1191,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> > >        const char *avx512vp2intersect = has_avx512vp2intersect ? " -mavx512vp2intersect" : " -mno-avx512vp2intersect";

> > >        const char *tsxldtrk = has_tsxldtrk ? " -mtsxldtrk " : " -mno-tsxldtrk";

> > >        const char *avx512bitalg = has_avx512bitalg ? " -mavx512bitalg" : " -mno-avx512bitalg";

> > > +      const char *avx512vpopcntdq = has_avx512vpopcntdq ? " -mavx512vpopcntdq" : " -mno-avx512vpopcntdq";

> > >        const char *movdiri = has_movdiri ? " -mmovdiri" : " -mno-movdiri";

> > >        const char *movdir64b = has_movdir64b ? " -mmovdir64b" : " -mno-movdir64b";

> > >        const char *enqcmd = has_enqcmd ? " -menqcmd" : " -mno-enqcmd";

> > > @@ -1210,9 +1213,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> > >                         avx512ifma, avx512vbmi, avx5124fmaps, avx5124vnniw,

> > >                         clwb, mwaitx, clzero, pku, rdpid, gfni, shstk,

> > >                         avx512vbmi2, avx512vnni, vaes, vpclmulqdq,

> > > -                       avx512bitalg, movdiri, movdir64b, waitpkg, cldemote,

> > > -                       ptwrite, avx512bf16, enqcmd, avx512vp2intersect,

> > > -                       serialize, tsxldtrk, NULL);

> > > +                       avx512bitalg, avx512vpopcntdq, movdiri, movdir64b,

> > > +                       waitpkg, cldemote, ptwrite, avx512bf16, enqcmd,

> > > +                       avx512vp2intersect, serialize, tsxldtrk, NULL);

> > >      }

> > >

> > >  done:

> > > --

> > > 2.26.2

> > >

>

>

>

> --

> H.J.

Patch

diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 7612ddfb846..3a816400729 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -420,6 +420,7 @@  const char *host_detect_local_cpu (int argc, const char **argv)
   unsigned int has_avx5124fmaps = 0, has_avx5124vnniw = 0;
   unsigned int has_gfni = 0, has_avx512vbmi2 = 0;
   unsigned int has_avx512bitalg = 0;
+  unsigned int has_avx512vpopcntdq = 0;
   unsigned int has_shstk = 0;
   unsigned int has_avx512vnni = 0, has_vaes = 0;
   unsigned int has_vpclmulqdq = 0;
@@ -528,6 +529,7 @@  const char *host_detect_local_cpu (int argc, const char **argv)
       has_vaes = ecx & bit_VAES;
       has_vpclmulqdq = ecx & bit_VPCLMULQDQ;
       has_avx512bitalg = ecx & bit_AVX512BITALG;
+      has_avx512vpopcntdq = ecx & bit_AVX512VPOPCNTDQ;
       has_movdiri = ecx & bit_MOVDIRI;
       has_movdir64b = ecx & bit_MOVDIR64B;
       has_enqcmd = ecx & bit_ENQCMD;
@@ -1189,6 +1191,7 @@  const char *host_detect_local_cpu (int argc, const char **argv)
       const char *avx512vp2intersect = has_avx512vp2intersect ? " -mavx512vp2intersect" : " -mno-avx512vp2intersect";
       const char *tsxldtrk = has_tsxldtrk ? " -mtsxldtrk " : " -mno-tsxldtrk";
       const char *avx512bitalg = has_avx512bitalg ? " -mavx512bitalg" : " -mno-avx512bitalg";
+      const char *avx512vpopcntdq = has_avx512vpopcntdq ? " -mavx512vpopcntdq" : " -mno-avx512vpopcntdq";
       const char *movdiri = has_movdiri ? " -mmovdiri" : " -mno-movdiri";
       const char *movdir64b = has_movdir64b ? " -mmovdir64b" : " -mno-movdir64b";
       const char *enqcmd = has_enqcmd ? " -menqcmd" : " -mno-enqcmd";
@@ -1210,9 +1213,9 @@  const char *host_detect_local_cpu (int argc, const char **argv)
 			avx512ifma, avx512vbmi, avx5124fmaps, avx5124vnniw,
 			clwb, mwaitx, clzero, pku, rdpid, gfni, shstk,
 			avx512vbmi2, avx512vnni, vaes, vpclmulqdq,
-			avx512bitalg, movdiri, movdir64b, waitpkg, cldemote,
-			ptwrite, avx512bf16, enqcmd, avx512vp2intersect,
-			serialize, tsxldtrk, NULL);
+			avx512bitalg, avx512vpopcntdq, movdiri, movdir64b,
+			waitpkg, cldemote, ptwrite, avx512bf16, enqcmd,
+			avx512vp2intersect, serialize, tsxldtrk, NULL);
     }
 
 done: