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 = zxth(r0)
56 ; CHECK-NEXT: r0 = cl0(r0)
59 ; CHECK-NEXT: r0 = add(r0,#-16)
60 ; CHECK-NEXT: jumpr r31
62 %v0 = tail call i16 @llvm.ctlz.i16(i16 %a0, i1 true) #1
66 define i32 @ctlz_i32(i32 %a0) #0 {
67 ; CHECK-LABEL: ctlz_i32:
68 ; CHECK: .cfi_startproc
69 ; CHECK-NEXT: // %bb.0:
71 ; CHECK-NEXT: r0 = cl0(r0)
72 ; CHECK-NEXT: jumpr r31
74 %v0 = tail call i32 @llvm.ctlz.i32(i32 %a0, i1 true) #1
78 define i64 @ctlz_i64(i64 %a0) #0 {
79 ; CHECK-LABEL: ctlz_i64:
80 ; CHECK: .cfi_startproc
81 ; CHECK-NEXT: // %bb.0:
83 ; CHECK-NEXT: r0 = cl0(r1:0)
85 ; CHECK-NEXT: jumpr r31
87 %v0 = tail call i64 @llvm.ctlz.i64(i64 %a0, i1 true) #1
91 define i16 @cttz_i16(i16 %a0) #0 {
92 ; CHECK-LABEL: cttz_i16:
93 ; CHECK: .cfi_startproc
94 ; CHECK-NEXT: // %bb.0:
96 ; CHECK-NEXT: r0 = ct0(r0)
97 ; CHECK-NEXT: jumpr r31
99 %v0 = tail call i16 @llvm.cttz.i16(i16 %a0, i1 true) #1
103 define i32 @cttz_i32(i32 %a0) #0 {
104 ; CHECK-LABEL: cttz_i32:
105 ; CHECK: .cfi_startproc
106 ; CHECK-NEXT: // %bb.0:
108 ; CHECK-NEXT: r0 = ct0(r0)
109 ; CHECK-NEXT: jumpr r31
111 %v0 = tail call i32 @llvm.cttz.i32(i32 %a0, i1 true) #1
115 define i64 @cttz_i64(i64 %a0) #0 {
116 ; CHECK-LABEL: cttz_i64:
117 ; CHECK: .cfi_startproc
118 ; CHECK-NEXT: // %bb.0:
120 ; CHECK-NEXT: r0 = ct0(r1:0)
121 ; CHECK-NEXT: r1 = #0
122 ; CHECK-NEXT: jumpr r31
124 %v0 = tail call i64 @llvm.cttz.i64(i64 %a0, i1 true) #1
128 define i16 @bswap_i16(i16 %a0) #0 {
129 ; CHECK-LABEL: bswap_i16:
130 ; CHECK: .cfi_startproc
131 ; CHECK-NEXT: // %bb.0:
133 ; CHECK-NEXT: r0 = swiz(r0)
136 ; CHECK-NEXT: r0 = lsr(r0,#16)
137 ; CHECK-NEXT: jumpr r31
139 %v0 = tail call i16 @llvm.bswap.i16(i16 %a0) #1
143 define i32 @bswap_i32(i32 %a0) #0 {
144 ; CHECK-LABEL: bswap_i32:
145 ; CHECK: .cfi_startproc
146 ; CHECK-NEXT: // %bb.0:
148 ; CHECK-NEXT: r0 = swiz(r0)
149 ; CHECK-NEXT: jumpr r31
151 %v0 = tail call i32 @llvm.bswap.i32(i32 %a0) #1
155 define i64 @bswap_i64(i64 %a0) #0 {
156 ; CHECK-LABEL: bswap_i64:
157 ; CHECK: .cfi_startproc
158 ; CHECK-NEXT: // %bb.0:
160 ; CHECK-NEXT: r2 = swiz(r1)
161 ; CHECK-NEXT: r3 = swiz(r0)
164 ; CHECK-NEXT: r1:0 = combine(r3,r2)
165 ; CHECK-NEXT: jumpr r31
167 %v0 = tail call i64 @llvm.bswap.i64(i64 %a0) #1
171 define <2 x i16> @bswap_v2i16(<2 x i16> %a0) #0 {
172 ; CHECK-LABEL: bswap_v2i16:
173 ; CHECK: .cfi_startproc
174 ; CHECK-NEXT: // %bb.0:
176 ; CHECK-NEXT: r0 = swiz(r0)
179 ; CHECK-NEXT: r0 = combine(r0.l,r0.h)
180 ; CHECK-NEXT: jumpr r31
182 %v0 = tail call <2 x i16> @llvm.bswap.v2i16(<2 x i16> %a0)
186 define <4 x i16> @bswap_v4i16(<4 x i16> %a0) #0 {
187 ; CHECK-LABEL: bswap_v4i16:
188 ; CHECK: .cfi_startproc
189 ; CHECK-NEXT: // %bb.0:
191 ; CHECK-NEXT: r3:2 = vlsrh(r1:0,#8)
192 ; CHECK-NEXT: r5:4 = vaslh(r1:0,#8)
195 ; CHECK-NEXT: r1:0 = or(r3:2,r5:4)
196 ; CHECK-NEXT: jumpr r31
198 %v0 = tail call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %a0)
202 define <2 x i32> @bswap_v2i32(<2 x i32> %a0) #0 {
203 ; CHECK-LABEL: bswap_v2i32:
204 ; CHECK: .cfi_startproc
205 ; CHECK-NEXT: // %bb.0:
207 ; CHECK-NEXT: r0 = swiz(r0)
208 ; CHECK-NEXT: r1 = swiz(r1)
211 ; CHECK-NEXT: jumpr r31
213 %v0 = tail call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %a0)
217 define i16 @brev_i16(i16 %a0) #0 {
218 ; CHECK-LABEL: brev_i16:
219 ; CHECK: .cfi_startproc
220 ; CHECK-NEXT: // %bb.0:
222 ; CHECK-NEXT: r0 = brev(r0)
225 ; CHECK-NEXT: r0 = lsr(r0,#16)
226 ; CHECK-NEXT: jumpr r31
228 %v0 = tail call i16 @llvm.bitreverse.i16(i16 %a0) #1
232 define i32 @brev_i32(i32 %a0) #0 {
233 ; CHECK-LABEL: brev_i32:
234 ; CHECK: .cfi_startproc
235 ; CHECK-NEXT: // %bb.0:
237 ; CHECK-NEXT: r0 = brev(r0)
238 ; CHECK-NEXT: jumpr r31
240 %v0 = tail call i32 @llvm.bitreverse.i32(i32 %a0) #1
244 define i64 @brev_i64(i64 %a0) #0 {
245 ; CHECK-LABEL: brev_i64:
246 ; CHECK: .cfi_startproc
247 ; CHECK-NEXT: // %bb.0:
249 ; CHECK-NEXT: r1:0 = brev(r1:0)
250 ; CHECK-NEXT: jumpr r31
252 %v0 = tail call i64 @llvm.bitreverse.i64(i64 %a0) #1
256 define <4 x i8> @brev_v4i8(<4 x i8> %a0) #0 {
257 ; CHECK-LABEL: brev_v4i8:
258 ; CHECK: .cfi_startproc
259 ; CHECK-NEXT: // %bb.0:
261 ; CHECK-NEXT: r0 = brev(r0)
264 ; CHECK-NEXT: r0 = swiz(r0)
265 ; CHECK-NEXT: jumpr r31
267 %v0 = tail call <4 x i8> @llvm.bitreverse.v4i8(<4 x i8> %a0)
271 define <8 x i8> @brev_v8i8(<8 x i8> %a0) #0 {
272 ; CHECK-LABEL: brev_v8i8:
273 ; CHECK: .cfi_startproc
274 ; CHECK-NEXT: // %bb.0:
276 ; CHECK-NEXT: r3:2 = brev(r1:0)
279 ; CHECK-NEXT: r0 = swiz(r3)
280 ; CHECK-NEXT: r1 = swiz(r2)
283 ; CHECK-NEXT: jumpr r31
285 %v0 = tail call <8 x i8> @llvm.bitreverse.v8i8(<8 x i8> %a0)
289 define <2 x i16> @brev_v2i16(<2 x i16> %a0) #0 {
290 ; CHECK-LABEL: brev_v2i16:
291 ; CHECK: .cfi_startproc
292 ; CHECK-NEXT: // %bb.0:
294 ; CHECK-NEXT: r0 = brev(r0)
297 ; CHECK-NEXT: r0 = combine(r0.l,r0.h)
298 ; CHECK-NEXT: jumpr r31
300 %v0 = tail call <2 x i16> @llvm.bitreverse.v2i16(<2 x i16> %a0)
304 define <4 x i16> @brev_v4i16(<4 x i16> %a0) #0 {
305 ; CHECK-LABEL: brev_v4i16:
306 ; CHECK: .cfi_startproc
307 ; CHECK-NEXT: // %bb.0:
309 ; CHECK-NEXT: r3:2 = brev(r1:0)
312 ; CHECK-NEXT: r0 = combine(r3.l,r3.h)
313 ; CHECK-NEXT: jumpr r31
314 ; CHECK-NEXT: r1 = combine(r2.l,r2.h)
316 %v0 = tail call <4 x i16> @llvm.bitreverse.v4i16(<4 x i16> %a0)
320 define <2 x i32> @brev_v2i32(<2 x i32> %a0) #0 {
321 ; CHECK-LABEL: brev_v2i32:
322 ; CHECK: .cfi_startproc
323 ; CHECK-NEXT: // %bb.0:
325 ; CHECK-NEXT: r3:2 = brev(r1:0)
328 ; CHECK-NEXT: r1:0 = combine(r2,r3)
329 ; CHECK-NEXT: jumpr r31
331 %v0 = tail call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %a0)
336 declare i16 @llvm.ctpop.i16(i16) #1
337 declare i32 @llvm.ctpop.i32(i32) #1
338 declare i64 @llvm.ctpop.i64(i64) #1
340 declare i16 @llvm.ctlz.i16(i16, i1) #1
341 declare i32 @llvm.ctlz.i32(i32, i1) #1
342 declare i64 @llvm.ctlz.i64(i64, i1) #1
344 declare i16 @llvm.cttz.i16(i16, i1) #1
345 declare i32 @llvm.cttz.i32(i32, i1) #1
346 declare i64 @llvm.cttz.i64(i64, i1) #1
348 declare i16 @llvm.bswap.i16(i16) #1
349 declare i32 @llvm.bswap.i32(i32) #1
350 declare i64 @llvm.bswap.i64(i64) #1
352 declare <2 x i16> @llvm.bswap.v2i16(<2 x i16>) #1
353 declare <4 x i16> @llvm.bswap.v4i16(<4 x i16>) #1
354 declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>) #1
356 declare i16 @llvm.bitreverse.i16(i16) #1
357 declare i32 @llvm.bitreverse.i32(i32) #1
358 declare i64 @llvm.bitreverse.i64(i64) #1
360 declare <4 x i8> @llvm.bitreverse.v4i8(<4 x i8>) #1
361 declare <8 x i8> @llvm.bitreverse.v8i8(<8 x i8>) #1
363 declare <2 x i16> @llvm.bitreverse.v2i16(<2 x i16>) #1
364 declare <4 x i16> @llvm.bitreverse.v4i16(<4 x i16>) #1
365 declare <2 x i32> @llvm.bitreverse.v2i32(<2 x i32>) #1
368 attributes #0 = { "target-features"="+v68,-long-calls" }
369 attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }