re PR target/79932 (_mm512_packus_epi32 does not compile under -O0)
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 Mar 2017 09:09:27 +0000 (10:09 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 9 Mar 2017 09:09:27 +0000 (10:09 +0100)
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

gcc/ChangeLog
gcc/config/i386/avx512bwintrin.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr79932-1.c [new file with mode: 0644]

index de662f1e349575db0d4d7760b419228fc53082ea..33f340b49b8ccecab464401c9c1fe6ce5a4cc53f 100644 (file)
@@ -1,3 +1,12 @@
+2017-03-09  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <krebbel@linux.vnet.ibm.com>
 
        * config/s390/vx-builtins.md ("vfee<mode>", "vfeez<mode>")
index d05eed2cb95d0fbc9cbea4bece5663acd044d1a9..2b0fb6b5f08afa8789b711f4eb13ce63bfd8296f 100644 (file)
@@ -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)
index 6c8ab1d87fb5767618e327d96b79edfae7bc0b79..ebe5a4a342c84de938d200242f967dc100d1d5e6 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/79932
+       * gcc.target/i386/pr79932-1.c: New test.
+
 2017-03-09  Marek Polacek  <polacek@redhat.com>
 
        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 (file)
index 0000000..fee42b9
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR target/79932 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -mavx512bw" } */
+
+#include <x86intrin.h>
+
+__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);
+}