1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple ppc64le-linux -ppc-asm-full-reg-names -global-isel -o - < %s \
5 ; Function Attrs: nounwind readnone
6 define i64 @cn15bit1() #0 {
7 ; CHECK-LABEL: cn15bit1:
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: li r3, 32767
16 ; Function Attrs: nounwind readnone
17 define i64 @cn15bit2() #0 {
18 ; CHECK-LABEL: cn15bit2:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: li r3, -32767
28 ; Function Attrs: nounwind readnone
29 define i64 @cn1() #0 {
31 ; CHECK: # %bb.0: # %entry
32 ; CHECK-NEXT: li r3, -1
33 ; CHECK-NEXT: rldic r3, r3, 0, 16
36 ret i64 281474976710655
40 ; Function Attrs: nounwind readnone
41 define i64 @cnb() #0 {
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: li r3, -81
45 ; CHECK-NEXT: rldic r3, r3, 0, 16
48 ret i64 281474976710575
52 ; Function Attrs: nounwind readnone
53 define i64 @f2(i64 %x) #0 {
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: li r3, -1
57 ; CHECK-NEXT: rldic r3, r3, 36, 0
64 ; Function Attrs: nounwind readnone
65 define i64 @f2a(i64 %x) #0 {
67 ; CHECK: # %bb.0: # %entry
68 ; CHECK-NEXT: li r3, -337
69 ; CHECK-NEXT: rldic r3, r3, 30, 0
76 ; Function Attrs: nounwind readnone
77 define i64 @f2n(i64 %x) #0 {
79 ; CHECK: # %bb.0: # %entry
80 ; CHECK-NEXT: li r3, -1
81 ; CHECK-NEXT: rldic r3, r3, 0, 28
88 ; Function Attrs: nounwind readnone
89 define i64 @f3(i64 %x) #0 {
91 ; CHECK: # %bb.0: # %entry
92 ; CHECK-NEXT: li r3, -1
93 ; CHECK-NEXT: rldic r3, r3, 0, 31
100 ; Function Attrs: nounwind readnone
101 define i64 @cn2n() #0 {
103 ; CHECK: # %bb.0: # %entry
104 ; CHECK-NEXT: lis r3, -5121
105 ; CHECK-NEXT: ori r3, r3, 65534
106 ; CHECK-NEXT: rotldi r3, r3, 22
109 ret i64 -1407374887747585
113 define i64 @uint32_1() #0 {
114 ; CHECK-LABEL: uint32_1:
115 ; CHECK: # %bb.0: # %entry
116 ; CHECK-NEXT: li r3, 18176
117 ; CHECK-NEXT: oris r3, r3, 59509
124 define i32 @uint32_1_i32() #0 {
125 ; CHECK-LABEL: uint32_1_i32:
126 ; CHECK: # %bb.0: # %entry
127 ; CHECK-NEXT: lis r3, -6027
128 ; CHECK-NEXT: ori r3, r3, 18176
135 define i64 @uint32_2() #0 {
136 ; CHECK-LABEL: uint32_2:
137 ; CHECK: # %bb.0: # %entry
138 ; CHECK-NEXT: li r3, -1
139 ; CHECK-NEXT: rldic r3, r3, 0, 32
146 define i32 @uint32_2_i32() #0 {
147 ; CHECK-LABEL: uint32_2_i32:
148 ; CHECK: # %bb.0: # %entry
149 ; CHECK-NEXT: li r3, -1
156 define i64 @uint32_3() #0 {
157 ; CHECK-LABEL: uint32_3:
158 ; CHECK: # %bb.0: # %entry
159 ; CHECK-NEXT: li r3, 1
160 ; CHECK-NEXT: rldic r3, r3, 31, 32
167 define i64 @uint32_4() #0 {
168 ; CHECK-LABEL: uint32_4:
169 ; CHECK: # %bb.0: # %entry
170 ; CHECK-NEXT: lis r3, -6027
171 ; CHECK-NEXT: ori r3, r3, 18177
172 ; CHECK-NEXT: rldic r3, r3, 5, 27
179 define i64 @cn_ones_1() #0 {
180 ; CHECK-LABEL: cn_ones_1:
181 ; CHECK: # %bb.0: # %entry
182 ; CHECK-NEXT: li r3, -25633
183 ; CHECK-NEXT: rldicl r3, r3, 18, 30
190 define i64 @cn_ones_2() #0 {
191 ; CHECK-LABEL: cn_ones_2:
192 ; CHECK: # %bb.0: # %entry
193 ; CHECK-NEXT: lis r3, -25638
194 ; CHECK-NEXT: ori r3, r3, 24575
195 ; CHECK-NEXT: rldicl r3, r3, 2, 30
202 define i64 @imm1() #0 {
204 ; CHECK: # %bb.0: # %entry
205 ; CHECK-NEXT: li r3, 8465
206 ; CHECK-NEXT: rldic r3, r3, 28, 22
209 ret i64 2272306135040 ;0x21110000000
212 define i64 @imm2() #0 {
214 ; CHECK: # %bb.0: # %entry
215 ; CHECK-NEXT: li r3, -28536
216 ; CHECK-NEXT: rldicl r3, r3, 1, 32
219 ret i64 4294910225 ;0xFFFF2111
222 define i64 @imm3() #0 {
224 ; CHECK: # %bb.0: # %entry
225 ; CHECK-NEXT: li r3, -32495
226 ; CHECK-NEXT: rldic r3, r3, 0, 32
229 ret i64 4294934801 ;0xFFFF8111
232 define i64 @imm4() #0 {
234 ; CHECK: # %bb.0: # %entry
235 ; CHECK-NEXT: lis r3, 33
236 ; CHECK-NEXT: ori r3, r3, 4352
237 ; CHECK-NEXT: rldimi r3, r3, 32, 0
240 ret i64 9307365931290880 ;0x21110000211100
243 define i64 @imm5() #0 {
245 ; CHECK: # %bb.0: # %entry
246 ; CHECK-NEXT: li r3, 28685
247 ; CHECK-NEXT: rotldi r3, r3, 52
250 ret i64 58546795155816455 ;0xd0000000000007
253 define i64 @imm6() #0 {
255 ; CHECK: # %bb.0: # %entry
256 ; CHECK-NEXT: lis r3, -1
257 ; CHECK-NEXT: ori r3, r3, 28674
258 ; CHECK-NEXT: rotldi r3, r3, 52
261 ret i64 13510798882111479 ;0x2ffffffffffff7
264 define i64 @imm7() #0 {
266 ; CHECK: # %bb.0: # %entry
267 ; CHECK-NEXT: li r3, -3823
268 ; CHECK-NEXT: rldic r3, r3, 28, 20
271 ret i64 16565957296128 ;0xf1110000000
274 define i64 @imm8() #0 {
276 ; CHECK: # %bb.0: # %entry
277 ; CHECK-NEXT: li r3, -7919
278 ; CHECK-NEXT: rldic r3, r3, 22, 22
281 ret i64 4364831817728 ;0x3f844400000
284 define i64 @imm9() #0 {
286 ; CHECK: # %bb.0: # %entry
287 ; CHECK-NEXT: lis r3, -1
288 ; CHECK-NEXT: ori r3, r3, 28674
289 ; CHECK-NEXT: rotldi r3, r3, 52
292 ret i64 13510798882111479 ;0x2ffffffffffff7
295 define i64 @imm10() #0 {
296 ; CHECK-LABEL: imm10:
297 ; CHECK: # %bb.0: # %entry
298 ; CHECK-NEXT: li r3, -3823
299 ; CHECK-NEXT: rldic r3, r3, 28, 20
302 ret i64 16565957296128 ;0xf1110000000
305 define i64 @imm11() #0 {
306 ; CHECK-LABEL: imm11:
307 ; CHECK: # %bb.0: # %entry
308 ; CHECK-NEXT: li r3, -7919
309 ; CHECK-NEXT: rldic r3, r3, 22, 22
312 ret i64 4364831817728 ;0x3f844400000
315 define i64 @imm12() #0 {
316 ; CHECK-LABEL: imm12:
317 ; CHECK: # %bb.0: # %entry
318 ; CHECK-NEXT: lis r3, -29
319 ; CHECK-NEXT: ori r3, r3, 64577
320 ; CHECK-NEXT: rldic r3, r3, 12, 20
323 ret i64 17584665923584 ;0xffe3fc41000
326 define i64 @imm13() #0 {
327 ; CHECK-LABEL: imm13:
328 ; CHECK: # %bb.0: # %entry
329 ; CHECK-NEXT: li r3, -24847
330 ; CHECK-NEXT: rldicl r3, r3, 21, 27
333 ret i64 85333114879 ;0x13de3fffff
336 define i64 @imm13_2() #0 {
337 ; CHECK-LABEL: imm13_2:
338 ; CHECK: # %bb.0: # %entry
339 ; CHECK-NEXT: li r3, -12424
340 ; CHECK-NEXT: rldicl r3, r3, 22, 26
343 ret i64 222772068351 ;0x33de3fffff
346 define i64 @imm14() #0 {
347 ; CHECK-LABEL: imm14:
348 ; CHECK: # %bb.0: # %entry
349 ; CHECK-NEXT: li r3, -3960
350 ; CHECK-NEXT: rldicl r3, r3, 21, 24
353 ret i64 1091209003007 ;0xfe111fffff
356 define i64 @imm15() #0 {
357 ; CHECK-LABEL: imm15:
358 ; CHECK: # %bb.0: # %entry
359 ; CHECK-NEXT: li r3, -8065
360 ; CHECK-NEXT: rldic r3, r3, 24, 0
363 ret i64 -135308247040
366 define i64 @imm16() #0 {
367 ; CHECK-LABEL: imm16:
368 ; CHECK: # %bb.0: # %entry
369 ; CHECK-NEXT: lis r3, -16392
370 ; CHECK-NEXT: ori r3, r3, 57217
371 ; CHECK-NEXT: rldic r3, r3, 16, 0
374 ret i64 -70399354142720
377 define i64 @imm17() #0 {
378 ; CHECK-LABEL: imm17:
379 ; CHECK: # %bb.0: # %entry
380 ; CHECK-NEXT: lis r3, 20344
381 ; CHECK-NEXT: ori r3, r3, 32847
382 ; CHECK-NEXT: rotldi r3, r3, 49
385 ret i64 44473046320324337 ;0x9e000000009ef1
388 define i64 @imm18() #0 {
389 ; CHECK-LABEL: imm18:
390 ; CHECK: # %bb.0: # %entry
391 ; CHECK-NEXT: li r3, 1
392 ; CHECK-NEXT: rldic r3, r3, 33, 30
393 ; CHECK-NEXT: oris r3, r3, 39436
394 ; CHECK-NEXT: ori r3, r3, 61633
400 attributes #0 = { nounwind readnone }