2 /* { dg-options "-O2 -mavx512bw -DAVX512BW" } */
3 /* { dg-require-effective-target avx512bw } */
5 #include "avx512f-helper.h"
7 #define SIZE (AVX512F_LEN / 16)
8 #include "avx512f-mask-type.h"
11 CALC (short *s
, unsigned char imm
, short *r
)
15 for (i
= 0; i
< SIZE
/ 8; i
++)
18 r
[8 * i
+ 1] = s
[8 * i
+ 1];
19 r
[8 * i
+ 2] = s
[8 * i
+ 2];
20 r
[8 * i
+ 3] = s
[8 * i
+ 3];
21 r
[8 * i
+ 4] = s
[8 * i
+ (imm
>> 0 & 3) + 4];
22 r
[8 * i
+ 5] = s
[8 * i
+ (imm
>> 2 & 3) + 4];
23 r
[8 * i
+ 6] = s
[8 * i
+ (imm
>> 4 & 3) + 4];
24 r
[8 * i
+ 7] = s
[8 * i
+ (imm
>> 6 & 3) + 4];
31 UNION_TYPE (AVX512F_LEN
, i_w
) s1
, res1
, res2
, res3
;
34 MASK_TYPE mask
= MASK_VALUE
;
36 for (i
= 0; i
< SIZE
; i
++)
38 s1
.a
[i
] = i
* i
* sign
;
39 res1
.a
[i
] = DEFAULT_VALUE
;
40 res2
.a
[i
] = DEFAULT_VALUE
;
41 res3
.a
[i
] = DEFAULT_VALUE
;
45 res1
.x
= INTRINSIC (_shufflehi_epi16
) (s1
.x
, 0xec);
47 INTRINSIC (_mask_shufflehi_epi16
) (res2
.x
, mask
, s1
.x
, 0xec);
48 res3
.x
= INTRINSIC (_maskz_shufflehi_epi16
) (mask
, s1
.x
, 0xec);
50 CALC (s1
.a
, 0xec, res_ref
);
52 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res1
, res_ref
))
55 MASK_MERGE (i_w
) (res_ref
, mask
, SIZE
);
56 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res2
, res_ref
))
59 MASK_ZERO (i_w
) (res_ref
, mask
, SIZE
);
60 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res3
, res_ref
))