Enable AVX-512 VPOPCNTD/VPOPCNTQ instructions.
authorAndrew Senkevich <andrew.senkevich@intel.com>
Tue, 10 Jan 2017 12:55:41 +0000 (12:55 +0000)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Tue, 10 Jan 2017 12:55:41 +0000 (12:55 +0000)
commit79fc8ffe6cd6e4b23c797e166ea3b0c1c0703c29
tree7babf8190168a393c7bf3f3e6f7f6e085288e74c
parentf9a27859dffe12c32364e2d7be40d2142e85c5f0
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.

From-SVN: r244263
27 files changed:
gcc/ChangeLog
gcc/common/config/i386/i386-common.c
gcc/config.gcc
gcc/config/i386/avx512vpopcntdqintrin.h [new file with mode: 0644]
gcc/config/i386/cpuid.h
gcc/config/i386/i386-builtin-types.def
gcc/config/i386/i386-builtin.def
gcc/config/i386/i386-c.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.opt
gcc/config/i386/immintrin.h
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/i386-2.C
gcc/testsuite/g++.dg/other/i386-3.C
gcc/testsuite/gcc.target/i386/avx512vpopcntdq-vpopcntd.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512vpopcntdq-vpopcntq.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/builtin_target.c
gcc/testsuite/gcc.target/i386/funcspec-56.inc
gcc/testsuite/gcc.target/i386/sse-12.c
gcc/testsuite/gcc.target/i386/sse-13.c
gcc/testsuite/gcc.target/i386/sse-22.c
gcc/testsuite/gcc.target/i386/sse-23.c
libgcc/ChangeLog
libgcc/config/i386/cpuinfo.c
libgcc/config/i386/cpuinfo.h