1 ; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s
2 ; NB: this tests vcnt, vclz, and vcls
4 define <8 x i8> @vcnt8(<8 x i8>* %A) nounwind {
6 ;CHECK: vcnt.8 {{d[0-9]+}}, {{d[0-9]+}}
7 %tmp1 = load <8 x i8>, <8 x i8>* %A
8 %tmp2 = call <8 x i8> @llvm.ctpop.v8i8(<8 x i8> %tmp1)
12 define <16 x i8> @vcntQ8(<16 x i8>* %A) nounwind {
14 ;CHECK: vcnt.8 {{q[0-9]+}}, {{q[0-9]+}}
15 %tmp1 = load <16 x i8>, <16 x i8>* %A
16 %tmp2 = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %tmp1)
20 declare <8 x i8> @llvm.ctpop.v8i8(<8 x i8>) nounwind readnone
21 declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>) nounwind readnone
23 define <8 x i8> @vclz8(<8 x i8>* %A) nounwind {
25 ;CHECK: vclz.i8 {{d[0-9]+}}, {{d[0-9]+}}
26 %tmp1 = load <8 x i8>, <8 x i8>* %A
27 %tmp2 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> %tmp1, i1 0)
31 define <4 x i16> @vclz16(<4 x i16>* %A) nounwind {
33 ;CHECK: vclz.i16 {{d[0-9]+}}, {{d[0-9]+}}
34 %tmp1 = load <4 x i16>, <4 x i16>* %A
35 %tmp2 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> %tmp1, i1 0)
39 define <2 x i32> @vclz32(<2 x i32>* %A) nounwind {
41 ;CHECK: vclz.i32 {{d[0-9]+}}, {{d[0-9]+}}
42 %tmp1 = load <2 x i32>, <2 x i32>* %A
43 %tmp2 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %tmp1, i1 0)
47 define <16 x i8> @vclzQ8(<16 x i8>* %A) nounwind {
49 ;CHECK: vclz.i8 {{q[0-9]+}}, {{q[0-9]+}}
50 %tmp1 = load <16 x i8>, <16 x i8>* %A
51 %tmp2 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %tmp1, i1 0)
55 define <8 x i16> @vclzQ16(<8 x i16>* %A) nounwind {
56 ;CHECK-LABEL: vclzQ16:
57 ;CHECK: vclz.i16 {{q[0-9]+}}, {{q[0-9]+}}
58 %tmp1 = load <8 x i16>, <8 x i16>* %A
59 %tmp2 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %tmp1, i1 0)
63 define <4 x i32> @vclzQ32(<4 x i32>* %A) nounwind {
64 ;CHECK-LABEL: vclzQ32:
65 ;CHECK: vclz.i32 {{q[0-9]+}}, {{q[0-9]+}}
66 %tmp1 = load <4 x i32>, <4 x i32>* %A
67 %tmp2 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %tmp1, i1 0)
71 declare <8 x i8> @llvm.ctlz.v8i8(<8 x i8>, i1) nounwind readnone
72 declare <4 x i16> @llvm.ctlz.v4i16(<4 x i16>, i1) nounwind readnone
73 declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32>, i1) nounwind readnone
75 declare <16 x i8> @llvm.ctlz.v16i8(<16 x i8>, i1) nounwind readnone
76 declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1) nounwind readnone
77 declare <4 x i32> @llvm.ctlz.v4i32(<4 x i32>, i1) nounwind readnone
79 define <8 x i8> @vclss8(<8 x i8>* %A) nounwind {
82 %tmp1 = load <8 x i8>, <8 x i8>* %A
83 %tmp2 = call <8 x i8> @llvm.arm.neon.vcls.v8i8(<8 x i8> %tmp1)
87 define <4 x i16> @vclss16(<4 x i16>* %A) nounwind {
88 ;CHECK-LABEL: vclss16:
90 %tmp1 = load <4 x i16>, <4 x i16>* %A
91 %tmp2 = call <4 x i16> @llvm.arm.neon.vcls.v4i16(<4 x i16> %tmp1)
95 define <2 x i32> @vclss32(<2 x i32>* %A) nounwind {
96 ;CHECK-LABEL: vclss32:
98 %tmp1 = load <2 x i32>, <2 x i32>* %A
99 %tmp2 = call <2 x i32> @llvm.arm.neon.vcls.v2i32(<2 x i32> %tmp1)
103 define <16 x i8> @vclsQs8(<16 x i8>* %A) nounwind {
104 ;CHECK-LABEL: vclsQs8:
106 %tmp1 = load <16 x i8>, <16 x i8>* %A
107 %tmp2 = call <16 x i8> @llvm.arm.neon.vcls.v16i8(<16 x i8> %tmp1)
111 define <8 x i16> @vclsQs16(<8 x i16>* %A) nounwind {
112 ;CHECK-LABEL: vclsQs16:
114 %tmp1 = load <8 x i16>, <8 x i16>* %A
115 %tmp2 = call <8 x i16> @llvm.arm.neon.vcls.v8i16(<8 x i16> %tmp1)
119 define <4 x i32> @vclsQs32(<4 x i32>* %A) nounwind {
120 ;CHECK-LABEL: vclsQs32:
122 %tmp1 = load <4 x i32>, <4 x i32>* %A
123 %tmp2 = call <4 x i32> @llvm.arm.neon.vcls.v4i32(<4 x i32> %tmp1)
127 declare <8 x i8> @llvm.arm.neon.vcls.v8i8(<8 x i8>) nounwind readnone
128 declare <4 x i16> @llvm.arm.neon.vcls.v4i16(<4 x i16>) nounwind readnone
129 declare <2 x i32> @llvm.arm.neon.vcls.v2i32(<2 x i32>) nounwind readnone
131 declare <16 x i8> @llvm.arm.neon.vcls.v16i8(<16 x i8>) nounwind readnone
132 declare <8 x i16> @llvm.arm.neon.vcls.v8i16(<8 x i16>) nounwind readnone
133 declare <4 x i32> @llvm.arm.neon.vcls.v4i32(<4 x i32>) nounwind readnone