public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix up avx512bwintrin.h with -O0 (PR target/79932)
@ 2017-03-07 18:53 Jakub Jelinek
  2017-03-09  8:38 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2017-03-07 18:53 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

Hi!

As mentioned in the PR, 6 intrinsics were only defined in section
guarded with #ifdef __OPTIMIZE__ (unnecessarily, because the intrinsics
don't have any immediate argument that must be constant) and without
#defines for -O0.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2017-03-07  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.

	* gcc.target/i386/pr79932-1.c: New test.

--- gcc/config/i386/avx512bwintrin.h.jj	2017-01-23 18:09:48.000000000 +0100
+++ gcc/config/i386/avx512bwintrin.h	2017-03-07 07:47:28.900049849 +0100
@@ -2656,6 +2656,72 @@ _mm512_cmple_epi16_mask (__m512i __X, __
 						  (__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__))
@@ -3012,72 +3078,6 @@ _mm512_cmp_epu8_mask (__m512i __X, __m51
 }
 
 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)
 {
--- gcc/testsuite/gcc.target/i386/pr79932-1.c.jj	2017-03-07 07:54:45.181339418 +0100
+++ gcc/testsuite/gcc.target/i386/pr79932-1.c	2017-03-07 07:54:24.000000000 +0100
@@ -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);
+}

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix up avx512bwintrin.h with -O0 (PR target/79932)
  2017-03-07 18:53 [PATCH] Fix up avx512bwintrin.h with -O0 (PR target/79932) Jakub Jelinek
@ 2017-03-09  8:38 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2017-03-09  8:38 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Tue, Mar 7, 2017 at 7:52 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> As mentioned in the PR, 6 intrinsics were only defined in section
> guarded with #ifdef __OPTIMIZE__ (unnecessarily, because the intrinsics
> don't have any immediate argument that must be constant) and without
> #defines for -O0.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
>
> 2017-03-07  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.
>
>         * gcc.target/i386/pr79932-1.c: New test.

OK for trunk and backports.

Thanks,
Uros.

> --- gcc/config/i386/avx512bwintrin.h.jj 2017-01-23 18:09:48.000000000 +0100
> +++ gcc/config/i386/avx512bwintrin.h    2017-03-07 07:47:28.900049849 +0100
> @@ -2656,6 +2656,72 @@ _mm512_cmple_epi16_mask (__m512i __X, __
>                                                   (__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__))
> @@ -3012,72 +3078,6 @@ _mm512_cmp_epu8_mask (__m512i __X, __m51
>  }
>
>  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)
>  {
> --- gcc/testsuite/gcc.target/i386/pr79932-1.c.jj        2017-03-07 07:54:45.181339418 +0100
> +++ gcc/testsuite/gcc.target/i386/pr79932-1.c   2017-03-07 07:54:24.000000000 +0100
> @@ -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);
> +}
>
>         Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-09  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 18:53 [PATCH] Fix up avx512bwintrin.h with -O0 (PR target/79932) Jakub Jelinek
2017-03-09  8:38 ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).