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.
This commit is contained in:
Jakub Jelinek 2021-08-14 11:44:46 +02:00
parent 261512fa6d
commit 240f07805d
2 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1,5 @@
/* PR target/101896 */
/* { dg-do compile } */
/* { dg-options "-O2 -mavx512f -mno-avx512bw" } */
#include "../../gcc.dg/torture/vshuf-v64qi.c"