1 /* { dg-do compile } */
2 /* { dg-options "-mavx512bw -mavx512vl -O2" } */
3 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
4 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
5 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
6 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
7 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
8 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
9 /* { dg-final { scan-assembler-times "vpunpckhwd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
10 
11 #include <immintrin.h>
12 
13 volatile __m512i d, e, f;
14 volatile __m256i x, y, z;
15 volatile __m128i a, b, c;
16 volatile __mmask32 m1;
17 volatile __mmask16 m2;
18 volatile __mmask8 m3;
19 
20 void extern
avx512bw_test(void)21 avx512bw_test (void)
22 {
23   d = _mm512_unpackhi_epi16 (e, f);
24   d = _mm512_mask_unpackhi_epi16 (d, m1, e, f);
25   d = _mm512_maskz_unpackhi_epi16 (m1, e, f);
26   x = _mm256_mask_unpackhi_epi16 (x, m2, y, z);
27   x = _mm256_maskz_unpackhi_epi16 (m2, y, z);
28   a = _mm_mask_unpackhi_epi16 (a, m3, b, c);
29   a = _mm_maskz_unpackhi_epi16 (m3, b, c);
30 }
31