| 1 |
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror | FileCheck %s |
| 2 |
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror | FileCheck %s |
| 4 |
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror | FileCheck %s |
| 5 |
|
| 6 |
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s |
| 7 |
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s |
| 8 |
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s |
| 9 |
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512vpopcntdq -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s |
| 10 |
|
| 11 |
|
| 12 |
#include <immintrin.h> |
| 13 |
#include "builtin_test_helpers.h" |
| 14 |
|
| 15 |
__m512i test_mm512_popcnt_epi64(__m512i __A) { |
| 16 |
// CHECK-LABEL: test_mm512_popcnt_epi64 |
| 17 |
// CHECK: @llvm.ctpop.v8i64 |
| 18 |
return _mm512_popcnt_epi64(__A); |
| 19 |
} |
| 20 |
TEST_CONSTEXPR(match_v8di(_mm512_popcnt_epi64((__m512i)(__v8di){+5, -3, -10, +8, 0, -256, +256, -128}), 2, 63, 62, 1, 0, 56, 1, 57)); |
| 21 |
|
| 22 |
__m512i test_mm512_mask_popcnt_epi64(__m512i __W, __mmask8 __U, __m512i __A) { |
| 23 |
// CHECK-LABEL: test_mm512_mask_popcnt_epi64 |
| 24 |
// CHECK: @llvm.ctpop.v8i64 |
| 25 |
// CHECK: select <8 x i1> %{{[0-9]+}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}} |
| 26 |
return _mm512_mask_popcnt_epi64(__W, __U, __A); |
| 27 |
} |
| 28 |
TEST_CONSTEXPR(match_v8di(_mm512_mask_popcnt_epi64(_mm512_set1_epi64(-1), 0x81, (__m512i)(__v8di){+5, -3, -10, +8, 0, -256, +256, -128}), 2, -1, -1, -1, -1, -1, -1, 57)); |
| 29 |
|
| 30 |
__m512i test_mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) { |
| 31 |
// CHECK-LABEL: test_mm512_maskz_popcnt_epi64 |
| 32 |
// CHECK: @llvm.ctpop.v8i64 |
| 33 |
// CHECK: select <8 x i1> %{{[0-9]+}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}} |
| 34 |
return _mm512_maskz_popcnt_epi64(__U, __A); |
| 35 |
} |
| 36 |
TEST_CONSTEXPR(match_v8di(_mm512_maskz_popcnt_epi64(0x42, (__m512i)(__v8di){+5, -3, -10, +8, 0, -256, +256, -128}), 0, 63, 0, 0, 0, 0, 1, 0)); |
| 37 |
|
| 38 |
__m512i test_mm512_popcnt_epi32(__m512i __A) { |
| 39 |
// CHECK-LABEL: test_mm512_popcnt_epi32 |
| 40 |
// CHECK: @llvm.ctpop.v16i32 |
| 41 |
return _mm512_popcnt_epi32(__A); |
| 42 |
} |
| 43 |
TEST_CONSTEXPR(match_v16si(_mm512_popcnt_epi32((__m512i)(__v16si){+5, -3, -10, +8, 0, -256, +256, -128, +3, +9, +15, +33, +63, +129, +511, +1025}), 2, 31, 30, 1, 0, 24, 1, 25, 2, 2, 4, 2, 6, 2, 9, 2)); |
| 44 |
|
| 45 |
__m512i test_mm512_mask_popcnt_epi32(__m512i __W, __mmask16 __U, __m512i __A) { |
| 46 |
// CHECK-LABEL: test_mm512_mask_popcnt_epi32 |
| 47 |
// CHECK: @llvm.ctpop.v16i32 |
| 48 |
// CHECK: select <16 x i1> %{{[0-9]+}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}} |
| 49 |
return _mm512_mask_popcnt_epi32(__W, __U, __A); |
| 50 |
} |
| 51 |
TEST_CONSTEXPR(match_v16si(_mm512_mask_popcnt_epi32(_mm512_set1_epi32(-1), 0x0F81, (__m512i)(__v16si){+5, -3, -10, +8, 0, -256, +256, -128, +3, +9, +15, +33, +63, +129, +511, +1025}), 2, -1, -1, -1, -1, -1, -1, 25, 2, 2, 4, 2, -1, -1, -1, -1)); |
| 52 |
|
| 53 |
__m512i test_mm512_maskz_popcnt_epi32(__mmask16 __U, __m512i __A) { |
| 54 |
// CHECK-LABEL: test_mm512_maskz_popcnt_epi32 |
| 55 |
// CHECK: @llvm.ctpop.v16i32 |
| 56 |
// CHECK: select <16 x i1> %{{[0-9]+}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}} |
| 57 |
return _mm512_maskz_popcnt_epi32(__U, __A); |
| 58 |
} |
| 59 |
TEST_CONSTEXPR(match_v16si(_mm512_maskz_popcnt_epi32(0xF042, (__m512i)(__v16si){+5, -3, -10, +8, 0, -256, +256, -128, +3, +9, +15, +33, +63, +129, +511, +1025}), 0, 31, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 2, 9, 2)); |