1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -mavx512bitalg -mavx512bw" } */ 3 /* { dg-final { scan-assembler-times "vpopcntb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ 4 /* { dg-final { scan-assembler-times "vpopcntb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ 5 /* { dg-final { scan-assembler-times "vpopcntb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ 6 7 #include <x86intrin.h> 8 9 extern __m512i z, z1; 10 foo()11int foo () 12 { 13 __mmask16 msk; 14 __m512i c = _mm512_popcnt_epi8 (z); 15 asm volatile ("" : "+v" (c)); 16 c = _mm512_mask_popcnt_epi8 (z1, msk, z); 17 asm volatile ("" : "+v" (c)); 18 c = _mm512_maskz_popcnt_epi8 (msk, z); 19 asm volatile ("" : "+v" (c)); 20 } 21