aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512bitalg-vpopcntb.c
blob: b23da58dbaf370b2a744df98dbc3ef2011a07213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2 -mavx512bitalg -mavx512bw" } */
/* { dg-final { scan-assembler-times "vpopcntb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)"  1 } } */
/* { dg-final { scan-assembler-times "vpopcntb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"  1 } } */
/* { dg-final { scan-assembler-times "vpopcntb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"  1 } } */

#include <x86intrin.h>

extern __m512i z, z1;

int foo ()
{
  __mmask16 msk;
  __m512i c = _mm512_popcnt_epi8 (z);
  asm volatile ("" : "+v" (c));
  c = _mm512_mask_popcnt_epi8 (z, msk, z1);
  asm volatile ("" : "+v" (c));
  c = _mm512_maskz_popcnt_epi8 (msk, z);
  asm volatile ("" : "+v" (c));
}