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
++)
18 t0
= (((int) src1
[i
] * (int) src2
[i
]) >> 14) + 1;
19 dst
[i
] = (short) (t0
>> 1);
26 UNION_TYPE (AVX512F_LEN
, i_w
) src1
, src2
, dst1
, dst2
, dst3
;
28 MASK_TYPE mask
= MASK_VALUE
;
31 for (i
= 0; i
< SIZE
; i
++)
35 dst2
.a
[i
] = DEFAULT_VALUE
;
39 dst1
.x
= INTRINSIC (_mulhrs_epi16
) (src1
.x
, src2
.x
);
41 INTRINSIC (_mask_mulhrs_epi16
) (dst2
.x
, mask
, src1
.x
, src2
.x
);
42 dst3
.x
= INTRINSIC (_maskz_mulhrs_epi16
) (mask
, src1
.x
, src2
.x
);
44 CALC (src1
.a
, src2
.a
, dst_ref
);
46 if (UNION_CHECK (AVX512F_LEN
, i_w
) (dst1
, dst_ref
))
49 MASK_MERGE (i_w
) (dst_ref
, mask
, SIZE
);
50 if (UNION_CHECK (AVX512F_LEN
, i_w
) (dst2
, dst_ref
))
53 MASK_ZERO (i_w
) (dst_ref
, mask
, SIZE
);
54 if (UNION_CHECK (AVX512F_LEN
, i_w
) (dst3
, dst_ref
))