1 /* { dg-do compile } */
2 /* { dg-options "-mavx512vl -mavx512vbmi2 -O2" } */
3 /* { dg-final { scan-assembler-times "vpcompressw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
4 /* { dg-final { scan-assembler-times "vpcompressw\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
5 /* { dg-final { scan-assembler-times "vpcompressw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
6 /* { dg-final { scan-assembler-times "vpcompressw\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
7 /* { dg-final { scan-assembler-times "vpcompressw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*\\)\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
8 /* { dg-final { scan-assembler-times "vpcompressw\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*\\)\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
9 
10 #include <immintrin.h>
11 
12 int *p;
13 volatile __m256i x1;
14 volatile __m128i x2;
15 volatile __mmask8 m8;
16 volatile __mmask16 m16;
17 
18 void extern
avx512vl_test(void)19 avx512vl_test (void)
20 {
21   x1 = _mm256_mask_compress_epi16 (x1, m16, x1);
22   x2 = _mm_mask_compress_epi16 (x2, m8, x2);
23 
24   x1 = _mm256_maskz_compress_epi16 (m16, x1);
25   x2 = _mm_maskz_compress_epi16 (m8, x2);
26 
27   _mm256_mask_compressstoreu_epi16 (p, m16, x1);
28   _mm_mask_compressstoreu_epi16 (p, m8, x2);
29 }
30