summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-2.c
blob: 731b92607949c577224270740d0935f0366a624d (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
29
30
31
32
33
/* PR target/70329 */
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize -mavx512bw" } */
/* { dg-require-effective-target avx512bw } */

#define AVX512BW
#include "avx512f-helper.h"

__attribute__((noinline, noclone)) void
foo (unsigned char *src1, unsigned char *src2, unsigned char *dst)
{
  int i;

  for (i = 0; i < 64; i++)
    dst[i] = (unsigned char) ((int) src1[i] * (int) src2[i]);
}

void
TEST (void)
{
  unsigned char a[64], b[64], c[64];
  int i;

  for (i = 0; i < 64; i++)
    {
      a[i] = i;
      b[i] = (i + 1);
    }
  foo (a, b, c);
  for (i = 0; i < 64; i++)
    if (c[i] != (unsigned char) (i * (i + 1)))
      abort ();
}