1 /* { dg-do compile } */
2 /* { dg-options "-mavx512bw -mavx512vl -O2" } */
3 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */
4 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
5 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */
6 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
7 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */
8 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
9 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */
10 
11 #include <immintrin.h>
12 
13 volatile __m512i x;
14 volatile __m256i y;
15 volatile __m128i z;
16 volatile char w;
17 volatile __mmask64 mx;
18 volatile __mmask32 my;
19 volatile __mmask16 mz;
20 
21 void extern
avx512bw_test(void)22 avx512bw_test (void)
23 {
24   x = _mm512_broadcastb_epi8 (z);
25   x = _mm512_mask_broadcastb_epi8 (x, mx, z);
26   x = _mm512_maskz_broadcastb_epi8 (mx, z);
27   y = _mm256_mask_broadcastb_epi8 (y, my, z);
28   y = _mm256_maskz_broadcastb_epi8 (my, z);
29   z = _mm_mask_broadcastb_epi8 (z, mz, z);
30   z = _mm_maskz_broadcastb_epi8 (mz, z);
31 
32   x = _mm512_set1_epi8 (w);
33   x = _mm512_mask_set1_epi8 (x, mx, w);
34   x = _mm512_maskz_set1_epi8 (mx, w);
35   y = _mm256_mask_set1_epi8 (y, my, w);
36   y = _mm256_maskz_set1_epi8 (my, w);
37   z = _mm_mask_set1_epi8 (z, mz, w);
38   z = _mm_maskz_set1_epi8 (mz, w);
39 }
40