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 *src1
, short *src2
, short *dst
)
16 for (i
= 0; i
< SIZE
; i
++)
17 dst
[i
] = (src1
[i
] * src2
[i
]) >> 16;
23 UNION_TYPE (AVX512F_LEN
, i_w
) src1
, src2
, dst1
, dst2
, dst3
;
25 MASK_TYPE mask
= MASK_VALUE
;
28 for (i
= 0; i
< SIZE
; i
++)
32 dst2
.a
[i
] = DEFAULT_VALUE
;
36 dst1
.x
= INTRINSIC (_mulhi_epu16
) (src1
.x
, src2
.x
);
38 INTRINSIC (_mask_mulhi_epu16
) (dst2
.x
, mask
, src1
.x
, src2
.x
);
39 dst3
.x
= INTRINSIC (_maskz_mulhi_epu16
) (mask
, src1
.x
, src2
.x
);
41 CALC (src1
.a
, src2
.a
, dst_ref
);
43 if (UNION_CHECK (AVX512F_LEN
, i_w
) (dst1
, dst_ref
))
46 MASK_MERGE (i_w
) (dst_ref
, mask
, SIZE
);
47 if (UNION_CHECK (AVX512F_LEN
, i_w
) (dst2
, dst_ref
))
50 MASK_ZERO (i_w
) (dst_ref
, mask
, SIZE
);
51 if (UNION_CHECK (AVX512F_LEN
, i_w
) (dst3
, dst_ref
))