2 /* { dg-require-effective-target avx512f } */
3 /* { dg-options "-O2 -mavx512f" } */
6 #include "avx512f-check.h"
7 #include "avx512f-helper.h"
13 union256d res1
, res2
, res3
;
18 for (j
= 0; j
< 8; j
++)
20 s1
.a
[j
] = j
* j
/ 4.56;
23 for (j
= 0; j
< 4; j
++)
25 res1
.a
[j
] = DEFAULT_VALUE
;
26 res2
.a
[j
] = DEFAULT_VALUE
;
27 res3
.a
[j
] = DEFAULT_VALUE
;
30 res1
.x
= _mm512_extractf64x4_pd (s1
.x
, 0);
31 res2
.x
= _mm512_mask_extractf64x4_pd (res2
.x
, mask
, s1
.x
, 0);
32 res3
.x
= _mm512_maskz_extractf64x4_pd (mask
, s1
.x
, 0);
34 memset (res_ref
, 0, 32);
35 memcpy (res_ref
, s1
.a
, 32);
37 if (check_union256d (res1
, res_ref
))
40 MASK_MERGE (d
) (res_ref
, mask
, 4);
41 if (check_union256d (res2
, res_ref
))
44 MASK_ZERO (d
) (res_ref
, mask
, 4);
45 if (check_union256d (res3
, res_ref
))
48 res1
.x
= _mm512_extractf64x4_pd (s1
.x
, 1);
49 res2
.x
= _mm512_mask_extractf64x4_pd (res2
.x
, mask
, s1
.x
, 1);
50 res3
.x
= _mm512_maskz_extractf64x4_pd (mask
, s1
.x
, 1);
52 memset (res_ref
, 0, 32);
53 memcpy (res_ref
, s1
.a
+ 4, 32);
55 if (check_union256d (res1
, res_ref
))
58 MASK_MERGE (d
) (res_ref
, mask
, 4);
59 if (check_union256d (res2
, res_ref
))
62 MASK_ZERO (d
) (res_ref
, mask
, 4);
63 if (check_union256d (res3
, res_ref
))