2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 32)
10 #include "avx512f-mask-type.h"
17 #define mask_v(pos) ((CTRL & (0x3 << (pos))) >> (pos))
20 CALC (float *s1
, int *s2
, float *r
)
24 for (i
= 0; i
< SIZE
; i
++)
25 r
[i
] = s1
[(4 * (i
/ 4)) + (s2
[i
] & 0x03)];
31 UNION_TYPE (AVX512F_LEN
,) s1
, res1
, res2
, res3
;
32 UNION_TYPE (AVX512F_LEN
, i_d
) s2
;
33 MASK_TYPE mask
= MASK_VALUE
;
37 for (i
= 0; i
< SIZE
; i
++)
41 res2
.a
[i
] = DEFAULT_VALUE
;
44 res1
.x
= INTRINSIC (_permutevar_ps
) (s1
.x
, s2
.x
);
45 res2
.x
= INTRINSIC (_mask_permutevar_ps
) (res2
.x
, mask
, s1
.x
, s2
.x
);
46 res3
.x
= INTRINSIC (_maskz_permutevar_ps
) (mask
, s1
.x
, s2
.x
);
48 CALC (s1
.a
, s2
.a
, res_ref
);
50 if (UNION_CHECK (AVX512F_LEN
,) (res1
, res_ref
))
53 MASK_MERGE ()(res_ref
, mask
, SIZE
);
54 if (UNION_CHECK (AVX512F_LEN
,) (res2
, res_ref
))
57 MASK_ZERO ()(res_ref
, mask
, SIZE
);
58 if (UNION_CHECK (AVX512F_LEN
,) (res3
, res_ref
))