2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 64)
10 #include "avx512f-mask-type.h"
15 CALC (double *s1
, double *r
)
19 for (i
= 0; i
< SIZE
; i
++)
21 int index
= (N
>> ((i
% 4) * 2)) & 3;
23 r
[i
] = s1
[4 * base
+ index
];
30 UNION_TYPE (AVX512F_LEN
, d
) src1
, res1
, res2
, res3
;
31 MASK_TYPE mask
= MASK_VALUE
;
35 for (i
= 0; i
< SIZE
; i
++)
37 src1
.a
[i
] = i
* i
* sign
;
38 res2
.a
[i
] = DEFAULT_VALUE
;
42 res1
.x
= INTRINSIC (_permutex_pd
) (src1
.x
, N
);
43 res2
.x
= INTRINSIC (_mask_permutex_pd
) (res2
.x
, mask
, src1
.x
, N
);
44 res3
.x
= INTRINSIC (_maskz_permutex_pd
) (mask
, src1
.x
, N
);
46 CALC (src1
.a
, res_ref
);
48 if (UNION_CHECK (AVX512F_LEN
, d
) (res1
, res_ref
))
51 MASK_MERGE (d
) (res_ref
, mask
, SIZE
);
52 if (UNION_CHECK (AVX512F_LEN
, d
) (res2
, res_ref
))
55 MASK_ZERO (d
) (res_ref
, mask
, SIZE
);
56 if (UNION_CHECK (AVX512F_LEN
, d
) (res3
, res_ref
))