2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
10 #define SIZE (AVX512F_LEN / 32)
11 #include "avx512f-mask-type.h"
14 CALC (int *mask
, int *src1
, int *dst
)
18 for (i
= 0; i
< SIZE
; i
++)
20 #if AVX512F_LEN == 512
21 dst
[i
] = src1
[mask
[i
] & 15];
23 dst
[i
] = src1
[mask
[i
] & 7];
31 UNION_TYPE (AVX512F_LEN
, i_d
) res1
, res2
, res3
, src1
, src2
;
32 MASK_TYPE mask
= MASK_VALUE
;
36 for (i
= 0; i
< SIZE
; i
++)
38 src1
.a
[i
] = (i
+ 10) * (i
+ 10) * sign
;
41 res3
.a
[i
] = DEFAULT_VALUE
;
44 #if AVX512F_LEN == 512
45 res1
.x
= INTRINSIC (_permutexvar_epi32
) (src1
.x
, src2
.x
);
47 res2
.x
= INTRINSIC (_maskz_permutexvar_epi32
) (mask
, src1
.x
, src2
.x
);
48 res3
.x
= INTRINSIC (_mask_permutexvar_epi32
) (res3
.x
, mask
, src1
.x
, src2
.x
);
50 CALC (src1
.a
, src2
.a
, res_ref
);
52 #if AVX512F_LEN == 512
53 if (UNION_CHECK (AVX512F_LEN
, i_d
) (res1
, res_ref
))
57 MASK_ZERO (i_d
) (res_ref
, mask
, SIZE
);
58 if (UNION_CHECK (AVX512F_LEN
, i_d
) (res2
, res_ref
))
61 MASK_MERGE (i_d
) (res_ref
, mask
, SIZE
);
62 if (UNION_CHECK (AVX512F_LEN
, i_d
) (res3
, res_ref
))