gcc/ChangeLog:
* config/i386/i386-expand.cc (expand_vec_perm_blend): Generate
vpblendd instead of vpblendw for V4SI under avx2.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr88828-0.c: Adjust testcase.
goto do_subreg;
case E_V4SImode:
- for (i = 0; i < 4; ++i)
- mask |= (d->perm[i] >= 4 ? 3 : 0) << (i * 2);
- vmode = V8HImode;
- goto do_subreg;
+ if (TARGET_AVX2)
+ {
+ /* Use vpblendd instead of vpblendw. */
+ for (i = 0; i < nelt; ++i)
+ mask |= ((unsigned HOST_WIDE_INT) (d->perm[i] >= nelt)) << i;
+ break;
+ }
+ else
+ {
+ for (i = 0; i < 4; ++i)
+ mask |= (d->perm[i] >= 4 ? 3 : 0) << (i * 2);
+ vmode = V8HImode;
+ goto do_subreg;
+ }
case E_V16QImode:
/* See if bytes move in pairs so we can use pblendw with
/* { dg-do compile } */
-/* { dg-options "-O2 -msse4.2" } */
+/* { dg-options "-O2 -msse4.2 -mno-avx2" } */
typedef int v4si __attribute__((vector_size(16)));
typedef float v4sf __attribute__((vector_size(16)));