From: Jakub Jelinek Date: Thu, 9 Mar 2017 09:09:27 +0000 (+0100) Subject: re PR target/79932 (_mm512_packus_epi32 does not compile under -O0) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=030fc94af235ebe4ff2b2e873e2aa807e2b5c9c3;p=gcc.git re PR target/79932 (_mm512_packus_epi32 does not compile under -O0) PR target/79932 * config/i386/avx512bwintrin.h (_mm512_packs_epi32, _mm512_maskz_packs_epi32, _mm512_mask_packs_epi32, _mm512_packus_epi32, _mm512_maskz_packus_epi32, _mm512_mask_packus_epi32): Move definitions outside of __OPTIMIZE__ guarded section. * gcc.target/i386/pr79932-1.c: New test. From-SVN: r245989 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index de662f1e349..33f340b49b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-03-09 Jakub Jelinek + + PR target/79932 + * config/i386/avx512bwintrin.h (_mm512_packs_epi32, + _mm512_maskz_packs_epi32, _mm512_mask_packs_epi32, + _mm512_packus_epi32, _mm512_maskz_packus_epi32, + _mm512_mask_packus_epi32): Move definitions outside of __OPTIMIZE__ + guarded section. + 2017-03-09 Andreas Krebbel * config/s390/vx-builtins.md ("vfee", "vfeez") diff --git a/gcc/config/i386/avx512bwintrin.h b/gcc/config/i386/avx512bwintrin.h index d05eed2cb95..2b0fb6b5f08 100644 --- a/gcc/config/i386/avx512bwintrin.h +++ b/gcc/config/i386/avx512bwintrin.h @@ -2656,6 +2656,72 @@ _mm512_cmple_epi16_mask (__m512i __X, __m512i __Y) (__mmask32) -1); } +extern __inline __m512i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_packs_epi32 (__m512i __A, __m512i __B) +{ + return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, + (__v16si) __B, + (__v32hi) + _mm512_setzero_si512 (), + (__mmask32) -1); +} + +extern __inline __m512i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_maskz_packs_epi32 (__mmask32 __M, __m512i __A, __m512i __B) +{ + return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, + (__v16si) __B, + (__v32hi) + _mm512_setzero_si512 (), + __M); +} + +extern __inline __m512i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_packs_epi32 (__m512i __W, __mmask32 __M, __m512i __A, + __m512i __B) +{ + return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, + (__v16si) __B, + (__v32hi) __W, + __M); +} + +extern __inline __m512i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_packus_epi32 (__m512i __A, __m512i __B) +{ + return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, + (__v16si) __B, + (__v32hi) + _mm512_setzero_si512 (), + (__mmask32) -1); +} + +extern __inline __m512i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_maskz_packus_epi32 (__mmask32 __M, __m512i __A, __m512i __B) +{ + return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, + (__v16si) __B, + (__v32hi) + _mm512_setzero_si512 (), + __M); +} + +extern __inline __m512i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_packus_epi32 (__m512i __W, __mmask32 __M, __m512i __A, + __m512i __B) +{ + return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, + (__v16si) __B, + (__v32hi) __W, + __M); +} + #ifdef __OPTIMIZE__ extern __inline __mmask32 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) @@ -3011,72 +3077,6 @@ _mm512_cmp_epu8_mask (__m512i __X, __m512i __Y, const int __P) (__mmask64) -1); } -extern __inline __m512i -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_packs_epi32 (__m512i __A, __m512i __B) -{ - return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, - (__v16si) __B, - (__v32hi) - _mm512_setzero_si512 (), - (__mmask32) -1); -} - -extern __inline __m512i -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_maskz_packs_epi32 (__mmask32 __M, __m512i __A, __m512i __B) -{ - return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, - (__v16si) __B, - (__v32hi) - _mm512_setzero_si512 (), - __M); -} - -extern __inline __m512i -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_packs_epi32 (__m512i __W, __mmask32 __M, __m512i __A, - __m512i __B) -{ - return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, - (__v16si) __B, - (__v32hi) __W, - __M); -} - -extern __inline __m512i -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_packus_epi32 (__m512i __A, __m512i __B) -{ - return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, - (__v16si) __B, - (__v32hi) - _mm512_setzero_si512 (), - (__mmask32) -1); -} - -extern __inline __m512i -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_maskz_packus_epi32 (__mmask32 __M, __m512i __A, __m512i __B) -{ - return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, - (__v16si) __B, - (__v32hi) - _mm512_setzero_si512 (), - __M); -} - -extern __inline __m512i -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_packus_epi32 (__m512i __W, __mmask32 __M, __m512i __A, - __m512i __B) -{ - return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, - (__v16si) __B, - (__v32hi) __W, - __M); -} - extern __inline __m512i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_bslli_epi128 (__m512i __A, const int __N) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c8ab1d87fb..ebe5a4a342c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-09 Jakub Jelinek + + PR target/79932 + * gcc.target/i386/pr79932-1.c: New test. + 2017-03-09 Marek Polacek PR c++/79900 - ICE in strip_typedefs diff --git a/gcc/testsuite/gcc.target/i386/pr79932-1.c b/gcc/testsuite/gcc.target/i386/pr79932-1.c new file mode 100644 index 00000000000..fee42b90c1b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr79932-1.c @@ -0,0 +1,19 @@ +/* PR target/79932 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -mavx512bw" } */ + +#include + +__m512i a, b, c, d, e, f, g, h, i; +__mmask32 m; + +void +foo (void) +{ + d = _mm512_packs_epi32 (a, b); + e = _mm512_maskz_packs_epi32 (m, a, b); + f = _mm512_mask_packs_epi32 (c, m, a, b); + g = _mm512_packus_epi32 (a, b); + h = _mm512_maskz_packus_epi32 (m, a, b); + i = _mm512_mask_packus_epi32 (c, m, a, b); +}