1 /* PR target/82460 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftree-vectorize -mavx512vbmi -mprefer-vector-width=none" } */
4 /* We want to reuse the permutation mask in the loop, so use vpermt2b rather
5 than vpermi2b. */
6 /* { dg-final { scan-assembler-not {\mvpermi2b\M} } } */
7 /* { dg-final { scan-assembler {\mvpermt2b\M} } } */
8
9 void
foo(unsigned char * __restrict__ x,const unsigned short * __restrict__ y,unsigned long z)10 foo (unsigned char *__restrict__ x, const unsigned short *__restrict__ y,
11 unsigned long z)
12 {
13 unsigned char *w = x + z;
14 do
15 *x++ = *y++ >> 8;
16 while (x < w);
17 }
18