Initial support for AVX-512{VL,BW,DQ}
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vcvtuqq2pd-2.c
blob907e1d9877b534f8dc02936a313ba1890fda9108
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512dq -DAVX512DQ" } */
3 /* { dg-require-effective-target avx512dq } */
5 #include "avx512f-helper.h"
7 #define SIZE (AVX512F_LEN / 64)
8 #include "avx512f-mask-type.h"
10 void
11 CALC (unsigned long long *s, double *r)
13 int i;
15 for (i = 0; i < SIZE; i++)
16 r[i] = (double) s[i];
19 void
20 TEST (void)
22 UNION_TYPE (AVX512F_LEN, i_q) s;
23 UNION_TYPE (AVX512F_LEN, d) res1, res2, res3;
24 MASK_TYPE mask = MASK_VALUE;
25 double res_ref[SIZE];
26 int i;
28 for (i = 0; i < SIZE; i++)
30 s.a[i] = 123 * (i + 2000);
31 res2.a[i] = DEFAULT_VALUE;
34 res1.x = INTRINSIC (_cvtepu64_pd) (s.x);
35 res2.x = INTRINSIC (_mask_cvtepu64_pd) (res2.x, mask, s.x);
36 res3.x = INTRINSIC (_maskz_cvtepu64_pd) (mask, s.x);
38 CALC (s.a, res_ref);
40 if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
41 abort ();
43 MASK_MERGE (d) (res_ref, mask, SIZE);
44 if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
45 abort ();
47 MASK_ZERO (d) (res_ref, mask, SIZE);
48 if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
49 abort ();