1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 define i16 @popcount_i16(i16 %a0) #0 {
5 ; CHECK-LABEL: popcount_i16:
6 ; CHECK: .cfi_startproc
7 ; CHECK-NEXT: // %bb.0:
10 ; CHECK-NEXT: r0 = zxth(r0)
13 ; CHECK-NEXT: r0 = popcount(r1:0)
14 ; CHECK-NEXT: jumpr r31
16 %v0 = tail call i16 @llvm.ctpop.i16(i16 %a0) #1
20 define i32 @popcount_i32(i32 %a0) #0 {
21 ; CHECK-LABEL: popcount_i32:
22 ; CHECK: .cfi_startproc
23 ; CHECK-NEXT: // %bb.0:
28 ; CHECK-NEXT: r0 = popcount(r1:0)
29 ; CHECK-NEXT: jumpr r31
31 %v0 = tail call i32 @llvm.ctpop.i32(i32 %a0) #1
35 define i64 @popcount_i64(i64 %a0) #0 {
36 ; CHECK-LABEL: popcount_i64:
37 ; CHECK: .cfi_startproc
38 ; CHECK-NEXT: // %bb.0:
40 ; CHECK-NEXT: r0 = popcount(r1:0)
42 ; CHECK-NEXT: jumpr r31
44 %v0 = tail call i64 @llvm.ctpop.i64(i64 %a0) #1
48 define i16 @ctlz_i16(i16 %a0) #0 {
49 ; CHECK-LABEL: ctlz_i16:
50 ; CHECK: .cfi_startproc
51 ; CHECK-NEXT: // %bb.0:
53 ; CHECK-NEXT: r0 = aslh(r0)
56 ; CHECK-NEXT: r0 = cl0(r0)
57 ; CHECK-NEXT: jumpr r31
59 %v0 = tail call i16 @llvm.ctlz.i16(i16 %a0, i1 true) #1
63 define i32 @ctlz_i32(i32 %a0) #0 {
64 ; CHECK-LABEL: ctlz_i32:
65 ; CHECK: .cfi_startproc
66 ; CHECK-NEXT: // %bb.0:
68 ; CHECK-NEXT: r0 = cl0(r0)
69 ; CHECK-NEXT: jumpr r31
71 %v0 = tail call i32 @llvm.ctlz.i32(i32 %a0, i1 true) #1
75 define i64 @ctlz_i64(i64 %a0) #0 {
76 ; CHECK-LABEL: ctlz_i64:
77 ; CHECK: .cfi_startproc
78 ; CHECK-NEXT: // %bb.0:
80 ; CHECK-NEXT: r0 = cl0(r1:0)
82 ; CHECK-NEXT: jumpr r31
84 %v0 = tail call i64 @llvm.ctlz.i64(i64 %a0, i1 true) #1
88 define i16 @cttz_i16(i16 %a0) #0 {
89 ; CHECK-LABEL: cttz_i16:
90 ; CHECK: .cfi_startproc
91 ; CHECK-NEXT: // %bb.0:
93 ; CHECK-NEXT: r0 = ct0(r0)
94 ; CHECK-NEXT: jumpr r31
96 %v0 = tail call i16 @llvm.cttz.i16(i16 %a0, i1 true) #1
100 define i32 @cttz_i32(i32 %a0) #0 {
101 ; CHECK-LABEL: cttz_i32:
102 ; CHECK: .cfi_startproc
103 ; CHECK-NEXT: // %bb.0:
105 ; CHECK-NEXT: r0 = ct0(r0)
106 ; CHECK-NEXT: jumpr r31
108 %v0 = tail call i32 @llvm.cttz.i32(i32 %a0, i1 true) #1
112 define i64 @cttz_i64(i64 %a0) #0 {
113 ; CHECK-LABEL: cttz_i64:
114 ; CHECK: .cfi_startproc
115 ; CHECK-NEXT: // %bb.0:
117 ; CHECK-NEXT: r0 = ct0(r1:0)
118 ; CHECK-NEXT: r1 = #0
119 ; CHECK-NEXT: jumpr r31
121 %v0 = tail call i64 @llvm.cttz.i64(i64 %a0, i1 true) #1
125 define i16 @bswap_i16(i16 %a0) #0 {
126 ; CHECK-LABEL: bswap_i16:
127 ; CHECK: .cfi_startproc
128 ; CHECK-NEXT: // %bb.0:
130 ; CHECK-NEXT: r0 = swiz(r0)
133 ; CHECK-NEXT: r0 = lsr(r0,#16)
134 ; CHECK-NEXT: jumpr r31
136 %v0 = tail call i16 @llvm.bswap.i16(i16 %a0) #1
140 define i32 @bswap_i32(i32 %a0) #0 {
141 ; CHECK-LABEL: bswap_i32:
142 ; CHECK: .cfi_startproc
143 ; CHECK-NEXT: // %bb.0:
145 ; CHECK-NEXT: r0 = swiz(r0)
146 ; CHECK-NEXT: jumpr r31
148 %v0 = tail call i32 @llvm.bswap.i32(i32 %a0) #1
152 define i64 @bswap_i64(i64 %a0) #0 {
153 ; CHECK-LABEL: bswap_i64:
154 ; CHECK: .cfi_startproc
155 ; CHECK-NEXT: // %bb.0:
157 ; CHECK-NEXT: r2 = swiz(r1)
158 ; CHECK-NEXT: r3 = swiz(r0)
161 ; CHECK-NEXT: r1:0 = combine(r3,r2)
162 ; CHECK-NEXT: jumpr r31
164 %v0 = tail call i64 @llvm.bswap.i64(i64 %a0) #1
168 define <2 x i16> @bswap_v2i16(<2 x i16> %a0) #0 {
169 ; CHECK-LABEL: bswap_v2i16:
170 ; CHECK: .cfi_startproc
171 ; CHECK-NEXT: // %bb.0:
173 ; CHECK-NEXT: r0 = swiz(r0)
176 ; CHECK-NEXT: r0 = combine(r0.l,r0.h)
177 ; CHECK-NEXT: jumpr r31
179 %v0 = tail call <2 x i16> @llvm.bswap.v2i16(<2 x i16> %a0)
183 define <4 x i16> @bswap_v4i16(<4 x i16> %a0) #0 {
184 ; CHECK-LABEL: bswap_v4i16:
185 ; CHECK: .cfi_startproc
186 ; CHECK-NEXT: // %bb.0:
188 ; CHECK-NEXT: r3:2 = vlsrh(r1:0,#8)
189 ; CHECK-NEXT: r5:4 = vaslh(r1:0,#8)
192 ; CHECK-NEXT: r1:0 = or(r3:2,r5:4)
193 ; CHECK-NEXT: jumpr r31
195 %v0 = tail call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %a0)
199 define <2 x i32> @bswap_v2i32(<2 x i32> %a0) #0 {
200 ; CHECK-LABEL: bswap_v2i32:
201 ; CHECK: .cfi_startproc
202 ; CHECK-NEXT: // %bb.0:
204 ; CHECK-NEXT: r0 = swiz(r0)
205 ; CHECK-NEXT: r1 = swiz(r1)
208 ; CHECK-NEXT: jumpr r31
210 %v0 = tail call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %a0)
214 define i16 @brev_i16(i16 %a0) #0 {
215 ; CHECK-LABEL: brev_i16:
216 ; CHECK: .cfi_startproc
217 ; CHECK-NEXT: // %bb.0:
219 ; CHECK-NEXT: r0 = brev(r0)
222 ; CHECK-NEXT: r0 = lsr(r0,#16)
223 ; CHECK-NEXT: jumpr r31
225 %v0 = tail call i16 @llvm.bitreverse.i16(i16 %a0) #1
229 define i32 @brev_i32(i32 %a0) #0 {
230 ; CHECK-LABEL: brev_i32:
231 ; CHECK: .cfi_startproc
232 ; CHECK-NEXT: // %bb.0:
234 ; CHECK-NEXT: r0 = brev(r0)
235 ; CHECK-NEXT: jumpr r31
237 %v0 = tail call i32 @llvm.bitreverse.i32(i32 %a0) #1
241 define i64 @brev_i64(i64 %a0) #0 {
242 ; CHECK-LABEL: brev_i64:
243 ; CHECK: .cfi_startproc
244 ; CHECK-NEXT: // %bb.0:
246 ; CHECK-NEXT: r1:0 = brev(r1:0)
247 ; CHECK-NEXT: jumpr r31
249 %v0 = tail call i64 @llvm.bitreverse.i64(i64 %a0) #1
253 define <4 x i8> @brev_v4i8(<4 x i8> %a0) #0 {
254 ; CHECK-LABEL: brev_v4i8:
255 ; CHECK: .cfi_startproc
256 ; CHECK-NEXT: // %bb.0:
258 ; CHECK-NEXT: r0 = brev(r0)
261 ; CHECK-NEXT: r0 = swiz(r0)
262 ; CHECK-NEXT: jumpr r31
264 %v0 = tail call <4 x i8> @llvm.bitreverse.v4i8(<4 x i8> %a0)
268 define <8 x i8> @brev_v8i8(<8 x i8> %a0) #0 {
269 ; CHECK-LABEL: brev_v8i8:
270 ; CHECK: .cfi_startproc
271 ; CHECK-NEXT: // %bb.0:
273 ; CHECK-NEXT: r3:2 = brev(r1:0)
276 ; CHECK-NEXT: r0 = swiz(r3)
277 ; CHECK-NEXT: r1 = swiz(r2)
280 ; CHECK-NEXT: jumpr r31
282 %v0 = tail call <8 x i8> @llvm.bitreverse.v8i8(<8 x i8> %a0)
286 define <2 x i16> @brev_v2i16(<2 x i16> %a0) #0 {
287 ; CHECK-LABEL: brev_v2i16:
288 ; CHECK: .cfi_startproc
289 ; CHECK-NEXT: // %bb.0:
291 ; CHECK-NEXT: r0 = brev(r0)
294 ; CHECK-NEXT: r0 = combine(r0.l,r0.h)
295 ; CHECK-NEXT: jumpr r31
297 %v0 = tail call <2 x i16> @llvm.bitreverse.v2i16(<2 x i16> %a0)
301 define <4 x i16> @brev_v4i16(<4 x i16> %a0) #0 {
302 ; CHECK-LABEL: brev_v4i16:
303 ; CHECK: .cfi_startproc
304 ; CHECK-NEXT: // %bb.0:
306 ; CHECK-NEXT: r3:2 = brev(r1:0)
309 ; CHECK-NEXT: r0 = combine(r3.l,r3.h)
310 ; CHECK-NEXT: jumpr r31
311 ; CHECK-NEXT: r1 = combine(r2.l,r2.h)
313 %v0 = tail call <4 x i16> @llvm.bitreverse.v4i16(<4 x i16> %a0)
317 define <2 x i32> @brev_v2i32(<2 x i32> %a0) #0 {
318 ; CHECK-LABEL: brev_v2i32:
319 ; CHECK: .cfi_startproc
320 ; CHECK-NEXT: // %bb.0:
322 ; CHECK-NEXT: r3:2 = brev(r1:0)
325 ; CHECK-NEXT: r1:0 = combine(r2,r3)
326 ; CHECK-NEXT: jumpr r31
328 %v0 = tail call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %a0)
333 declare i16 @llvm.ctpop.i16(i16) #1
334 declare i32 @llvm.ctpop.i32(i32) #1
335 declare i64 @llvm.ctpop.i64(i64) #1
337 declare i16 @llvm.ctlz.i16(i16, i1) #1
338 declare i32 @llvm.ctlz.i32(i32, i1) #1
339 declare i64 @llvm.ctlz.i64(i64, i1) #1
341 declare i16 @llvm.cttz.i16(i16, i1) #1
342 declare i32 @llvm.cttz.i32(i32, i1) #1
343 declare i64 @llvm.cttz.i64(i64, i1) #1
345 declare i16 @llvm.bswap.i16(i16) #1
346 declare i32 @llvm.bswap.i32(i32) #1
347 declare i64 @llvm.bswap.i64(i64) #1
349 declare <2 x i16> @llvm.bswap.v2i16(<2 x i16>) #1
350 declare <4 x i16> @llvm.bswap.v4i16(<4 x i16>) #1
351 declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>) #1
353 declare i16 @llvm.bitreverse.i16(i16) #1
354 declare i32 @llvm.bitreverse.i32(i32) #1
355 declare i64 @llvm.bitreverse.i64(i64) #1
357 declare <4 x i8> @llvm.bitreverse.v4i8(<4 x i8>) #1
358 declare <8 x i8> @llvm.bitreverse.v8i8(<8 x i8>) #1
360 declare <2 x i16> @llvm.bitreverse.v2i16(<2 x i16>) #1
361 declare <4 x i16> @llvm.bitreverse.v4i16(<4 x i16>) #1
362 declare <2 x i32> @llvm.bitreverse.v2i32(<2 x i32>) #1
365 attributes #0 = { "target-features"="+v68,-long-calls" }
366 attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }