public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix ICE in vcond expansion with -mavx512f -mno-avx512bw (PR target/69820)
@ 2016-02-15 21:00 Jakub Jelinek
  2016-02-19 13:21 ` Kirill Yukhin
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2016-02-15 21:00 UTC (permalink / raw)
  To: Uros Bizjak, Kirill Yukhin; +Cc: gcc-patches

Hi!

We ICE on the following testcase, because vcondv32hiv32hi pattern
really needs avx512bw, but it is enabled for avx512f.
As VI_512 iterator is only used in vcond* patterns which need the
avx512bw ISA for the V64QI and V32HI modes, I've changed that iterator.
Or do you prefer to keep that iterator as is (so it will be unused)
and another one with these conditions?  If yes, how should it be called.

Bootstrapped/regtested on x86_64-linux and i686-linux.

2016-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/69820
	* config/i386/sse.md (VI_512): Only include V64QImode and V32HImode
	if TARGET_AVX512BW.

	* gcc.target/i386/pr69820.c: New test.

--- gcc/config/i386/sse.md.jj	2016-02-03 23:36:39.000000000 +0100
+++ gcc/config/i386/sse.md	2016-02-15 17:07:40.694352994 +0100
@@ -522,7 +522,10 @@ (define_mode_iterator VI_128 [V16QI V8HI
 (define_mode_iterator VI_256 [V32QI V16HI V8SI V4DI])
 
 ;; All 512bit vector integer modes
-(define_mode_iterator VI_512 [V64QI V32HI V16SI V8DI])
+(define_mode_iterator VI_512
+  [(V64QI "TARGET_AVX512BW")
+   (V32HI "TARGET_AVX512BW")
+   V16SI V8DI])
 
 ;; Various 128bit vector integer mode combinations
 (define_mode_iterator VI12_128 [V16QI V8HI])
--- gcc/testsuite/gcc.target/i386/pr69820.c.jj	2016-02-15 17:13:57.397220839 +0100
+++ gcc/testsuite/gcc.target/i386/pr69820.c	2016-02-15 17:13:28.000000000 +0100
@@ -0,0 +1,14 @@
+/* PR target/69820 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx512f -mno-avx512bw" } */
+
+int a[100], b[100];
+short c[100];
+
+void
+foo ()
+{
+  int i;
+  for (i = 0; i < 100; ++i)
+    b[i] = a[i] * (_Bool) c[i];
+}

	Jakub

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

* Re: [PATCH] Fix ICE in vcond expansion with -mavx512f -mno-avx512bw (PR target/69820)
  2016-02-15 21:00 [PATCH] Fix ICE in vcond expansion with -mavx512f -mno-avx512bw (PR target/69820) Jakub Jelinek
@ 2016-02-19 13:21 ` Kirill Yukhin
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill Yukhin @ 2016-02-19 13:21 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Uros Bizjak, gcc-patches

Hi Jakub!
On 15 Feb 22:00, Jakub Jelinek wrote:
> Hi!
> 
> We ICE on the following testcase, because vcondv32hiv32hi pattern
> really needs avx512bw, but it is enabled for avx512f.
> As VI_512 iterator is only used in vcond* patterns which need the
> avx512bw ISA for the V64QI and V32HI modes, I've changed that iterator.
> Or do you prefer to keep that iterator as is (so it will be unused)
> and another one with these conditions?  If yes, how should it be called.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux.
Patch is ok for trunk and branches.

> 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/69820
> 	* config/i386/sse.md (VI_512): Only include V64QImode and V32HImode
> 	if TARGET_AVX512BW.
> 
> 	* gcc.target/i386/pr69820.c: New test.
> 
> --- gcc/config/i386/sse.md.jj	2016-02-03 23:36:39.000000000 +0100
> +++ gcc/config/i386/sse.md	2016-02-15 17:07:40.694352994 +0100
> @@ -522,7 +522,10 @@ (define_mode_iterator VI_128 [V16QI V8HI
>  (define_mode_iterator VI_256 [V32QI V16HI V8SI V4DI])
>  
>  ;; All 512bit vector integer modes
> -(define_mode_iterator VI_512 [V64QI V32HI V16SI V8DI])
> +(define_mode_iterator VI_512
> +  [(V64QI "TARGET_AVX512BW")
> +   (V32HI "TARGET_AVX512BW")
> +   V16SI V8DI])
>  
>  ;; Various 128bit vector integer mode combinations
>  (define_mode_iterator VI12_128 [V16QI V8HI])
> --- gcc/testsuite/gcc.target/i386/pr69820.c.jj	2016-02-15 17:13:57.397220839 +0100
> +++ gcc/testsuite/gcc.target/i386/pr69820.c	2016-02-15 17:13:28.000000000 +0100
> @@ -0,0 +1,14 @@
> +/* PR target/69820 */
> +/* { dg-do compile } */
> +/* { dg-options "-O3 -mavx512f -mno-avx512bw" } */
> +
> +int a[100], b[100];
> +short c[100];
> +
> +void
> +foo ()
> +{
> +  int i;
> +  for (i = 0; i < 100; ++i)
> +    b[i] = a[i] * (_Bool) c[i];
> +}
> 
> 	Jakub
--
Thanks, K

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

end of thread, other threads:[~2016-02-19 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-15 21:00 [PATCH] Fix ICE in vcond expansion with -mavx512f -mno-avx512bw (PR target/69820) Jakub Jelinek
2016-02-19 13:21 ` Kirill Yukhin

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).