summaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-10 12:55:41 +0000
committerkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-10 12:55:41 +0000
commite0aa57d6b04908affdf4655a6b4a9f2d4d03483b (patch)
tree7babf8190168a393c7bf3f3e6f7f6e085288e74c /libgcc
parentd813c3cd240fe8238f6d1098922e3ba305ddd0b7 (diff)
downloadgcc-e0aa57d6b04908affdf4655a6b4a9f2d4d03483b.tar.gz
Enable AVX-512 VPOPCNTD/VPOPCNTQ instructions.
gcc/ * common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512VPOPCNTDQ_SET, OPTION_MASK_ISA_AVX512VPOPCNTDQ_UNSET): New. * config.gcc: Add avx512vpopcntdqintrin.h. * config/i386/avx512vpopcntdqintrin.h: New. * config/i386/cpuid.h (bit_AVX512VPOPCNTDQ): New. * config/i386/i386-builtin-types.def: Add new types. * config/i386/i386-builtin.def (__builtin_ia32_vpopcountd_v16si, __builtin_ia32_vpopcountd_v16si_mask, __builtin_ia32_vpopcountq_v8di, __builtin_ia32_vpopcountq_v8di_mask): New. * config/i386/i386-c.c (ix86_target_macros_internal): Define __AVX512VPOPCNTDQ__. * config/i386/i386.c (ix86_target_string): Add -mavx512vpopcntdq. (PTA_AVX512VPOPCNTDQ): Define. * config/i386/i386.h (TARGET_AVX512VPOPCNTDQ, TARGET_AVX512VPOPCNTDQ_P): Define. * config/i386/i386.opt: Add mavx512vpopcntdq. * config/i386/immintrin.h: Include avx512vpopcntdqintrin.h. * config/i386/sse.md (define_insn "vpopcount<mode><mask_name>"): New. libgcc/ * config/i386/cpuinfo.h (processor_features): Add FEATURE_AVX512VPOPCNTDQ. * config/i386/cpuinfo.c (get_available_features): Habdle new feature. gcc/testsuite/ * g++.dg/other/i386-2.C: Add -mavx512vpopcntdq. * g++.dg/other/i386-3.C: Ditto. * gcc.target/i386/sse-12.c: Ditto. * gcc.target/i386/sse-13.c: Ditto. * gcc.target/i386/sse-22.c: Ditto. * gcc.target/i386/sse-23.c: Ditto. * gcc.target/i386/builtin_target.c: Handle new option. * gcc.target/i386/funcspec-56.inc: Test new attributes. * gcc.target/i386/avx512vpopcntdq-vpopcntd.c: New test. * gcc.target/i386/avx512vpopcntdq-vpopcntq.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244263 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog7
-rw-r--r--libgcc/config/i386/cpuinfo.c2
-rw-r--r--libgcc/config/i386/cpuinfo.h3
3 files changed, 11 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index f0eb567c591..87db42d8e43 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-10 Andrew Senkevich <andrew.senkevich@intel.com>
+
+ * config/i386/cpuinfo.h (processor_features): Add
+ FEATURE_AVX512VPOPCNTDQ.
+ * config/i386/cpuinfo.c (get_available_features): Habdle new
+ feature.
+
2017-01-04 Joseph Myers <joseph@codesourcery.com>
* config/mips/sfp-machine.h (_FP_CHOOSENAN): Always preserve NaN
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 9e9156b9a14..737d1aa14bd 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -277,6 +277,8 @@ get_available_features (unsigned int ecx, unsigned int edx,
features |= (1 << FEATURE_AVX5124VNNIW);
if (edx & bit_AVX5124FMAPS)
features |= (1 << FEATURE_AVX5124FMAPS);
+ if (ecx & bit_AVX512VPOPCNTDQ)
+ features |= (1 << FEATURE_AVX512VPOPCNTDQ);
}
unsigned int ext_level;
diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h
index ceb09d22cf3..872b45e3817 100644
--- a/libgcc/config/i386/cpuinfo.h
+++ b/libgcc/config/i386/cpuinfo.h
@@ -104,7 +104,8 @@ enum processor_features
FEATURE_AVX512VBMI,
FEATURE_AVX512IFMA,
FEATURE_AVX5124VNNIW,
- FEATURE_AVX5124FMAPS
+ FEATURE_AVX5124FMAPS,
+ FEATURE_AVX512VPOPCNTDQ
};
extern struct __processor_model