Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vandpd-2.c
blobb629c9fa8f1ddc6bfc4760a80bcefe2ed1b400bc
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 (double *s1, double *s2, double *r)
14 int i;
15 long long tmp;
17 for (i = 0; i < SIZE; i++)
19 union U { double d; long long l; } u1, u2;
20 u1.d = s1[i];
21 u2.d = s2[i];
22 u1.l &= u2.l;
23 r[i] = u1.d;
27 void
28 TEST (void)
30 UNION_TYPE (AVX512F_LEN, d) s1, s2, res1, res2, res3;
31 MASK_TYPE mask = MASK_VALUE;
32 double res_ref[SIZE];
33 int i;
35 for (i = 0; i < SIZE; i++)
37 s1.a[i] = 13. * i;
38 s2.a[i] = 17. * i;
39 res2.a[i] = DEFAULT_VALUE;
42 res1.x = INTRINSIC (_and_pd) (s1.x, s2.x);
43 res2.x = INTRINSIC (_mask_and_pd) (res2.x, mask, s1.x, s2.x);
44 res3.x = INTRINSIC (_maskz_and_pd) (mask, s1.x, s2.x);
46 CALC (s1.a, s2.a, res_ref);
48 if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
49 abort ();
51 MASK_MERGE (d) (res_ref, mask, SIZE);
52 if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
53 abort ();
55 MASK_ZERO (d) (res_ref, mask, SIZE);
56 if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
57 abort ();