2 /* { dg-options "-O2 -mavx512bw" } */
3 /* { dg-require-effective-target avx512bw } */
6 #include "avx512f-helper.h"
8 #define SIZE (AVX512F_LEN / 16)
9 #include "avx512f-mask-type.h"
12 CALC (short *s
, unsigned char imm
, short *r
)
16 for (i
= 0; i
< SIZE
/ 8; i
++)
18 r
[8 * i
] = s
[8 * i
+ (imm
>> 0 & 3)];
19 r
[8 * i
+ 1] = s
[8 * i
+ (imm
>> 2 & 3)];
20 r
[8 * i
+ 2] = s
[8 * i
+ (imm
>> 4 & 3)];
21 r
[8 * i
+ 3] = s
[8 * i
+ (imm
>> 6 & 3)];
22 r
[8 * i
+ 4] = s
[8 * i
+ 4];
23 r
[8 * i
+ 5] = s
[8 * i
+ 5];
24 r
[8 * i
+ 6] = s
[8 * i
+ 6];
25 r
[8 * i
+ 7] = s
[8 * i
+ 7];
32 UNION_TYPE (AVX512F_LEN
, i_w
) s1
, res1
, res2
, res3
;
35 MASK_TYPE mask
= MASK_VALUE
;
37 for (i
= 0; i
< SIZE
; i
++)
39 s1
.a
[i
] = i
* i
* sign
;
40 res1
.a
[i
] = DEFAULT_VALUE
;
41 res2
.a
[i
] = DEFAULT_VALUE
;
42 res3
.a
[i
] = DEFAULT_VALUE
;
46 res1
.x
= INTRINSIC (_shufflelo_epi16
) (s1
.x
, 0xec);
48 INTRINSIC (_mask_shufflelo_epi16
) (res2
.x
, mask
, s1
.x
, 0xec);
49 res3
.x
= INTRINSIC (_maskz_shufflelo_epi16
) (mask
, s1
.x
, 0xec);
51 CALC (s1
.a
, 0xec, res_ref
);
53 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res1
, res_ref
))
56 MASK_MERGE (i_w
) (res_ref
, mask
, SIZE
);
57 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res2
, res_ref
))
60 MASK_ZERO (i_w
) (res_ref
, mask
, SIZE
);
61 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res3
, res_ref
))