Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vextractf64x2-2.c
blob5beace84163fa14cf8fa92bfe4d93a9deea7fb4b
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"
10 #include "string.h"
12 void
13 CALC (double *s1, double *res_ref, int mask)
15 memset (res_ref, 0, 16);
16 memcpy (res_ref, s1 + mask * 2, 16);
19 void
20 TEST (void)
22 UNION_TYPE (AVX512F_LEN, d) s1;
23 union128d res1, res2, res3;
24 double res_ref[2];
25 MASK_TYPE mask = MASK_VALUE;
26 int j;
28 for (j = 0; j < SIZE; j++)
30 s1.a[j] = j * j / 4.56;
33 for (j = 0; j < 2; j++)
35 res1.a[j] = DEFAULT_VALUE;
36 res2.a[j] = DEFAULT_VALUE;
37 res3.a[j] = DEFAULT_VALUE;
40 res1.x = INTRINSIC (_extractf64x2_pd) (s1.x, 1);
41 res2.x = INTRINSIC (_mask_extractf64x2_pd) (res2.x, mask, s1.x, 1);
42 res3.x = INTRINSIC (_maskz_extractf64x2_pd) (mask, s1.x, 1);
43 CALC (s1.a, res_ref, 1);
45 if (check_union128d (res1, res_ref))
46 abort ();
48 MASK_MERGE (d) (res_ref, mask, 2);
49 if (check_union128d (res2, res_ref))
50 abort ();
52 MASK_ZERO (d) (res_ref, mask, 2);
53 if (check_union128d (res3, res_ref))
54 abort ();