summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
blob: 84521e313e52fb44a2db331a2cbbf9b3b07a6af7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
/* { dg-require-effective-target avx512bw } */

#include "avx512bw-check.h"

#define N 255
unsigned int yy[10000];

void
__attribute__ ((noinline)) foo (unsigned char s)
{
   unsigned char i;
   for (i = 0; i < s; i++)
     yy[i] = (unsigned int) i;
}

void
avx512bw_test ()
{
  unsigned char i;
  foo (N);
  for (i = 0; i < N; i++)
    if ( (unsigned int)i != yy [i] )
      abort ();
}

/* { dg-final { scan-assembler-times "vpmovzxbw\[ \\t\]+\[^\n\]*%zmm" 2 } } */