summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
blob: f4bd7e7a60e9876a2d8cbd85fbe51bc621aa30cf (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
34
35
36
37
38
39
40
/* { dg-do run } */
/* { dg-options "-O2 -mavx512cd" } */
/* { dg-require-effective-target avx512cd } */

#define HAVE_512
#define AVX512CD

#include "avx512f-helper.h"

#define SIZE (AVX512F_LEN / 32)

static void
CALC (int *res, __mmask16 src)
{
  int i;

  for (i = 0; i < SIZE; i++)
    res[i] = src;
}

void
TEST (void)
{
  int i;
  UNION_TYPE (AVX512F_LEN, i_d) res;
  int res_ref[SIZE];
  __mmask16 src = 0;

  for (i = 0; i < SIZE; i++)
    {
      res.a[i] = -1;
    }

  res.x = INTRINSIC (_broadcastmw_epi32) (src);

  CALC (res_ref, src);

  if (UNION_CHECK (AVX512F_LEN, i_d) (res, res_ref))
    abort ();
}