PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vcvtqq2pd-2.c
blobc1bfee86bae9bb2f731c62bd1d78b66e78941b4c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512dq" } */
3 /* { dg-require-effective-target avx512dq } */
5 #define AVX512DQ
6 #include "avx512f-helper.h"
8 #define SIZE (AVX512F_LEN / 64)
9 #include "avx512f-mask-type.h"
11 void
12 CALC (long long *s, double *r)
14 int i;
16 for (i = 0; i < SIZE; i++)
17 r[i] = (double) s[i];
20 void
21 TEST (void)
23 UNION_TYPE (AVX512F_LEN, i_q) s;
24 UNION_TYPE (AVX512F_LEN, d) res1, res2, res3;
25 MASK_TYPE mask = MASK_VALUE;
26 double res_ref[SIZE];
27 int i, sign = 1;
29 for (i = 0; i < SIZE; i++)
31 s.a[i] = 123 * (i + 2000) * sign;
32 res2.a[i] = DEFAULT_VALUE;
33 sign = -sign;
36 res1.x = INTRINSIC (_cvtepi64_pd) (s.x);
37 res2.x = INTRINSIC (_mask_cvtepi64_pd) (res2.x, mask, s.x);
38 res3.x = INTRINSIC (_maskz_cvtepi64_pd) (mask, s.x);
40 CALC (s.a, res_ref);
42 if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
43 abort ();
45 MASK_MERGE (d) (res_ref, mask, SIZE);
46 if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
47 abort ();
49 MASK_ZERO (d) (res_ref, mask, SIZE);
50 if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
51 abort ();