1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-ibm-aix -mcpu=pwr8 | FileCheck %s
5 define i64 @rldimi1(i64 %a) {
6 ; CHECK-LABEL: rldimi1:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: rldimi 3, 3, 8, 0
17 define i64 @rldimi2(i64 %a) {
18 ; CHECK-LABEL: rldimi2:
19 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: rlwimi 4, 3, 8, 16, 23
22 ; CHECK-NEXT: rlwimi 4, 3, 16, 8, 15
23 ; CHECK-NEXT: rldimi 4, 3, 24, 0
31 %x4 = and i64 %x2, 65535
36 define i64 @rldimi3(i64 %a) {
37 ; CHECK-LABEL: rldimi3:
38 ; CHECK: # %bb.0: # %entry
39 ; CHECK-NEXT: rotldi 4, 3, 32
40 ; CHECK-NEXT: rlwimi 4, 3, 0, 24, 31
41 ; CHECK-NEXT: rlwimi 4, 3, 8, 16, 23
42 ; CHECK-NEXT: rlwimi 4, 3, 16, 8, 15
43 ; CHECK-NEXT: rlwimi 4, 3, 24, 0, 7
44 ; CHECK-NEXT: rldimi 4, 3, 40, 16
45 ; CHECK-NEXT: rldimi 4, 3, 48, 8
46 ; CHECK-NEXT: rldimi 4, 3, 56, 0
54 %4 = and i64 %2, 65535
57 %7 = and i64 %5, 4294967295
62 define i64 @rldimi4(i64 %a) {
63 ; CHECK-LABEL: rldimi4:
65 ; CHECK-NEXT: rldimi 3, 3, 8, 0
66 ; CHECK-NEXT: rldimi 3, 3, 16, 0
67 ; CHECK-NEXT: rldimi 3, 3, 32, 0
69 %r1 = call i64 @llvm.ppc.rldimi(i64 %a, i64 %a, i32 8, i64 -256)
70 %r2 = call i64 @llvm.ppc.rldimi(i64 %r1, i64 %r1, i32 16, i64 -65536)
71 %r3 = call i64 @llvm.ppc.rldimi(i64 %r2, i64 %r2, i32 32, i64 -4294967296)
75 define i64 @rldimi5(i64 %a, i64 %b) {
76 ; CHECK-LABEL: rldimi5:
78 ; CHECK-NEXT: rldimi 4, 3, 8, 40
81 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 8, i64 16776960) ; 0xffff << 8
85 define i64 @rldimi6(i64 %a, i64 %b) {
86 ; CHECK-LABEL: rldimi6:
88 ; CHECK-NEXT: rotldi 3, 3, 1
89 ; CHECK-NEXT: rldimi 4, 3, 7, 41
92 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 8, i64 8388480) ; 0xffff << 7
96 define i64 @rldimi7(i64 %a, i64 %b) {
97 ; CHECK-LABEL: rldimi7:
99 ; CHECK-NEXT: rotldi 3, 3, 63
100 ; CHECK-NEXT: rldimi 4, 3, 9, 39
101 ; CHECK-NEXT: mr 3, 4
103 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 8, i64 33553920) ; 0xffff << 9
107 define i64 @rldimi8(i64 %a, i64 %b) {
108 ; CHECK-LABEL: rldimi8:
110 ; CHECK-NEXT: mr 3, 4
112 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 0, i64 0)
116 define i64 @rldimi9(i64 %a, i64 %b) {
117 ; CHECK-LABEL: rldimi9:
119 ; CHECK-NEXT: mr 3, 4
121 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 63, i64 0)
125 define i64 @rldimi10(i64 %a, i64 %b) {
126 ; CHECK-LABEL: rldimi10:
129 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 0, i64 -1)
133 define i64 @rldimi11(i64 %a, i64 %b) {
134 ; CHECK-LABEL: rldimi11:
136 ; CHECK-NEXT: rotldi 3, 3, 8
138 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 8, i64 -1)
142 define i64 @rldimi12(i64 %a, i64 %b) {
143 ; CHECK-LABEL: rldimi12:
145 ; CHECK-NEXT: rotldi 3, 3, 20
146 ; CHECK-NEXT: rldimi 4, 3, 44, 31
147 ; CHECK-NEXT: mr 3, 4
149 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 0, i64 18446726490113441791)
153 define i64 @rldimi13(i64 %a, i64 %b) {
154 ; CHECK-LABEL: rldimi13:
156 ; CHECK-NEXT: rotldi 3, 3, 62
157 ; CHECK-NEXT: rldimi 4, 3, 32, 2
158 ; CHECK-NEXT: mr 3, 4
160 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 30, i64 4611686014132420608)
164 define i64 @rldimi14(i64 %a, i64 %b) {
165 ; CHECK-LABEL: rldimi14:
167 ; CHECK-NEXT: rotldi 3, 3, 23
168 ; CHECK-NEXT: rldimi 4, 3, 53, 0
169 ; CHECK-NEXT: mr 3, 4
171 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18437736874454810624) ; mb=0, me=10
175 define i64 @rldimi15(i64 %a, i64 %b) {
176 ; CHECK-LABEL: rldimi15:
178 ; CHECK-NEXT: rotldi 3, 3, 36
179 ; CHECK-NEXT: rldimi 4, 3, 40, 10
180 ; CHECK-NEXT: mr 3, 4
182 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18013298997854208) ; mb=10, me=23
186 define i64 @rldimi16(i64 %a, i64 %b) {
187 ; CHECK-LABEL: rldimi16:
189 ; CHECK-NEXT: rotldi 3, 3, 57
190 ; CHECK-NEXT: rldimi 4, 3, 19, 10
191 ; CHECK-NEXT: mr 3, 4
193 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18014398508957696) ; mb=10, me=44
197 define i64 @rldimi17(i64 %a, i64 %b) {
198 ; CHECK-LABEL: rldimi17:
200 ; CHECK-NEXT: rotldi 3, 3, 43
201 ; CHECK-NEXT: rldimi 4, 3, 33, 25
202 ; CHECK-NEXT: mr 3, 4
204 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 541165879296) ; mb=25, me=30
208 define i64 @rldimi18(i64 %a, i64 %b) {
209 ; CHECK-LABEL: rldimi18:
211 ; CHECK-NEXT: rotldi 3, 3, 57
212 ; CHECK-NEXT: rldimi 4, 3, 19, 25
213 ; CHECK-NEXT: mr 3, 4
215 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 549755289600) ; mb=25, me=44
219 define i64 @rldimi19(i64 %a, i64 %b) {
220 ; CHECK-LABEL: rldimi19:
222 ; CHECK-NEXT: rotldi 3, 3, 57
223 ; CHECK-NEXT: rldimi 4, 3, 19, 33
224 ; CHECK-NEXT: mr 3, 4
226 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 2146959360) ; mb=33, me=44
230 define i64 @rldimi20(i64 %a, i64 %b) {
231 ; CHECK-LABEL: rldimi20:
233 ; CHECK-NEXT: rotldi 3, 3, 23
234 ; CHECK-NEXT: rldimi 4, 3, 53, 15
235 ; CHECK-NEXT: mr 3, 4
237 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18438299824408231935) ; mb=15, me=10
241 define i64 @rldimi21(i64 %a, i64 %b) {
242 ; CHECK-LABEL: rldimi21:
244 ; CHECK-NEXT: rotldi 3, 3, 23
245 ; CHECK-NEXT: rldimi 4, 3, 53, 25
246 ; CHECK-NEXT: mr 3, 4
248 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18437737424210624511) ; mb=25, me=10
252 define i64 @rldimi22(i64 %a, i64 %b) {
253 ; CHECK-LABEL: rldimi22:
255 ; CHECK-NEXT: rotldi 3, 3, 34
256 ; CHECK-NEXT: rldimi 4, 3, 42, 25
257 ; CHECK-NEXT: mr 3, 4
259 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18446740225418854399) ; mb=25, me=21
263 define i64 @rldimi23(i64 %a, i64 %b) {
264 ; CHECK-LABEL: rldimi23:
266 ; CHECK-NEXT: rotldi 3, 3, 23
267 ; CHECK-NEXT: rldimi 4, 3, 53, 44
268 ; CHECK-NEXT: mr 3, 4
270 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18437736874455859199) ; mb=44, me=10
274 define i64 @rldimi24(i64 %a, i64 %b) {
275 ; CHECK-LABEL: rldimi24:
277 ; CHECK-NEXT: rotldi 3, 3, 38
278 ; CHECK-NEXT: rldimi 4, 3, 38, 44
279 ; CHECK-NEXT: mr 3, 4
281 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18446743798832693247) ; mb=44, me=25
285 define i64 @rldimi25(i64 %a, i64 %b) {
286 ; CHECK-LABEL: rldimi25:
288 ; CHECK-NEXT: rotldi 3, 3, 48
289 ; CHECK-NEXT: rldimi 4, 3, 28, 44
290 ; CHECK-NEXT: mr 3, 4
292 %r = call i64 @llvm.ppc.rldimi(i64 %a, i64 %b, i32 12, i64 18446744073442164735) ; mb=44, me=35
296 declare i64 @llvm.ppc.rldimi(i64, i64, i32 immarg, i64 immarg)