From: Sebastian Peryt Date: Wed, 28 Jun 2017 20:59:51 +0000 (+0200) Subject: * config/i386/avx512vlintrin.h (_mm256_permutexvar_epi64) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=395a191d0b79c5a42105a8559e4385fb25ee0afd;p=gcc.git * config/i386/avx512vlintrin.h (_mm256_permutexvar_epi64) (_mm256_permutexvar_epi32, _mm256_permutex_epi64): New intrinsics. testsuite/ChangeLog: * gcc.target/i386/avx512vl-vpermd-1.c (_mm256_permutexvar_epi32): Test new intrinsic. * gcc.target/i386/avx512vl-vpermq-imm-1.c (_mm256_permutex_epi64): Ditto. * gcc.target/i386/avx512vl-vpermq-var-1.c (_mm256_permutexvar_epi64): Ditto. * gcc.target/i386/avx512f-vpermd-2.c: Do not check for AVX512F_LEN. * gcc.target/i386/avx512f-vpermq-imm-2.c: Ditto. * gcc.target/i386/avx512f-vpermq-var-2.c: Ditto. From-SVN: r249759 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ecc04d9c19..c7523753620 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-06-28 Sebastian Peryt + + * config/i386/avx512vlintrin.h (_mm256_permutexvar_epi64) + (_mm256_permutexvar_epi32, _mm256_permutex_epi64): New intrinsics. + 2017-06-28 Szabolcs Nagy * config.gcc (*-linux-musl*): Add t-musl tmake_file. diff --git a/gcc/config/i386/avx512vlintrin.h b/gcc/config/i386/avx512vlintrin.h index f62f641188e..05550516e44 100644 --- a/gcc/config/i386/avx512vlintrin.h +++ b/gcc/config/i386/avx512vlintrin.h @@ -9097,6 +9097,17 @@ _mm_maskz_mul_epi32 (__mmask8 __M, __m128i __X, __m128i __Y) __M); } +extern __inline __m256i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_permutexvar_epi64 (__m256i __X, __m256i __Y) +{ + return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, + (__v4di) __X, + (__v4di) + _mm256_setzero_si256 (), + (__mmask8) -1); +} + extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mask_permutexvar_epi64 (__m256i __W, __mmask8 __M, __m256i __X, @@ -9161,6 +9172,17 @@ _mm_maskz_mul_epu32 (__mmask8 __M, __m128i __X, __m128i __Y) __M); } +extern __inline __m256i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_permutexvar_epi32 (__m256i __X, __m256i __Y) +{ + return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, + (__v8si) __X, + (__v8si) + _mm256_setzero_si256 (), + (__mmask8) -1); +} + extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mask_permutexvar_epi32 (__m256i __W, __mmask8 __M, __m256i __X, @@ -9749,6 +9771,17 @@ _mm_cmple_epi64_mask (__m128i __X, __m128i __Y) } #ifdef __OPTIMIZE__ +extern __inline __m256i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_permutex_epi64 (__m256i __X, const int __I) +{ + return (__m256i) __builtin_ia32_permdi256_mask ((__v4di) __X, + __I, + (__v4di) + _mm256_setzero_si256(), + (__mmask8) -1); +} + extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mask_permutex_epi64 (__m256i __W, __mmask8 __M, @@ -12367,6 +12400,13 @@ _mm256_permutex_pd (__m256d __X, const int __M) _mm256_undefined_pd (), \ (__mmask8)-1)) +#define _mm256_permutex_epi64(X, I) \ + ((__m256i) __builtin_ia32_permdi256_mask ((__v4di)(__m256i)(X), \ + (int)(I), \ + (__v4di)(__m256i) \ + (_mm256_setzero_si256 ()),\ + (__mmask8) -1)) + #define _mm256_maskz_permutex_epi64(M, X, I) \ ((__m256i) __builtin_ia32_permdi256_mask ((__v4di)(__m256i)(X), \ (int)(I), \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b279fa6a7b..661ef8fcd1a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2017-06-28 Sebastian Peryt + + * gcc.target/i386/avx512vl-vpermd-1.c (_mm256_permutexvar_epi32): + Test new intrinsic. + * gcc.target/i386/avx512vl-vpermq-imm-1.c (_mm256_permutex_epi64): + Ditto. + * gcc.target/i386/avx512vl-vpermq-var-1.c (_mm256_permutexvar_epi64): + Ditto. + * gcc.target/i386/avx512f-vpermd-2.c: Do not check for AVX512F_LEN. + * gcc.target/i386/avx512f-vpermq-imm-2.c: Ditto. + * gcc.target/i386/avx512f-vpermq-var-2.c: Ditto. + 2017-06-28 Thomas Preud'homme * lib/target-supports.exp (check_effective_target_vect_int): Replace diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpermd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpermd-2.c index dbd4544c39e..b36a9c2da0a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpermd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpermd-2.c @@ -41,18 +41,14 @@ TEST (void) res3.a[i] = DEFAULT_VALUE; } -#if AVX512F_LEN == 512 res1.x = INTRINSIC (_permutexvar_epi32) (src1.x, src2.x); -#endif res2.x = INTRINSIC (_maskz_permutexvar_epi32) (mask, src1.x, src2.x); res3.x = INTRINSIC (_mask_permutexvar_epi32) (res3.x, mask, src1.x, src2.x); CALC (src1.a, src2.a, res_ref); -#if AVX512F_LEN == 512 if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) abort (); -#endif MASK_ZERO (i_d) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpermq-imm-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpermq-imm-2.c index 770d5623f5f..dd88cd46c0b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpermq-imm-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpermq-imm-2.c @@ -40,18 +40,14 @@ TEST (void) res3.a[i] = DEFAULT_VALUE; } -#if AVX512F_LEN == 512 res1.x = INTRINSIC (_permutex_epi64) (src1.x, IMM_MASK); -#endif res2.x = INTRINSIC (_maskz_permutex_epi64) (mask, src1.x, IMM_MASK); res3.x = INTRINSIC (_mask_permutex_epi64) (res3.x, mask, src1.x, IMM_MASK); CALC (src1.a, IMM_MASK, res_ref); -#if AVX512F_LEN == 512 if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) abort (); -#endif MASK_ZERO (i_q) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpermq-var-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpermq-var-2.c index c596b1d9c40..6c222888e88 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpermq-var-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpermq-var-2.c @@ -41,18 +41,14 @@ TEST (void) res3.a[i] = DEFAULT_VALUE; } -#if AVX512F_LEN == 512 res1.x = INTRINSIC (_permutexvar_epi64) (src1.x, src2.x); -#endif res2.x = INTRINSIC (_maskz_permutexvar_epi64) (mask, src1.x, src2.x); res3.x = INTRINSIC (_mask_permutexvar_epi64) (res3.x, mask, src1.x, src2.x); CALC (src1.a, src2.a, res_ref); -#if AVX512F_LEN == 512 if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) abort (); -#endif MASK_ZERO (i_q) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpermd-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpermd-1.c index fa1aaa390ab..069bb5d6c63 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpermd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpermd-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-mavx512vl -O2" } */ +/* { dg-final { scan-assembler-times "vpermd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpermd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpermd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -11,6 +12,7 @@ volatile __mmask8 m; void extern avx512vl_test (void) { + x = _mm256_permutexvar_epi32 (x, x); x = _mm256_maskz_permutexvar_epi32 (m, x, x); x = _mm256_mask_permutexvar_epi32 (x, m, x, x); } diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-imm-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-imm-1.c index c74c8ce96c7..2340a6d9993 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-imm-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-imm-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-mavx512vl -O2" } */ +/* { dg-final { scan-assembler-times "vpermq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpermq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpermq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -11,6 +12,7 @@ volatile __mmask8 m; void extern avx512vl_test (void) { + x = _mm256_permutex_epi64 (x, 13); x = _mm256_mask_permutex_epi64 (x, m, x, 13); x = _mm256_maskz_permutex_epi64 (m, x, 13); } diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-var-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-var-1.c index 43ccad3d6c1..69185e50f76 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-var-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpermq-var-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-mavx512vl -O2" } */ +/* { dg-final { scan-assembler-times "vpermq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpermq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpermq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -11,6 +12,7 @@ volatile __mmask8 m; void extern avx512vl_test (void) { + x = _mm256_permutexvar_epi64 (x, x); x = _mm256_maskz_permutexvar_epi64 (m, x, x); x = _mm256_mask_permutexvar_epi64 (x, m, x, x); }