1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
3 target datalayout = "E-m:e-p:32:32-i128:64-n32"
4 target triple = "powerpc-ellcc-linux"
6 ; Function Attrs: nounwind
7 define void @foo1(ptr %a, ptr readonly %b, ptr readonly %c) #0 {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: stwu 1, -64(1)
11 ; CHECK-NEXT: stw 28, 48(1) # 4-byte Folded Spill
12 ; CHECK-NEXT: li 8, 2048
13 ; CHECK-NEXT: stw 29, 52(1) # 4-byte Folded Spill
15 ; CHECK-NEXT: stw 30, 56(1) # 4-byte Folded Spill
18 ; CHECK-NEXT: addi 8, 1, 16
19 ; CHECK-NEXT: .LBB0_1: # %for.body
21 ; CHECK-NEXT: lwz 9, 0(4)
22 ; CHECK-NEXT: lwz 10, 4(4)
23 ; CHECK-NEXT: lwz 11, 8(4)
24 ; CHECK-NEXT: lwz 12, 12(4)
25 ; CHECK-NEXT: lwz 0, 12(5)
26 ; CHECK-NEXT: stw 6, 44(1)
27 ; CHECK-NEXT: stw 6, 40(1)
28 ; CHECK-NEXT: stw 6, 36(1)
29 ; CHECK-NEXT: stw 6, 32(1)
30 ; CHECK-NEXT: stw 12, 28(1)
31 ; CHECK-NEXT: clrlwi 12, 0, 29
32 ; CHECK-NEXT: stw 11, 24(1)
33 ; CHECK-NEXT: nand 11, 0, 7
34 ; CHECK-NEXT: stw 10, 20(1)
35 ; CHECK-NEXT: subfic 29, 12, 32
36 ; CHECK-NEXT: stw 9, 16(1)
37 ; CHECK-NEXT: rlwinm 9, 0, 29, 28, 31
38 ; CHECK-NEXT: lwzux 10, 9, 8
39 ; CHECK-NEXT: clrlwi 11, 11, 27
40 ; CHECK-NEXT: lwz 0, 8(9)
41 ; CHECK-NEXT: slw 10, 10, 12
42 ; CHECK-NEXT: lwz 30, 4(9)
43 ; CHECK-NEXT: lwz 9, 12(9)
44 ; CHECK-NEXT: slw 28, 30, 12
45 ; CHECK-NEXT: srw 30, 30, 29
46 ; CHECK-NEXT: srw 29, 9, 29
47 ; CHECK-NEXT: slw 9, 9, 12
48 ; CHECK-NEXT: slw 12, 0, 12
49 ; CHECK-NEXT: srwi 0, 0, 1
50 ; CHECK-NEXT: stw 9, 12(3)
51 ; CHECK-NEXT: or 9, 12, 29
52 ; CHECK-NEXT: srw 11, 0, 11
53 ; CHECK-NEXT: stw 9, 8(3)
54 ; CHECK-NEXT: or 9, 10, 30
55 ; CHECK-NEXT: stw 9, 0(3)
56 ; CHECK-NEXT: or 9, 28, 11
57 ; CHECK-NEXT: stw 9, 4(3)
58 ; CHECK-NEXT: bdnz .LBB0_1
59 ; CHECK-NEXT: # %bb.2: # %for.end
60 ; CHECK-NEXT: lwz 30, 56(1) # 4-byte Folded Reload
61 ; CHECK-NEXT: lwz 29, 52(1) # 4-byte Folded Reload
62 ; CHECK-NEXT: lwz 28, 48(1) # 4-byte Folded Reload
63 ; CHECK-NEXT: addi 1, 1, 64
68 for.body: ; preds = %for.body, %entry
69 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
70 %0 = load i128, ptr %b, align 16
71 %1 = load i128, ptr %c, align 16
72 %shl = shl i128 %0, %1
73 store i128 %shl, ptr %a, align 16
74 %inc = add nsw i32 %i.02, 1
75 %exitcond = icmp eq i32 %inc, 2048
76 br i1 %exitcond, label %for.end, label %for.body
78 for.end: ; preds = %for.body
82 ; Function Attrs: nounwind
83 define void @foo2(ptr %a, ptr readonly %b, ptr readonly %c) #0 {
85 ; CHECK: # %bb.0: # %entry
86 ; CHECK-NEXT: stwu 1, -64(1)
87 ; CHECK-NEXT: stw 29, 52(1) # 4-byte Folded Spill
88 ; CHECK-NEXT: li 7, 2048
89 ; CHECK-NEXT: stw 30, 56(1) # 4-byte Folded Spill
92 ; CHECK-NEXT: addi 7, 1, 36
93 ; CHECK-NEXT: .LBB1_1: # %for.body
95 ; CHECK-NEXT: lwz 8, 0(4)
96 ; CHECK-NEXT: lwz 10, 8(4)
97 ; CHECK-NEXT: lwz 12, 12(5)
98 ; CHECK-NEXT: lwz 9, 4(4)
99 ; CHECK-NEXT: lwz 11, 12(4)
100 ; CHECK-NEXT: stw 10, 44(1)
101 ; CHECK-NEXT: rlwinm 10, 12, 29, 28, 31
102 ; CHECK-NEXT: stw 8, 36(1)
103 ; CHECK-NEXT: srawi 8, 8, 31
104 ; CHECK-NEXT: stw 11, 48(1)
105 ; CHECK-NEXT: clrlwi 11, 12, 29
106 ; CHECK-NEXT: stw 9, 40(1)
107 ; CHECK-NEXT: nand 9, 12, 6
108 ; CHECK-NEXT: stw 8, 32(1)
109 ; CHECK-NEXT: subfic 30, 11, 32
110 ; CHECK-NEXT: stw 8, 28(1)
111 ; CHECK-NEXT: clrlwi 9, 9, 27
112 ; CHECK-NEXT: stw 8, 24(1)
113 ; CHECK-NEXT: stw 8, 20(1)
114 ; CHECK-NEXT: sub 8, 7, 10
115 ; CHECK-NEXT: lwz 10, 4(8)
116 ; CHECK-NEXT: lwz 12, 8(8)
117 ; CHECK-NEXT: lwz 0, 0(8)
118 ; CHECK-NEXT: lwz 8, 12(8)
119 ; CHECK-NEXT: srw 29, 12, 11
120 ; CHECK-NEXT: slw 12, 12, 30
121 ; CHECK-NEXT: slw 30, 0, 30
122 ; CHECK-NEXT: srw 8, 8, 11
123 ; CHECK-NEXT: sraw 0, 0, 11
124 ; CHECK-NEXT: srw 11, 10, 11
125 ; CHECK-NEXT: slwi 10, 10, 1
126 ; CHECK-NEXT: or 8, 12, 8
127 ; CHECK-NEXT: slw 9, 10, 9
128 ; CHECK-NEXT: stw 8, 12(3)
129 ; CHECK-NEXT: or 8, 30, 11
130 ; CHECK-NEXT: stw 8, 4(3)
131 ; CHECK-NEXT: or 8, 29, 9
132 ; CHECK-NEXT: stw 0, 0(3)
133 ; CHECK-NEXT: stw 8, 8(3)
134 ; CHECK-NEXT: bdnz .LBB1_1
135 ; CHECK-NEXT: # %bb.2: # %for.end
136 ; CHECK-NEXT: lwz 30, 56(1) # 4-byte Folded Reload
137 ; CHECK-NEXT: lwz 29, 52(1) # 4-byte Folded Reload
138 ; CHECK-NEXT: addi 1, 1, 64
143 for.body: ; preds = %for.body, %entry
144 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
145 %0 = load i128, ptr %b, align 16
146 %1 = load i128, ptr %c, align 16
147 %shl = ashr i128 %0, %1
148 store i128 %shl, ptr %a, align 16
149 %inc = add nsw i32 %i.02, 1
150 %exitcond = icmp eq i32 %inc, 2048
151 br i1 %exitcond, label %for.end, label %for.body
153 for.end: ; preds = %for.body
157 ; Function Attrs: nounwind
158 define void @foo3(ptr %a, ptr readonly %b, ptr readonly %c) #0 {
160 ; CHECK: # %bb.0: # %entry
161 ; CHECK-NEXT: stwu 1, -64(1)
162 ; CHECK-NEXT: stw 28, 48(1) # 4-byte Folded Spill
163 ; CHECK-NEXT: li 8, 2048
164 ; CHECK-NEXT: stw 29, 52(1) # 4-byte Folded Spill
165 ; CHECK-NEXT: li 6, 0
166 ; CHECK-NEXT: stw 30, 56(1) # 4-byte Folded Spill
167 ; CHECK-NEXT: li 7, 7
168 ; CHECK-NEXT: mtctr 8
169 ; CHECK-NEXT: addi 8, 1, 32
170 ; CHECK-NEXT: .LBB2_1: # %for.body
172 ; CHECK-NEXT: lwz 10, 4(4)
173 ; CHECK-NEXT: lwz 0, 12(5)
174 ; CHECK-NEXT: lwz 9, 0(4)
175 ; CHECK-NEXT: lwz 11, 8(4)
176 ; CHECK-NEXT: lwz 12, 12(4)
177 ; CHECK-NEXT: stw 10, 36(1)
178 ; CHECK-NEXT: rlwinm 10, 0, 29, 28, 31
179 ; CHECK-NEXT: stw 6, 28(1)
180 ; CHECK-NEXT: sub 10, 8, 10
181 ; CHECK-NEXT: stw 6, 24(1)
182 ; CHECK-NEXT: stw 6, 20(1)
183 ; CHECK-NEXT: stw 6, 16(1)
184 ; CHECK-NEXT: stw 12, 44(1)
185 ; CHECK-NEXT: clrlwi 12, 0, 29
186 ; CHECK-NEXT: stw 11, 40(1)
187 ; CHECK-NEXT: subfic 29, 12, 32
188 ; CHECK-NEXT: stw 9, 32(1)
189 ; CHECK-NEXT: nand 9, 0, 7
190 ; CHECK-NEXT: lwz 11, 4(10)
191 ; CHECK-NEXT: clrlwi 9, 9, 27
192 ; CHECK-NEXT: lwz 0, 8(10)
193 ; CHECK-NEXT: lwz 30, 0(10)
194 ; CHECK-NEXT: lwz 10, 12(10)
195 ; CHECK-NEXT: srw 28, 0, 12
196 ; CHECK-NEXT: slw 0, 0, 29
197 ; CHECK-NEXT: slw 29, 30, 29
198 ; CHECK-NEXT: srw 10, 10, 12
199 ; CHECK-NEXT: srw 30, 30, 12
200 ; CHECK-NEXT: srw 12, 11, 12
201 ; CHECK-NEXT: slwi 11, 11, 1
202 ; CHECK-NEXT: slw 9, 11, 9
203 ; CHECK-NEXT: or 10, 0, 10
204 ; CHECK-NEXT: stw 10, 12(3)
205 ; CHECK-NEXT: or 10, 29, 12
206 ; CHECK-NEXT: or 9, 28, 9
207 ; CHECK-NEXT: stw 30, 0(3)
208 ; CHECK-NEXT: stw 10, 4(3)
209 ; CHECK-NEXT: stw 9, 8(3)
210 ; CHECK-NEXT: bdnz .LBB2_1
211 ; CHECK-NEXT: # %bb.2: # %for.end
212 ; CHECK-NEXT: lwz 30, 56(1) # 4-byte Folded Reload
213 ; CHECK-NEXT: lwz 29, 52(1) # 4-byte Folded Reload
214 ; CHECK-NEXT: lwz 28, 48(1) # 4-byte Folded Reload
215 ; CHECK-NEXT: addi 1, 1, 64
220 for.body: ; preds = %for.body, %entry
221 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
222 %0 = load i128, ptr %b, align 16
223 %1 = load i128, ptr %c, align 16
224 %shl = lshr i128 %0, %1
225 store i128 %shl, ptr %a, align 16
226 %inc = add nsw i32 %i.02, 1
227 %exitcond = icmp eq i32 %inc, 2048
228 br i1 %exitcond, label %for.end, label %for.body
230 for.end: ; preds = %for.body
234 attributes #0 = { nounwind }