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 (unsigned short *r
, unsigned short *s1
, unsigned short *s2
)
15 unsigned short count
= s2
[0];
16 for (i
= 0; i
< SIZE
; i
++)
18 r
[i
] = count
< 16 ? (s1
[i
] >> count
) : 0;
26 UNION_TYPE (AVX512F_LEN
, i_w
) res1
, res2
, res3
, src1
;
27 UNION_TYPE (128, i_w
) src2
;
28 MASK_TYPE mask
= MASK_VALUE
;
29 unsigned short res_ref
[SIZE
];
31 for (i
= 0; i
< SIZE
; i
++)
33 src1
.a
[i
] = 2 + 7 * i
% 291;
36 for (i
= 0; i
< 128 / 16; i
++)
43 for (i
= 0; i
< SIZE
; i
++)
44 res2
.a
[i
] = DEFAULT_VALUE
;
46 res1
.x
= INTRINSIC (_srl_epi16
) (src1
.x
, src2
.x
);
47 res2
.x
= INTRINSIC (_mask_srl_epi16
) (res2
.x
, mask
, src1
.x
, src2
.x
);
48 res3
.x
= INTRINSIC (_maskz_srl_epi16
) (mask
, src1
.x
, src2
.x
);
50 CALC (res_ref
, src1
.a
, src2
.a
);
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
))
64 for (i
= 0; i
< SIZE
; i
++)
65 res2
.a
[i
] = DEFAULT_VALUE
;
67 res1
.x
= INTRINSIC (_srl_epi16
) (src1
.x
, src2
.x
);
68 res2
.x
= INTRINSIC (_mask_srl_epi16
) (res2
.x
, mask
, src1
.x
, src2
.x
);
69 res3
.x
= INTRINSIC (_maskz_srl_epi16
) (mask
, src1
.x
, src2
.x
);
71 CALC (res_ref
, src1
.a
, src2
.a
);
73 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res1
, res_ref
))
76 MASK_MERGE (i_w
) (res_ref
, mask
, SIZE
);
77 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res2
, res_ref
))
80 MASK_ZERO (i_w
) (res_ref
, mask
, SIZE
);
81 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res3
, res_ref
))