public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-2907] i386: Fix ICE with V64QImode broadcast permutation with -mavx512f -mno-avx512bw
Date: Sat, 14 Aug 2021 09:48:14 +0000 (GMT)	[thread overview]
Message-ID: <20210814094814.BA3BD3858425@sourceware.org> (raw)

https://gcc.gnu.org/g:240f07805db27cfc746276039c5edccb4c031070

commit r12-2907-g240f07805db27cfc746276039c5edccb4c031070
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Aug 14 11:44:46 2021 +0200

    i386: Fix ICE with V64QImode broadcast permutation with -mavx512f -mno-avx512bw
    
    The testcase shows another problem, for TARGET_AVX512BW we have a single insn
    doing broadcast from the first element, but don't have one for broadcast
    of 2nd+ element (so for d->perm[0] we must return false), but for
    TARGET_AVX512F && !TARGET_AVX512BW we don't even have support for that other
    broadcast.  V64QImode case was just added to the AVX2 cases which had
    gcc_assert (!TARGET_AVX2 || d->perm[0]);
    but for V64QImode we actually need
    gcc_assert (!TARGET_AVX512BW || d->perm[0]);
    
    2021-08-14  Jakub Jelinek  <jakub@redhat.com>
    
            PR target/101896
            * config/i386/i386-expand.c (expand_vec_perm_broadcast_1)
            <case E_V64QImode>: For this mode assert
            !TARGET_AVX512BW || d->perm[0] rather than !TARGET_AVX2 || d->perm[0].
    
            * gcc.target/i386/avx512f-pr101896.c: New test.

Diff:
---
 gcc/config/i386/i386-expand.c                    | 5 ++++-
 gcc/testsuite/gcc.target/i386/avx512f-pr101896.c | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index a652b25f534..4d7349cfc7c 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -20474,7 +20474,6 @@ expand_vec_perm_broadcast_1 (struct expand_vec_perm_d *d)
       emit_move_insn (d->target, gen_lowpart (d->vmode, dest));
       return true;
 
-    case E_V64QImode:
     case E_V32QImode:
     case E_V16HImode:
     case E_V8SImode:
@@ -20484,6 +20483,10 @@ expand_vec_perm_broadcast_1 (struct expand_vec_perm_d *d)
       gcc_assert (!TARGET_AVX2 || d->perm[0]);
       return false;
 
+    case E_V64QImode:
+      gcc_assert (!TARGET_AVX512BW || d->perm[0]);
+      return false;
+
     case E_V32HImode:
       gcc_assert (!TARGET_AVX512BW);
       return false;
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr101896.c b/gcc/testsuite/gcc.target/i386/avx512f-pr101896.c
new file mode 100644
index 00000000000..c1805cccac4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr101896.c
@@ -0,0 +1,5 @@
+/* PR target/101896 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512f -mno-avx512bw" } */
+
+#include "../../gcc.dg/torture/vshuf-v64qi.c"


                 reply	other threads:[~2021-08-14  9:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210814094814.BA3BD3858425@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).