llvm.org GIT mirror llvm / 60b9c46
[NFC] Adjust test for D63004 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362908 91177308-0d34-0410-b5e6-96231b3b80d8 David Bolvansky 4 months ago
1 changed file(s) with 164 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
11 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple | FileCheck %s
22 ; RUN: llc < %s -mtriple=aarch64-eabi -mattr -neon -aarch64-neon-syntax=apple | FileCheck -check-prefix=CHECK-NONEON %s
3 ; RUN: llc < %s -mtriple=armv8a -mattr=+neon | FileCheck %s -check-prefix=CHECK-ARM8A-NEON
34
45 define i32 @cnt32_advsimd(i32 %x) nounwind readnone {
56 ; CHECK-LABEL: cnt32_advsimd:
2627 ; CHECK-NONEON-NEXT: mul w8, w8, w9
2728 ; CHECK-NONEON-NEXT: lsr w0, w8, #24
2829 ; CHECK-NONEON-NEXT: ret
30 ;
31 ; CHECK-ARM8A-NEON-LABEL: cnt32_advsimd:
32 ; CHECK-ARM8A-NEON: @ %bb.0:
33 ; CHECK-ARM8A-NEON-NEXT: movw r1, #21845
34 ; CHECK-ARM8A-NEON-NEXT: movt r1, #21845
35 ; CHECK-ARM8A-NEON-NEXT: and r1, r1, r0, lsr #1
36 ; CHECK-ARM8A-NEON-NEXT: sub r0, r0, r1
37 ; CHECK-ARM8A-NEON-NEXT: movw r1, #13107
38 ; CHECK-ARM8A-NEON-NEXT: movt r1, #13107
39 ; CHECK-ARM8A-NEON-NEXT: and r2, r0, r1
40 ; CHECK-ARM8A-NEON-NEXT: and r0, r1, r0, lsr #2
41 ; CHECK-ARM8A-NEON-NEXT: movw r1, #3855
42 ; CHECK-ARM8A-NEON-NEXT: add r0, r2, r0
43 ; CHECK-ARM8A-NEON-NEXT: movt r1, #3855
44 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r0, lsr #4
45 ; CHECK-ARM8A-NEON-NEXT: and r0, r0, r1
46 ; CHECK-ARM8A-NEON-NEXT: movw r1, #257
47 ; CHECK-ARM8A-NEON-NEXT: movt r1, #257
48 ; CHECK-ARM8A-NEON-NEXT: mul r0, r0, r1
49 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #24
50 ; CHECK-ARM8A-NEON-NEXT: bx lr
2951 %cnt = tail call i32 @llvm.ctpop.i32(i32 %x)
3052 ret i32 %cnt
3153 }
5678 ; CHECK-NONEON-NEXT: mul w8, w8, w9
5779 ; CHECK-NONEON-NEXT: lsr w0, w8, #24
5880 ; CHECK-NONEON-NEXT: ret
81 ;
82 ; CHECK-ARM8A-NEON-LABEL: cnt32_advsimd_2:
83 ; CHECK-ARM8A-NEON: @ %bb.0:
84 ; CHECK-ARM8A-NEON-NEXT: vmov d16, r0, r1
85 ; CHECK-ARM8A-NEON-NEXT: movw r1, #21845
86 ; CHECK-ARM8A-NEON-NEXT: movt r1, #21845
87 ; CHECK-ARM8A-NEON-NEXT: vmov.32 r0, d16[0]
88 ; CHECK-ARM8A-NEON-NEXT: and r1, r1, r0, lsr #1
89 ; CHECK-ARM8A-NEON-NEXT: sub r0, r0, r1
90 ; CHECK-ARM8A-NEON-NEXT: movw r1, #13107
91 ; CHECK-ARM8A-NEON-NEXT: movt r1, #13107
92 ; CHECK-ARM8A-NEON-NEXT: and r2, r0, r1
93 ; CHECK-ARM8A-NEON-NEXT: and r0, r1, r0, lsr #2
94 ; CHECK-ARM8A-NEON-NEXT: movw r1, #3855
95 ; CHECK-ARM8A-NEON-NEXT: add r0, r2, r0
96 ; CHECK-ARM8A-NEON-NEXT: movt r1, #3855
97 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r0, lsr #4
98 ; CHECK-ARM8A-NEON-NEXT: and r0, r0, r1
99 ; CHECK-ARM8A-NEON-NEXT: movw r1, #257
100 ; CHECK-ARM8A-NEON-NEXT: movt r1, #257
101 ; CHECK-ARM8A-NEON-NEXT: mul r0, r0, r1
102 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #24
103 ; CHECK-ARM8A-NEON-NEXT: bx lr
59104 %1 = extractelement <2 x i32> %x, i64 0
60105 %2 = tail call i32 @llvm.ctpop.i32(i32 %1)
61106 ret i32 %2
85130 ; CHECK-NONEON-NEXT: mul x8, x8, x9
86131 ; CHECK-NONEON-NEXT: lsr x0, x8, #56
87132 ; CHECK-NONEON-NEXT: ret
133 ;
134 ; CHECK-ARM8A-NEON-LABEL: cnt64_advsimd:
135 ; CHECK-ARM8A-NEON: @ %bb.0:
136 ; CHECK-ARM8A-NEON-NEXT: push {r11, lr}
137 ; CHECK-ARM8A-NEON-NEXT: movw r12, #21845
138 ; CHECK-ARM8A-NEON-NEXT: movw lr, #3855
139 ; CHECK-ARM8A-NEON-NEXT: movt r12, #21845
140 ; CHECK-ARM8A-NEON-NEXT: and r3, r12, r0, lsr #1
141 ; CHECK-ARM8A-NEON-NEXT: sub r0, r0, r3
142 ; CHECK-ARM8A-NEON-NEXT: movw r3, #13107
143 ; CHECK-ARM8A-NEON-NEXT: movt r3, #13107
144 ; CHECK-ARM8A-NEON-NEXT: and r2, r0, r3
145 ; CHECK-ARM8A-NEON-NEXT: and r0, r3, r0, lsr #2
146 ; CHECK-ARM8A-NEON-NEXT: movt lr, #3855
147 ; CHECK-ARM8A-NEON-NEXT: add r0, r2, r0
148 ; CHECK-ARM8A-NEON-NEXT: and r2, r12, r1, lsr #1
149 ; CHECK-ARM8A-NEON-NEXT: sub r1, r1, r2
150 ; CHECK-ARM8A-NEON-NEXT: and r2, r1, r3
151 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r0, lsr #4
152 ; CHECK-ARM8A-NEON-NEXT: and r1, r3, r1, lsr #2
153 ; CHECK-ARM8A-NEON-NEXT: and r0, r0, lr
154 ; CHECK-ARM8A-NEON-NEXT: add r1, r2, r1
155 ; CHECK-ARM8A-NEON-NEXT: movw r2, #257
156 ; CHECK-ARM8A-NEON-NEXT: movt r2, #257
157 ; CHECK-ARM8A-NEON-NEXT: add r1, r1, r1, lsr #4
158 ; CHECK-ARM8A-NEON-NEXT: mul r0, r0, r2
159 ; CHECK-ARM8A-NEON-NEXT: and r1, r1, lr
160 ; CHECK-ARM8A-NEON-NEXT: mul r1, r1, r2
161 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #24
162 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r1, lsr #24
163 ; CHECK-ARM8A-NEON-NEXT: mov r1, #0
164 ; CHECK-ARM8A-NEON-NEXT: pop {r11, pc}
88165 %cnt = tail call i64 @llvm.ctpop.i64(i64 %x)
89166 ret i64 %cnt
90167 }
124201 ; CHECK-NONEON-NEXT: mul w8, w8, w9
125202 ; CHECK-NONEON-NEXT: lsr w0, w8, #24
126203 ; CHECK-NONEON-NEXT: ret
204 ;
205 ; CHECK-ARM8A-NEON-LABEL: cnt32:
206 ; CHECK-ARM8A-NEON: @ %bb.0:
207 ; CHECK-ARM8A-NEON-NEXT: movw r1, #21845
208 ; CHECK-ARM8A-NEON-NEXT: movt r1, #21845
209 ; CHECK-ARM8A-NEON-NEXT: and r1, r1, r0, lsr #1
210 ; CHECK-ARM8A-NEON-NEXT: sub r0, r0, r1
211 ; CHECK-ARM8A-NEON-NEXT: movw r1, #13107
212 ; CHECK-ARM8A-NEON-NEXT: movt r1, #13107
213 ; CHECK-ARM8A-NEON-NEXT: and r2, r0, r1
214 ; CHECK-ARM8A-NEON-NEXT: and r0, r1, r0, lsr #2
215 ; CHECK-ARM8A-NEON-NEXT: movw r1, #3855
216 ; CHECK-ARM8A-NEON-NEXT: add r0, r2, r0
217 ; CHECK-ARM8A-NEON-NEXT: movt r1, #3855
218 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r0, lsr #4
219 ; CHECK-ARM8A-NEON-NEXT: and r0, r0, r1
220 ; CHECK-ARM8A-NEON-NEXT: movw r1, #257
221 ; CHECK-ARM8A-NEON-NEXT: movt r1, #257
222 ; CHECK-ARM8A-NEON-NEXT: mul r0, r0, r1
223 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #24
224 ; CHECK-ARM8A-NEON-NEXT: bx lr
127225 %cnt = tail call i32 @llvm.ctpop.i32(i32 %x)
128226 ret i32 %cnt
129227 }
160258 ; CHECK-NONEON-NEXT: mul x8, x8, x9
161259 ; CHECK-NONEON-NEXT: lsr x0, x8, #56
162260 ; CHECK-NONEON-NEXT: ret
261 ;
262 ; CHECK-ARM8A-NEON-LABEL: cnt64:
263 ; CHECK-ARM8A-NEON: @ %bb.0:
264 ; CHECK-ARM8A-NEON-NEXT: push {r11, lr}
265 ; CHECK-ARM8A-NEON-NEXT: movw r12, #21845
266 ; CHECK-ARM8A-NEON-NEXT: movw lr, #3855
267 ; CHECK-ARM8A-NEON-NEXT: movt r12, #21845
268 ; CHECK-ARM8A-NEON-NEXT: and r3, r12, r0, lsr #1
269 ; CHECK-ARM8A-NEON-NEXT: sub r0, r0, r3
270 ; CHECK-ARM8A-NEON-NEXT: movw r3, #13107
271 ; CHECK-ARM8A-NEON-NEXT: movt r3, #13107
272 ; CHECK-ARM8A-NEON-NEXT: and r2, r0, r3
273 ; CHECK-ARM8A-NEON-NEXT: and r0, r3, r0, lsr #2
274 ; CHECK-ARM8A-NEON-NEXT: movt lr, #3855
275 ; CHECK-ARM8A-NEON-NEXT: add r0, r2, r0
276 ; CHECK-ARM8A-NEON-NEXT: and r2, r12, r1, lsr #1
277 ; CHECK-ARM8A-NEON-NEXT: sub r1, r1, r2
278 ; CHECK-ARM8A-NEON-NEXT: and r2, r1, r3
279 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r0, lsr #4
280 ; CHECK-ARM8A-NEON-NEXT: and r1, r3, r1, lsr #2
281 ; CHECK-ARM8A-NEON-NEXT: and r0, r0, lr
282 ; CHECK-ARM8A-NEON-NEXT: add r1, r2, r1
283 ; CHECK-ARM8A-NEON-NEXT: movw r2, #257
284 ; CHECK-ARM8A-NEON-NEXT: movt r2, #257
285 ; CHECK-ARM8A-NEON-NEXT: add r1, r1, r1, lsr #4
286 ; CHECK-ARM8A-NEON-NEXT: mul r0, r0, r2
287 ; CHECK-ARM8A-NEON-NEXT: and r1, r1, lr
288 ; CHECK-ARM8A-NEON-NEXT: mul r1, r1, r2
289 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #24
290 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r1, lsr #24
291 ; CHECK-ARM8A-NEON-NEXT: mov r1, #0
292 ; CHECK-ARM8A-NEON-NEXT: pop {r11, pc}
163293 %cnt = tail call i64 @llvm.ctpop.i64(i64 %x)
164294 ret i64 %cnt
165295 }
192322 ; CHECK-NONEON-NEXT: cmp x8, #1 // =1
193323 ; CHECK-NONEON-NEXT: cset w0, eq
194324 ; CHECK-NONEON-NEXT: ret
325 ;
326 ; CHECK-ARM8A-NEON-LABEL: ctpop_eq_one:
327 ; CHECK-ARM8A-NEON: @ %bb.0:
328 ; CHECK-ARM8A-NEON-NEXT: push {r11, lr}
329 ; CHECK-ARM8A-NEON-NEXT: movw r12, #21845
330 ; CHECK-ARM8A-NEON-NEXT: movw lr, #3855
331 ; CHECK-ARM8A-NEON-NEXT: movt r12, #21845
332 ; CHECK-ARM8A-NEON-NEXT: and r3, r12, r0, lsr #1
333 ; CHECK-ARM8A-NEON-NEXT: sub r0, r0, r3
334 ; CHECK-ARM8A-NEON-NEXT: movw r3, #13107
335 ; CHECK-ARM8A-NEON-NEXT: movt r3, #13107
336 ; CHECK-ARM8A-NEON-NEXT: and r2, r0, r3
337 ; CHECK-ARM8A-NEON-NEXT: and r0, r3, r0, lsr #2
338 ; CHECK-ARM8A-NEON-NEXT: movt lr, #3855
339 ; CHECK-ARM8A-NEON-NEXT: add r0, r2, r0
340 ; CHECK-ARM8A-NEON-NEXT: and r2, r12, r1, lsr #1
341 ; CHECK-ARM8A-NEON-NEXT: sub r1, r1, r2
342 ; CHECK-ARM8A-NEON-NEXT: and r2, r1, r3
343 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r0, lsr #4
344 ; CHECK-ARM8A-NEON-NEXT: and r1, r3, r1, lsr #2
345 ; CHECK-ARM8A-NEON-NEXT: and r0, r0, lr
346 ; CHECK-ARM8A-NEON-NEXT: add r1, r2, r1
347 ; CHECK-ARM8A-NEON-NEXT: movw r2, #257
348 ; CHECK-ARM8A-NEON-NEXT: movt r2, #257
349 ; CHECK-ARM8A-NEON-NEXT: add r1, r1, r1, lsr #4
350 ; CHECK-ARM8A-NEON-NEXT: mul r0, r0, r2
351 ; CHECK-ARM8A-NEON-NEXT: and r1, r1, lr
352 ; CHECK-ARM8A-NEON-NEXT: mul r1, r1, r2
353 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #24
354 ; CHECK-ARM8A-NEON-NEXT: add r0, r0, r1, lsr #24
355 ; CHECK-ARM8A-NEON-NEXT: eor r0, r0, #1
356 ; CHECK-ARM8A-NEON-NEXT: clz r0, r0
357 ; CHECK-ARM8A-NEON-NEXT: lsr r0, r0, #5
358 ; CHECK-ARM8A-NEON-NEXT: pop {r11, pc}
195359 %count = tail call i64 @llvm.ctpop.i64(i64 %x)
196360 %cmp = icmp eq i64 %count, 1
197361 %conv = zext i1 %cmp to i32