1 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror | FileCheck %s
2 
3 #include <immintrin.h>
4 
test_mm512_popcnt_epi64(__m512i __A)5 __m512i test_mm512_popcnt_epi64(__m512i __A) {
6   // CHECK-LABEL: @test_mm512_popcnt_epi64
7   // CHECK: @llvm.ctpop.v8i64
8   return _mm512_popcnt_epi64(__A);
9 }
test_mm512_mask_popcnt_epi64(__m512i __W,__mmask8 __U,__m512i __A)10 __m512i test_mm512_mask_popcnt_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
11   // CHECK-LABEL: @test_mm512_mask_popcnt_epi64
12   // CHECK: @llvm.ctpop.v8i64
13   // CHECK: select <8 x i1> %{{[0-9]+}}, <8 x i64> %{{[0-9]+}}, <8 x i64> {{.*}}
14   return _mm512_mask_popcnt_epi64(__W, __U, __A);
15 }
test_mm512_maskz_popcnt_epi64(__mmask8 __U,__m512i __A)16 __m512i test_mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) {
17   // CHECK-LABEL: @test_mm512_maskz_popcnt_epi64
18   // CHECK: @llvm.ctpop.v8i64
19   // CHECK: select <8 x i1> %{{[0-9]+}}, <8 x i64> %{{[0-9]+}}, <8 x i64> {{.*}}
20   return _mm512_maskz_popcnt_epi64(__U, __A);
21 }
test_mm512_popcnt_epi32(__m512i __A)22 __m512i test_mm512_popcnt_epi32(__m512i __A) {
23   // CHECK-LABEL: @test_mm512_popcnt_epi32
24   // CHECK: @llvm.ctpop.v16i32
25   return _mm512_popcnt_epi32(__A);
26 }
test_mm512_mask_popcnt_epi32(__m512i __W,__mmask16 __U,__m512i __A)27 __m512i test_mm512_mask_popcnt_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
28   // CHECK-LABEL: @test_mm512_mask_popcnt_epi32
29   // CHECK: @llvm.ctpop.v16i32
30   // CHECK: select <16 x i1> %{{[0-9]+}}, <16 x i32> %{{[0-9]+}}, <16 x i32> {{.*}}
31   return _mm512_mask_popcnt_epi32(__W, __U, __A);
32 }
test_mm512_maskz_popcnt_epi32(__mmask16 __U,__m512i __A)33 __m512i test_mm512_maskz_popcnt_epi32(__mmask16 __U, __m512i __A) {
34   // CHECK-LABEL: @test_mm512_maskz_popcnt_epi32
35   // CHECK: @llvm.ctpop.v16i32
36   // CHECK: select <16 x i1> %{{[0-9]+}}, <16 x i32> %{{[0-9]+}}, <16 x i32> {{.*}}
37   return _mm512_maskz_popcnt_epi32(__U, __A);
38 }
39