Initial support for AVX-512{VL,BW,DQ}
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vcvtqq2pd-2.c
blob7143415198be5bcd095346cac2d69b817c34bcfb
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 (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, sign = 1;
28 for (i = 0; i < SIZE; i++)
30 s.a[i] = 123 * (i + 2000) * sign;
31 res2.a[i] = DEFAULT_VALUE;
32 sign = -sign;
35 res1.x = INTRINSIC (_cvtepi64_pd) (s.x);
36 res2.x = INTRINSIC (_mask_cvtepi64_pd) (res2.x, mask, s.x);
37 res3.x = INTRINSIC (_maskz_cvtepi64_pd) (mask, s.x);
39 CALC (s.a, res_ref);
41 if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
42 abort ();
44 MASK_MERGE (d) (res_ref, mask, SIZE);
45 if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
46 abort ();
48 MASK_ZERO (d) (res_ref, mask, SIZE);
49 if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
50 abort ();