1/* { dg-do compile } */
2/* { dg-options "-mavx512bw -mavx512vl -O2" } */
3/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)"  1 } } */
4/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
5/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
6/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
7/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
8/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
9/* { dg-final { scan-assembler-times "vpmulhrsw\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
10
11#include <immintrin.h>
12
13volatile __m512i x, y, z;
14volatile __m256i xq, yq, zq;
15volatile __m128i xw, yw, zw;
16
17void extern
18avx512bw_test (void)
19{
20  x = _mm512_mulhrs_epi16 (y, z);
21  x = _mm512_mask_mulhrs_epi16 (x, 2, y, z);
22  x = _mm512_maskz_mulhrs_epi16 (2, y, z);
23  xq = _mm256_mask_mulhrs_epi16 (xq, 2, yq, zq);
24  xq = _mm256_maskz_mulhrs_epi16 (2, yq, zq);
25  xw = _mm_mask_mulhrs_epi16 (xw, 2, yw, zw);
26  xw = _mm_maskz_mulhrs_epi16 (2, yw, zw);
27}
28