1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
4 target datalayout = "E-m:a-i64:64-n32:64-S128-v256:256:256-v512:512:512"
5 target triple = "powerpc64-ibm-aix7.2.0.0"
7 %struct.USST = type { i16, i16 }
8 %struct.SST = type { i16, i16 }
9 %struct.CST = type { i8, i8 }
10 %struct.SCST = type { i8, i8 }
11 %struct.ST = type { i32, i32 }
12 %struct.UST = type { i32, i32 }
13 %struct.LST = type { i64, i64 }
14 %struct.ULST = type { i64, i64 }
16 ; Function Attrs: nounwind
17 define zeroext i32 @ustc1(ptr noundef byval(%struct.USST) align 8 %s) {
19 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: rldicl 3, 3, 8, 56
22 ; CHECK-NEXT: std 4, 48(1)
25 %0 = load i16, ptr %s, align 8
26 %conv = zext i16 %0 to i32
27 %shr = ashr i32 %conv, 8
31 ; Function Attrs: nounwind
32 define zeroext i32 @ustc2(ptr noundef byval(%struct.USST) align 8 %s) {
34 ; CHECK: # %bb.0: # %entry
36 ; CHECK-NEXT: rldicl 3, 3, 16, 48
37 ; CHECK-NEXT: std 4, 48(1)
40 %0 = load i16, ptr %s, align 8
41 %conv = zext i16 %0 to i32
45 ; Function Attrs: nounwind
46 define signext i32 @stc1(ptr noundef byval(%struct.SST) align 8 %s) {
48 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: rldicl 3, 3, 16, 48
51 ; CHECK-NEXT: std 4, 48(1)
52 ; CHECK-NEXT: extsh 3, 3
53 ; CHECK-NEXT: srawi 3, 3, 8
56 %0 = load i16, ptr %s, align 8
57 %conv = sext i16 %0 to i32
58 %shr = ashr i32 %conv, 8
62 ; Function Attrs: nounwind
63 define signext i32 @stc2(ptr noundef byval(%struct.SST) align 8 %s) {
65 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: sradi 3, 3, 48
68 ; CHECK-NEXT: std 4, 48(1)
71 %0 = load i16, ptr %s, align 8
72 %conv = sext i16 %0 to i32
76 ; Function Attrs: nounwind
77 define signext i32 @ctc(ptr noundef byval(%struct.CST) align 8 %s) {
79 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: rldicl 3, 3, 8, 56
82 ; CHECK-NEXT: std 4, 48(1)
85 %0 = load i8, ptr %s, align 8
86 %conv = zext i8 %0 to i32
90 ; Function Attrs: nounwind
91 define signext i32 @sctc(ptr noundef byval(%struct.SCST) align 8 %s) {
93 ; CHECK: # %bb.0: # %entry
95 ; CHECK-NEXT: sradi 3, 3, 56
96 ; CHECK-NEXT: std 4, 48(1)
99 %0 = load i8, ptr %s, align 8
100 %conv = sext i8 %0 to i32
104 ; Function Attrs: nounwind
105 define signext i32 @tc44(ptr noundef byval(%struct.ST) align 8 %s) {
107 ; CHECK: # %bb.0: # %entry
108 ; CHECK-NEXT: mr 4, 3
109 ; CHECK-NEXT: sradi 3, 3, 32
110 ; CHECK-NEXT: std 4, 48(1)
113 %0 = load i32, ptr %s, align 8
117 ; Function Attrs: nounwind
118 define signext i32 @tc41(ptr noundef byval(%struct.ST) align 8 %s) {
120 ; CHECK: # %bb.0: # %entry
121 ; CHECK-NEXT: mr 4, 3
122 ; CHECK-NEXT: sradi 3, 3, 56
123 ; CHECK-NEXT: std 4, 48(1)
126 %0 = load i32, ptr %s, align 8
127 %shr = ashr i32 %0, 24
131 ; Function Attrs: nounwind
132 define signext i32 @tc42(ptr noundef byval(%struct.ST) align 8 %s) {
134 ; CHECK: # %bb.0: # %entry
135 ; CHECK-NEXT: mr 4, 3
136 ; CHECK-NEXT: sradi 3, 3, 48
137 ; CHECK-NEXT: std 4, 48(1)
140 %0 = load i32, ptr %s, align 8
141 %shr = ashr i32 %0, 16
145 ; Function Attrs: nounwind
146 define signext i32 @tc43(ptr noundef byval(%struct.ST) align 8 %s) {
148 ; CHECK: # %bb.0: # %entry
149 ; CHECK-NEXT: mr 4, 3
150 ; CHECK-NEXT: sradi 3, 3, 40
151 ; CHECK-NEXT: std 4, 48(1)
154 %0 = load i32, ptr %s, align 8
155 %shr = ashr i32 %0, 8
159 ; Function Attrs: nounwind
160 define zeroext i32 @utc44(ptr noundef byval(%struct.UST) align 8 %s) #0 {
161 ; CHECK-LABEL: utc44:
162 ; CHECK: # %bb.0: # %entry
163 ; CHECK-NEXT: mr 4, 3
164 ; CHECK-NEXT: rldicl 3, 3, 32, 32
165 ; CHECK-NEXT: std 4, 48(1)
168 %0 = load i32, ptr %s, align 8
172 ; Function Attrs: nounwind
173 define zeroext i32 @utc41(ptr noundef byval(%struct.UST) align 8 %s) {
174 ; CHECK-LABEL: utc41:
175 ; CHECK: # %bb.0: # %entry
176 ; CHECK-NEXT: mr 4, 3
177 ; CHECK-NEXT: rldicl 3, 3, 8, 56
178 ; CHECK-NEXT: std 4, 48(1)
181 %0 = load i32, ptr %s, align 8
182 %shr = lshr i32 %0, 24
186 ; Function Attrs: nounwind
187 define zeroext i32 @utc42(ptr noundef byval(%struct.UST) align 8 %s) {
188 ; CHECK-LABEL: utc42:
189 ; CHECK: # %bb.0: # %entry
190 ; CHECK-NEXT: mr 4, 3
191 ; CHECK-NEXT: rldicl 3, 3, 16, 48
192 ; CHECK-NEXT: std 4, 48(1)
195 %0 = load i32, ptr %s, align 8
196 %shr = lshr i32 %0, 16
200 ; Function Attrs: nounwind
201 define zeroext i32 @utc43(ptr noundef byval(%struct.UST) align 8 %s) {
202 ; CHECK-LABEL: utc43:
203 ; CHECK: # %bb.0: # %entry
204 ; CHECK-NEXT: mr 4, 3
205 ; CHECK-NEXT: rldicl 3, 3, 24, 40
206 ; CHECK-NEXT: std 4, 48(1)
209 %0 = load i32, ptr %s, align 8
210 %shr = lshr i32 %0, 8
214 ; Function Attrs: nounwind
215 define i64 @ltc88(ptr noundef byval(%struct.LST) align 8 %s) {
216 ; CHECK-LABEL: ltc88:
217 ; CHECK: # %bb.0: # %entry
218 ; CHECK-NEXT: mr 5, 3
219 ; CHECK-NEXT: sradi 3, 3, 8
220 ; CHECK-NEXT: std 5, 48(1)
221 ; CHECK-NEXT: std 4, 56(1)
224 %0 = load i64, ptr %s, align 8
225 %shr = ashr i64 %0, 8
229 ; Function Attrs: nounwind
230 define i64 @ltc86(ptr noundef byval(%struct.LST) align 8 %s) {
231 ; CHECK-LABEL: ltc86:
232 ; CHECK: # %bb.0: # %entry
233 ; CHECK-NEXT: mr 5, 3
234 ; CHECK-NEXT: sradi 3, 3, 16
235 ; CHECK-NEXT: std 5, 48(1)
236 ; CHECK-NEXT: std 4, 56(1)
239 %0 = load i64, ptr %s, align 8
240 %shr = ashr i64 %0, 16
244 ; Function Attrs: nounwind
245 define i64 @ltc85(ptr noundef byval(%struct.LST) align 8 %s) {
246 ; CHECK-LABEL: ltc85:
247 ; CHECK: # %bb.0: # %entry
248 ; CHECK-NEXT: mr 5, 3
249 ; CHECK-NEXT: sradi 3, 3, 24
250 ; CHECK-NEXT: std 5, 48(1)
251 ; CHECK-NEXT: std 4, 56(1)
254 %0 = load i64, ptr %s, align 8
255 %shr = ashr i64 %0, 24
259 ; Function Attrs: nounwind
260 define i64 @ltc84(ptr noundef byval(%struct.LST) align 8 %s) {
261 ; CHECK-LABEL: ltc84:
262 ; CHECK: # %bb.0: # %entry
263 ; CHECK-NEXT: mr 5, 3
264 ; CHECK-NEXT: sradi 3, 3, 32
265 ; CHECK-NEXT: std 5, 48(1)
266 ; CHECK-NEXT: std 4, 56(1)
269 %0 = load i64, ptr %s, align 8
270 %shr = ashr i64 %0, 32
274 ; Function Attrs: nounwind
275 define i64 @ltc83(ptr noundef byval(%struct.LST) align 8 %s) {
276 ; CHECK-LABEL: ltc83:
277 ; CHECK: # %bb.0: # %entry
278 ; CHECK-NEXT: mr 5, 3
279 ; CHECK-NEXT: sradi 3, 3, 40
280 ; CHECK-NEXT: std 5, 48(1)
281 ; CHECK-NEXT: std 4, 56(1)
284 %0 = load i64, ptr %s, align 8
285 %shr = ashr i64 %0, 40
289 ; Function Attrs: nounwind
290 define i64 @ltc82(ptr noundef byval(%struct.LST) align 8 %s) {
291 ; CHECK-LABEL: ltc82:
292 ; CHECK: # %bb.0: # %entry
293 ; CHECK-NEXT: mr 5, 3
294 ; CHECK-NEXT: sradi 3, 3, 48
295 ; CHECK-NEXT: std 5, 48(1)
296 ; CHECK-NEXT: std 4, 56(1)
299 %0 = load i64, ptr %s, align 8
300 %shr = ashr i64 %0, 48
304 ; Function Attrs: nounwind
305 define i64 @ltc81(ptr noundef byval(%struct.LST) align 8 %s) {
306 ; CHECK-LABEL: ltc81:
307 ; CHECK: # %bb.0: # %entry
308 ; CHECK-NEXT: mr 5, 3
309 ; CHECK-NEXT: sradi 3, 3, 56
310 ; CHECK-NEXT: std 5, 48(1)
311 ; CHECK-NEXT: std 4, 56(1)
314 %0 = load i64, ptr %s, align 8
315 %shr = ashr i64 %0, 56
319 ; Function Attrs: nounwind
320 define i64 @ultc88(ptr noundef byval(%struct.ULST) align 8 %s) {
321 ; CHECK-LABEL: ultc88:
322 ; CHECK: # %bb.0: # %entry
323 ; CHECK-NEXT: std 3, 48(1)
324 ; CHECK-NEXT: std 4, 56(1)
327 %0 = load i64, ptr %s, align 8
331 ; Function Attrs: nounwind
332 define i64 @ultc87(ptr noundef byval(%struct.ULST) align 8 %s) {
333 ; CHECK-LABEL: ultc87:
334 ; CHECK: # %bb.0: # %entry
335 ; CHECK-NEXT: mr 5, 3
336 ; CHECK-NEXT: rldicl 3, 3, 56, 8
337 ; CHECK-NEXT: std 5, 48(1)
338 ; CHECK-NEXT: std 4, 56(1)
341 %0 = load i64, ptr %s, align 8
342 %shr = lshr i64 %0, 8
346 ; Function Attrs: nounwind
347 define i64 @ultc86(ptr noundef byval(%struct.ULST) align 8 %s) {
348 ; CHECK-LABEL: ultc86:
349 ; CHECK: # %bb.0: # %entry
350 ; CHECK-NEXT: mr 5, 3
351 ; CHECK-NEXT: rldicl 3, 3, 48, 16
352 ; CHECK-NEXT: std 5, 48(1)
353 ; CHECK-NEXT: std 4, 56(1)
356 %0 = load i64, ptr %s, align 8
357 %shr = lshr i64 %0, 16
361 ; Function Attrs: nounwind
362 define i64 @ultc85(ptr noundef byval(%struct.ULST) align 8 %s) {
363 ; CHECK-LABEL: ultc85:
364 ; CHECK: # %bb.0: # %entry
365 ; CHECK-NEXT: mr 5, 3
366 ; CHECK-NEXT: rldicl 3, 3, 40, 24
367 ; CHECK-NEXT: std 5, 48(1)
368 ; CHECK-NEXT: std 4, 56(1)
371 %0 = load i64, ptr %s, align 8
372 %shr = lshr i64 %0, 24
376 ; Function Attrs: nounwind
377 define i64 @ultc84(ptr noundef byval(%struct.ULST) align 8 %s) {
378 ; CHECK-LABEL: ultc84:
379 ; CHECK: # %bb.0: # %entry
380 ; CHECK-NEXT: mr 5, 3
381 ; CHECK-NEXT: rldicl 3, 3, 32, 32
382 ; CHECK-NEXT: std 5, 48(1)
383 ; CHECK-NEXT: std 4, 56(1)
386 %0 = load i64, ptr %s, align 8
387 %shr = lshr i64 %0, 32
391 ; Function Attrs: nounwind
392 define i64 @ultc83(ptr noundef byval(%struct.ULST) align 8 %s) {
393 ; CHECK-LABEL: ultc83:
394 ; CHECK: # %bb.0: # %entry
395 ; CHECK-NEXT: mr 5, 3
396 ; CHECK-NEXT: rldicl 3, 3, 24, 40
397 ; CHECK-NEXT: std 5, 48(1)
398 ; CHECK-NEXT: std 4, 56(1)
401 %0 = load i64, ptr %s, align 8
402 %shr = lshr i64 %0, 40
406 ; Function Attrs: nounwind
407 define i64 @ultc82(ptr noundef byval(%struct.ULST) align 8 %s) {
408 ; CHECK-LABEL: ultc82:
409 ; CHECK: # %bb.0: # %entry
410 ; CHECK-NEXT: mr 5, 3
411 ; CHECK-NEXT: rldicl 3, 3, 16, 48
412 ; CHECK-NEXT: std 5, 48(1)
413 ; CHECK-NEXT: std 4, 56(1)
416 %0 = load i64, ptr %s, align 8
417 %shr = lshr i64 %0, 48
421 ; Function Attrs: nounwind
422 define i64 @ultc81(ptr noundef byval(%struct.ULST) align 8 %s) {
423 ; CHECK-LABEL: ultc81:
424 ; CHECK: # %bb.0: # %entry
425 ; CHECK-NEXT: mr 5, 3
426 ; CHECK-NEXT: rldicl 3, 3, 8, 56
427 ; CHECK-NEXT: std 5, 48(1)
428 ; CHECK-NEXT: std 4, 56(1)
431 %0 = load i64, ptr %s, align 8
432 %shr = lshr i64 %0, 56