1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux-gnu -mcpu=ppc64 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -vec-extabi -mcpu=ppc64 < %s | FileCheck %s
5 ; Function Attrs: nounwind readnone
8 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: rldic 3, 3, 0, 16
13 ret i64 281474976710655
17 ; Function Attrs: nounwind readnone
18 define i64 @cnb() #0 {
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: li 3, -81
22 ; CHECK-NEXT: rldic 3, 3, 0, 16
25 ret i64 281474976710575
29 ; Function Attrs: nounwind readnone
30 define i64 @f2(i64 %x) #0 {
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: li 3, -1
34 ; CHECK-NEXT: rldic 3, 3, 36, 0
41 ; Function Attrs: nounwind readnone
42 define i64 @f2a(i64 %x) #0 {
44 ; CHECK: # %bb.0: # %entry
45 ; CHECK-NEXT: li 3, -337
46 ; CHECK-NEXT: rldic 3, 3, 30, 0
53 ; Function Attrs: nounwind readnone
54 define i64 @f2n(i64 %x) #0 {
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: li 3, -1
58 ; CHECK-NEXT: rldic 3, 3, 0, 28
65 ; Function Attrs: nounwind readnone
66 define i64 @f3(i64 %x) #0 {
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: li 3, -1
70 ; CHECK-NEXT: rldic 3, 3, 0, 31
77 ; Function Attrs: nounwind readnone
78 define i64 @cn2n() #0 {
80 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: lis 3, -5121
82 ; CHECK-NEXT: ori 3, 3, 65534
83 ; CHECK-NEXT: rotldi 3, 3, 22
86 ret i64 -1407374887747585
90 define i64 @uint32_1() #0 {
91 ; CHECK-LABEL: uint32_1:
92 ; CHECK: # %bb.0: # %entry
93 ; CHECK-NEXT: li 3, 18176
94 ; CHECK-NEXT: oris 3, 3, 59509
101 define i32 @uint32_1_i32() #0 {
102 ; CHECK-LABEL: uint32_1_i32:
103 ; CHECK: # %bb.0: # %entry
104 ; CHECK-NEXT: li 3, 18176
105 ; CHECK-NEXT: oris 3, 3, 59509
112 define i64 @uint32_2() #0 {
113 ; CHECK-LABEL: uint32_2:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: li 3, -1
116 ; CHECK-NEXT: rldic 3, 3, 0, 32
123 define i32 @uint32_2_i32() #0 {
124 ; CHECK-LABEL: uint32_2_i32:
125 ; CHECK: # %bb.0: # %entry
126 ; CHECK-NEXT: li 3, -1
127 ; CHECK-NEXT: rldic 3, 3, 0, 32
134 define i64 @uint32_3() #0 {
135 ; CHECK-LABEL: uint32_3:
136 ; CHECK: # %bb.0: # %entry
137 ; CHECK-NEXT: li 3, 1
138 ; CHECK-NEXT: rldic 3, 3, 31, 32
145 define i64 @uint32_4() #0 {
146 ; CHECK-LABEL: uint32_4:
147 ; CHECK: # %bb.0: # %entry
148 ; CHECK-NEXT: lis 3, -6027
149 ; CHECK-NEXT: ori 3, 3, 18177
150 ; CHECK-NEXT: rldic 3, 3, 5, 27
157 define i64 @cn_ones_1() #0 {
158 ; CHECK-LABEL: cn_ones_1:
159 ; CHECK: # %bb.0: # %entry
160 ; CHECK-NEXT: li 3, -25633
161 ; CHECK-NEXT: rldicl 3, 3, 18, 30
168 define i64 @cn_ones_2() #0 {
169 ; CHECK-LABEL: cn_ones_2:
170 ; CHECK: # %bb.0: # %entry
171 ; CHECK-NEXT: lis 3, -25638
172 ; CHECK-NEXT: ori 3, 3, 24575
173 ; CHECK-NEXT: rldicl 3, 3, 2, 30
180 define i64 @imm1() #0 {
182 ; CHECK: # %bb.0: # %entry
183 ; CHECK-NEXT: li 3, 8465
184 ; CHECK-NEXT: rldic 3, 3, 28, 22
187 ret i64 2272306135040 ;0x21110000000
190 define i64 @imm2() #0 {
192 ; CHECK: # %bb.0: # %entry
193 ; CHECK-NEXT: li 3, -28536
194 ; CHECK-NEXT: rldicl 3, 3, 1, 32
197 ret i64 4294910225 ;0xFFFF2111
200 define i64 @imm3() #0 {
202 ; CHECK: # %bb.0: # %entry
203 ; CHECK-NEXT: li 3, -32495
204 ; CHECK-NEXT: rldic 3, 3, 0, 32
207 ret i64 4294934801 ;0xFFFF8111
210 define i64 @imm4() #0 {
212 ; CHECK: # %bb.0: # %entry
213 ; CHECK-NEXT: lis 3, 33
214 ; CHECK-NEXT: ori 3, 3, 4352
215 ; CHECK-NEXT: rldimi 3, 3, 32, 0
218 ret i64 9307365931290880 ;0x21110000211100
221 define i64 @imm5() #0 {
223 ; CHECK: # %bb.0: # %entry
224 ; CHECK-NEXT: li 3, 28685
225 ; CHECK-NEXT: rotldi 3, 3, 52
228 ret i64 58546795155816455 ;0xd0000000000007
231 define i64 @imm6() #0 {
233 ; CHECK: # %bb.0: # %entry
234 ; CHECK-NEXT: lis 3, -1
235 ; CHECK-NEXT: ori 3, 3, 28674
236 ; CHECK-NEXT: rotldi 3, 3, 52
239 ret i64 13510798882111479 ;0x2ffffffffffff7
242 define i64 @imm7() #0 {
244 ; CHECK: # %bb.0: # %entry
245 ; CHECK-NEXT: li 3, -3823
246 ; CHECK-NEXT: rldic 3, 3, 28, 20
249 ret i64 16565957296128 ;0xf1110000000
252 define i64 @imm8() #0 {
254 ; CHECK: # %bb.0: # %entry
255 ; CHECK-NEXT: li 3, -7919
256 ; CHECK-NEXT: rldic 3, 3, 22, 22
259 ret i64 4364831817728 ;0x3f844400000
262 define i64 @imm9() #0 {
264 ; CHECK: # %bb.0: # %entry
265 ; CHECK-NEXT: lis 3, -1
266 ; CHECK-NEXT: ori 3, 3, 28674
267 ; CHECK-NEXT: rotldi 3, 3, 52
270 ret i64 13510798882111479 ;0x2ffffffffffff7
273 define i64 @imm10() #0 {
274 ; CHECK-LABEL: imm10:
275 ; CHECK: # %bb.0: # %entry
276 ; CHECK-NEXT: li 3, -3823
277 ; CHECK-NEXT: rldic 3, 3, 28, 20
280 ret i64 16565957296128 ;0xf1110000000
283 define i64 @imm11() #0 {
284 ; CHECK-LABEL: imm11:
285 ; CHECK: # %bb.0: # %entry
286 ; CHECK-NEXT: li 3, -7919
287 ; CHECK-NEXT: rldic 3, 3, 22, 22
290 ret i64 4364831817728 ;0x3f844400000
293 define i64 @imm12() #0 {
294 ; CHECK-LABEL: imm12:
295 ; CHECK: # %bb.0: # %entry
296 ; CHECK-NEXT: lis 3, -29
297 ; CHECK-NEXT: ori 3, 3, 64577
298 ; CHECK-NEXT: rldic 3, 3, 12, 20
301 ret i64 17584665923584 ;0xffe3fc41000
304 define i64 @imm13() #0 {
305 ; CHECK-LABEL: imm13:
306 ; CHECK: # %bb.0: # %entry
307 ; CHECK-NEXT: li 3, -24847
308 ; CHECK-NEXT: rldicl 3, 3, 21, 27
311 ret i64 85333114879 ;0x13de3fffff
314 define i64 @imm13_2() #0 {
315 ; CHECK-LABEL: imm13_2:
316 ; CHECK: # %bb.0: # %entry
317 ; CHECK-NEXT: li 3, -12424
318 ; CHECK-NEXT: rldicl 3, 3, 22, 26
321 ret i64 222772068351 ;0x33de3fffff
324 define i64 @imm14() #0 {
325 ; CHECK-LABEL: imm14:
326 ; CHECK: # %bb.0: # %entry
327 ; CHECK-NEXT: li 3, -3960
328 ; CHECK-NEXT: rldicl 3, 3, 21, 24
331 ret i64 1091209003007 ;0xfe111fffff
334 define i64 @imm15() #0 {
335 ; CHECK-LABEL: imm15:
336 ; CHECK: # %bb.0: # %entry
337 ; CHECK-NEXT: li 3, -8065
338 ; CHECK-NEXT: rldic 3, 3, 24, 0
341 ret i64 -135308247040
344 define i64 @imm16() #0 {
345 ; CHECK-LABEL: imm16:
346 ; CHECK: # %bb.0: # %entry
347 ; CHECK-NEXT: lis 3, -16392
348 ; CHECK-NEXT: ori 3, 3, 57217
349 ; CHECK-NEXT: rldic 3, 3, 16, 0
352 ret i64 -70399354142720
355 define i64 @imm17() #0 {
356 ; CHECK-LABEL: imm17:
357 ; CHECK: # %bb.0: # %entry
358 ; CHECK-NEXT: lis 3, 20344
359 ; CHECK-NEXT: ori 3, 3, 32847
360 ; CHECK-NEXT: rotldi 3, 3, 49
363 ret i64 44473046320324337 ;0x9e000000009ef1
366 define i64 @imm18() #0 {
367 ; CHECK-LABEL: imm18:
368 ; CHECK: # %bb.0: # %entry
369 ; CHECK-NEXT: li 3, 1
370 ; CHECK-NEXT: rldic 3, 3, 33, 30
371 ; CHECK-NEXT: oris 3, 3, 39436
372 ; CHECK-NEXT: ori 3, 3, 61633
378 define i64 @imm19() {
379 ; CHECK-LABEL: imm19:
380 ; CHECK: # %bb.0: # %entry
381 ; CHECK-NEXT: lis 3, -13105
382 ; CHECK-NEXT: ori 3, 3, 52479
383 ; CHECK-NEXT: rldic 3, 3, 32, 0
384 ; CHECK-NEXT: oris 3, 3, 52431
385 ; CHECK-NEXT: ori 3, 3, 291
388 ret i64 14758239902941249827 ;0xCCCFCCFFCCCF0123
391 define i64 @imm20() {
392 ; CHECK-LABEL: imm20:
393 ; CHECK: # %bb.0: # %entry
394 ; CHECK-NEXT: lis 3, 291
395 ; CHECK-NEXT: ori 3, 3, 52479
396 ; CHECK-NEXT: rldimi 3, 3, 32, 0
397 ; CHECK-NEXT: rldimi 3, 3, 48, 0
400 ret i64 14771750698406366463 ;0xCCFFCCFF0123CCFF
403 define i64 @imm21() {
404 ; CHECK-LABEL: imm21:
405 ; CHECK: # %bb.0: # %entry
406 ; CHECK-NEXT: lis 3, -13057
407 ; CHECK-NEXT: ori 3, 3, 291
408 ; CHECK-NEXT: rldimi 3, 3, 32, 0
409 ; CHECK-NEXT: rlwimi 3, 3, 16, 16, 31
412 ret i64 14771526556073315583 ;0xCCFF0123CCFFCCFF
415 define i64 @imm22() {
416 ; CHECK-LABEL: imm22:
417 ; CHECK: # %bb.0: # %entry
418 ; CHECK-NEXT: lis 3, 291
419 ; CHECK-NEXT: ori 3, 3, 52479
420 ; CHECK-NEXT: rldimi 3, 3, 32, 0
421 ; CHECK-NEXT: rlwimi 3, 3, 16, 0, 15
424 ret i64 82134617250843903 ;0x0123CCFFCCFFCCFF
427 attributes #0 = { nounwind readnone }