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(ptr %A) nounwind {
6 ;CHECK: vcnt.8 {{d[0-9]+}}, {{d[0-9]+}}
7 %tmp1 = load <8 x i8>, ptr %A
8 %tmp2 = call <8 x i8> @llvm.ctpop.v8i8(<8 x i8> %tmp1)
12 define <16 x i8> @vcntQ8(ptr %A) nounwind {
14 ;CHECK: vcnt.8 {{q[0-9]+}}, {{q[0-9]+}}
15 %tmp1 = load <16 x i8>, ptr %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(ptr %A) nounwind {
25 ;CHECK: vclz.i8 {{d[0-9]+}}, {{d[0-9]+}}
26 %tmp1 = load <8 x i8>, ptr %A
27 %tmp2 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> %tmp1, i1 0)
31 define <4 x i16> @vclz16(ptr %A) nounwind {
33 ;CHECK: vclz.i16 {{d[0-9]+}}, {{d[0-9]+}}
34 %tmp1 = load <4 x i16>, ptr %A
35 %tmp2 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> %tmp1, i1 0)
39 define <2 x i32> @vclz32(ptr %A) nounwind {
41 ;CHECK: vclz.i32 {{d[0-9]+}}, {{d[0-9]+}}
42 %tmp1 = load <2 x i32>, ptr %A
43 %tmp2 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %tmp1, i1 0)
47 define <1 x i64> @vclz64(ptr %A) nounwind {
49 %tmp1 = load <1 x i64>, ptr %A
50 %tmp2 = call <1 x i64> @llvm.ctlz.v1i64(<1 x i64> %tmp1, i1 0)
54 define <16 x i8> @vclzQ8(ptr %A) nounwind {
56 ;CHECK: vclz.i8 {{q[0-9]+}}, {{q[0-9]+}}
57 %tmp1 = load <16 x i8>, ptr %A
58 %tmp2 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %tmp1, i1 0)
62 define <8 x i16> @vclzQ16(ptr %A) nounwind {
63 ;CHECK-LABEL: vclzQ16:
64 ;CHECK: vclz.i16 {{q[0-9]+}}, {{q[0-9]+}}
65 %tmp1 = load <8 x i16>, ptr %A
66 %tmp2 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %tmp1, i1 0)
70 define <4 x i32> @vclzQ32(ptr %A) nounwind {
71 ;CHECK-LABEL: vclzQ32:
72 ;CHECK: vclz.i32 {{q[0-9]+}}, {{q[0-9]+}}
73 %tmp1 = load <4 x i32>, ptr %A
74 %tmp2 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %tmp1, i1 0)
78 define <2 x i64> @vclzQ64(ptr %A) nounwind {
79 ;CHECK-LABEL: vclzQ64:
80 %tmp1 = load <2 x i64>, ptr %A
81 %tmp2 = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %tmp1, i1 0)
85 define <8 x i8> @vclz8b(ptr %A) nounwind {
87 ;CHECK: vclz.i8 {{d[0-9]+}}, {{d[0-9]+}}
88 %tmp1 = load <8 x i8>, ptr %A
89 %tmp2 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> %tmp1, i1 1)
93 define <4 x i16> @vclz16b(ptr %A) nounwind {
94 ;CHECK-LABEL: vclz16b:
95 ;CHECK: vclz.i16 {{d[0-9]+}}, {{d[0-9]+}}
96 %tmp1 = load <4 x i16>, ptr %A
97 %tmp2 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> %tmp1, i1 1)
101 define <2 x i32> @vclz32b(ptr %A) nounwind {
102 ;CHECK-LABEL: vclz32b:
103 ;CHECK: vclz.i32 {{d[0-9]+}}, {{d[0-9]+}}
104 %tmp1 = load <2 x i32>, ptr %A
105 %tmp2 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %tmp1, i1 1)
109 define <1 x i64> @vclz64b(ptr %A) nounwind {
110 ;CHECK-LABEL: vclz64b:
111 %tmp1 = load <1 x i64>, ptr %A
112 %tmp2 = call <1 x i64> @llvm.ctlz.v1i64(<1 x i64> %tmp1, i1 1)
116 define <16 x i8> @vclzQ8b(ptr %A) nounwind {
117 ;CHECK-LABEL: vclzQ8b:
118 ;CHECK: vclz.i8 {{q[0-9]+}}, {{q[0-9]+}}
119 %tmp1 = load <16 x i8>, ptr %A
120 %tmp2 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %tmp1, i1 1)
124 define <8 x i16> @vclzQ16b(ptr %A) nounwind {
125 ;CHECK-LABEL: vclzQ16b:
126 ;CHECK: vclz.i16 {{q[0-9]+}}, {{q[0-9]+}}
127 %tmp1 = load <8 x i16>, ptr %A
128 %tmp2 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %tmp1, i1 1)
132 define <4 x i32> @vclzQ32b(ptr %A) nounwind {
133 ;CHECK-LABEL: vclzQ32b:
134 ;CHECK: vclz.i32 {{q[0-9]+}}, {{q[0-9]+}}
135 %tmp1 = load <4 x i32>, ptr %A
136 %tmp2 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %tmp1, i1 1)
140 define <2 x i64> @vclzQ64b(ptr %A) nounwind {
141 ;CHECK-LABEL: vclzQ64b:
142 %tmp1 = load <2 x i64>, ptr %A
143 %tmp2 = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %tmp1, i1 1)
147 declare <8 x i8> @llvm.ctlz.v8i8(<8 x i8>, i1) nounwind readnone
148 declare <4 x i16> @llvm.ctlz.v4i16(<4 x i16>, i1) nounwind readnone
149 declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32>, i1) nounwind readnone
150 declare <1 x i64> @llvm.ctlz.v1i64(<1 x i64>, i1) nounwind readnone
152 declare <16 x i8> @llvm.ctlz.v16i8(<16 x i8>, i1) nounwind readnone
153 declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1) nounwind readnone
154 declare <4 x i32> @llvm.ctlz.v4i32(<4 x i32>, i1) nounwind readnone
155 declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>, i1) nounwind readnone
157 define <8 x i8> @vclss8(ptr %A) nounwind {
158 ;CHECK-LABEL: vclss8:
160 %tmp1 = load <8 x i8>, ptr %A
161 %tmp2 = call <8 x i8> @llvm.arm.neon.vcls.v8i8(<8 x i8> %tmp1)
165 define <4 x i16> @vclss16(ptr %A) nounwind {
166 ;CHECK-LABEL: vclss16:
168 %tmp1 = load <4 x i16>, ptr %A
169 %tmp2 = call <4 x i16> @llvm.arm.neon.vcls.v4i16(<4 x i16> %tmp1)
173 define <2 x i32> @vclss32(ptr %A) nounwind {
174 ;CHECK-LABEL: vclss32:
176 %tmp1 = load <2 x i32>, ptr %A
177 %tmp2 = call <2 x i32> @llvm.arm.neon.vcls.v2i32(<2 x i32> %tmp1)
181 define <16 x i8> @vclsQs8(ptr %A) nounwind {
182 ;CHECK-LABEL: vclsQs8:
184 %tmp1 = load <16 x i8>, ptr %A
185 %tmp2 = call <16 x i8> @llvm.arm.neon.vcls.v16i8(<16 x i8> %tmp1)
189 define <8 x i16> @vclsQs16(ptr %A) nounwind {
190 ;CHECK-LABEL: vclsQs16:
192 %tmp1 = load <8 x i16>, ptr %A
193 %tmp2 = call <8 x i16> @llvm.arm.neon.vcls.v8i16(<8 x i16> %tmp1)
197 define <4 x i32> @vclsQs32(ptr %A) nounwind {
198 ;CHECK-LABEL: vclsQs32:
200 %tmp1 = load <4 x i32>, ptr %A
201 %tmp2 = call <4 x i32> @llvm.arm.neon.vcls.v4i32(<4 x i32> %tmp1)
205 declare <8 x i8> @llvm.arm.neon.vcls.v8i8(<8 x i8>) nounwind readnone
206 declare <4 x i16> @llvm.arm.neon.vcls.v4i16(<4 x i16>) nounwind readnone
207 declare <2 x i32> @llvm.arm.neon.vcls.v2i32(<2 x i32>) nounwind readnone
209 declare <16 x i8> @llvm.arm.neon.vcls.v16i8(<16 x i8>) nounwind readnone
210 declare <8 x i16> @llvm.arm.neon.vcls.v8i16(<8 x i16>) nounwind readnone
211 declare <4 x i32> @llvm.arm.neon.vcls.v4i32(<4 x i32>) nounwind readnone