AVX512: Implemented encoding and intrinsics for vplzcntq, vplzcntd, vpconflictq,...
[oota-llvm.git] / test / CodeGen / X86 / vector-lzcnt-512.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512cd | FileCheck %s --check-prefix=AVX512CD
2
3 define <16 x i32> @test_ctlz_d(<16 x i32> %a) {
4 ; AVX512CD-LABEL: test_ctlz_d:
5 ; AVX512CD:       ## BB#0:
6 ; AVX512CD-NEXT:    vplzcntd %zmm0, %zmm0
7 ; AVX512CD-NEXT:    retq
8   %res = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
9   ret <16 x i32> %res
10 }
11
12 define <8 x i64> @test_ctlz_q(<8 x i64> %a) {
13 ; AVX512CD-LABEL: test_ctlz_q:
14 ; AVX512CD:       ## BB#0:
15 ; AVX512CD-NEXT:    vplzcntq %zmm0, %zmm0
16 ; AVX512CD-NEXT:    retq
17   %res = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
18   ret <8 x i64> %res
19 }
20
21 define <16 x i32> @test_ctlz_d_undef(<16 x i32> %a) {
22 ; AVX512CD-LABEL: test_ctlz_d_undef:
23 ; AVX512CD:       ## BB#0:
24 ; AVX512CD-NEXT:    vplzcntd %zmm0, %zmm0
25 ; AVX512CD-NEXT:    retq
26   %res = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 -1)
27   ret <16 x i32> %res
28 }
29
30 define <8 x i64> @test_ctlz_q_undef(<8 x i64> %a) {
31 ; AVX512CD-LABEL: test_ctlz_q_undef:
32 ; AVX512CD:       ## BB#0:
33 ; AVX512CD-NEXT:    vplzcntq %zmm0, %zmm0
34 ; AVX512CD-NEXT:    retq
35   %res = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 -1)
36   ret <8 x i64> %res
37 }
38
39 declare <16 x i32> @llvm.ctlz.v16i32(<16 x i32>, i1) nounwind readonly
40 declare <8 x i64> @llvm.ctlz.v8i64(<8 x i64>, i1) nounwind readonly