]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
x86: Handle -mavx512vpopcntdq for -march=native
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 22 May 2020 11:18:34 +0000 (04:18 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 24 May 2020 11:22:50 +0000 (04:22 -0700)
Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.

PR target/95258
* config/i386/driver-i386.c (host_detect_local_cpu): Detect
AVX512VPOPCNTDQ.

(cherry picked from commit 808b611bfb4b05703ea174e50874c711dca44c98)

gcc/ChangeLog
gcc/config/i386/driver-i386.c

index fb53bcc1934f5a12fda5ee7d750603eb64f18751..ac0ecbe906a9f1eb1ab24fab9086a46d835691d0 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/95258
+       * config/i386/driver-i386.c (host_detect_local_cpu): Detect
+       AVX512VPOPCNTDQ.
+
 2020-05-22  Bin Cheng  <bin.cheng@linux.alibaba.com>
 
        Backport from master
index 75f7026951775c055f142952285c9a2fd7694002..8d97aba560a9ea4c73af6a7a542f8801e3920d36 100644 (file)
@@ -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;
@@ -523,6 +524,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_cldemote = ecx & bit_CLDEMOTE;
@@ -1138,6 +1140,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
       const char *vaes = has_vaes ? " -mvaes" : " -mno-vaes";
       const char *vpclmulqdq = has_vpclmulqdq ? " -mvpclmulqdq" : " -mno-vpclmulqdq";
       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 *waitpkg = has_waitpkg ? " -mwaitpkg" : " -mno-waitpkg";
@@ -1156,9 +1159,8 @@ 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,
-                       NULL);
+                       avx512bitalg, avx512vpopcntdq, movdiri, movdir64b,
+                       waitpkg, cldemote, ptwrite, NULL);
     }
 
 done: