1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -o - | FileCheck %s
4 define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
5 ; CHECK-LABEL: __fixunstfdi:
6 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: stwu 1, -464(1)
10 ; CHECK-NEXT: stw 0, 468(1)
11 ; CHECK-NEXT: lis 3, .LCPI0_0@ha
12 ; CHECK-NEXT: stw 29, 412(1) # 4-byte Folded Spill
13 ; CHECK-NEXT: stw 30, 416(1) # 4-byte Folded Spill
14 ; CHECK-NEXT: stw 12, 408(1)
15 ; CHECK-NEXT: stfd 2, 376(1)
16 ; CHECK-NEXT: lwz 4, 380(1)
17 ; CHECK-NEXT: stfd 27, 424(1) # 8-byte Folded Spill
18 ; CHECK-NEXT: stw 4, 396(1)
19 ; CHECK-NEXT: lwz 4, 376(1)
20 ; CHECK-NEXT: lfs 27, .LCPI0_0@l(3)
21 ; CHECK-NEXT: stfd 1, 384(1)
22 ; CHECK-NEXT: stw 4, 392(1)
23 ; CHECK-NEXT: fcmpu 0, 2, 27
24 ; CHECK-NEXT: lwz 4, 388(1)
25 ; CHECK-NEXT: fcmpu 1, 1, 27
26 ; CHECK-NEXT: lwz 3, 384(1)
27 ; CHECK-NEXT: crand 20, 6, 0
28 ; CHECK-NEXT: cror 20, 4, 20
29 ; CHECK-NEXT: stfd 28, 432(1) # 8-byte Folded Spill
30 ; CHECK-NEXT: stfd 29, 440(1) # 8-byte Folded Spill
31 ; CHECK-NEXT: stfd 30, 448(1) # 8-byte Folded Spill
32 ; CHECK-NEXT: stfd 31, 456(1) # 8-byte Folded Spill
33 ; CHECK-NEXT: stw 4, 404(1)
34 ; CHECK-NEXT: stw 3, 400(1)
35 ; CHECK-NEXT: bc 4, 20, .LBB0_2
36 ; CHECK-NEXT: # %bb.1: # %bb5
39 ; CHECK-NEXT: b .LBB0_17
40 ; CHECK-NEXT: .LBB0_2: # %bb1
41 ; CHECK-NEXT: lfd 0, 400(1)
42 ; CHECK-NEXT: lis 3, 15856
43 ; CHECK-NEXT: stw 3, 336(1)
44 ; CHECK-NEXT: li 29, 0
45 ; CHECK-NEXT: stfd 0, 304(1)
46 ; CHECK-NEXT: lwz 3, 308(1)
47 ; CHECK-NEXT: lfd 1, 392(1)
48 ; CHECK-NEXT: stw 3, 324(1)
49 ; CHECK-NEXT: lwz 3, 304(1)
50 ; CHECK-NEXT: stfd 1, 296(1)
51 ; CHECK-NEXT: stw 3, 320(1)
52 ; CHECK-NEXT: lwz 3, 300(1)
53 ; CHECK-NEXT: stw 29, 340(1)
54 ; CHECK-NEXT: stw 3, 316(1)
55 ; CHECK-NEXT: lwz 3, 296(1)
56 ; CHECK-NEXT: stw 29, 332(1)
57 ; CHECK-NEXT: stw 3, 312(1)
58 ; CHECK-NEXT: stw 29, 328(1)
59 ; CHECK-NEXT: lfd 31, 320(1)
60 ; CHECK-NEXT: lfd 30, 312(1)
61 ; CHECK-NEXT: lfd 3, 336(1)
62 ; CHECK-NEXT: fmr 1, 31
63 ; CHECK-NEXT: lfd 4, 328(1)
64 ; CHECK-NEXT: fmr 2, 30
65 ; CHECK-NEXT: bl __gcc_qmul
66 ; CHECK-NEXT: lis 3, 16864
67 ; CHECK-NEXT: stfd 1, 280(1)
68 ; CHECK-NEXT: fmr 29, 1
69 ; CHECK-NEXT: stw 3, 368(1)
70 ; CHECK-NEXT: fmr 28, 2
71 ; CHECK-NEXT: lwz 3, 284(1)
72 ; CHECK-NEXT: stfd 2, 288(1)
73 ; CHECK-NEXT: stw 3, 356(1)
74 ; CHECK-NEXT: lwz 3, 280(1)
75 ; CHECK-NEXT: stw 29, 372(1)
76 ; CHECK-NEXT: stw 3, 352(1)
77 ; CHECK-NEXT: lwz 3, 292(1)
78 ; CHECK-NEXT: stw 29, 364(1)
79 ; CHECK-NEXT: stw 3, 348(1)
80 ; CHECK-NEXT: lwz 3, 288(1)
81 ; CHECK-NEXT: stw 29, 360(1)
82 ; CHECK-NEXT: stw 3, 344(1)
83 ; CHECK-NEXT: lfd 3, 368(1)
84 ; CHECK-NEXT: lfd 4, 360(1)
85 ; CHECK-NEXT: lfd 1, 352(1)
86 ; CHECK-NEXT: lfd 2, 344(1)
87 ; CHECK-NEXT: bl __gcc_qsub
89 ; CHECK-NEXT: mtfsb1 31
90 ; CHECK-NEXT: mtfsb0 30
91 ; CHECK-NEXT: fadd 1, 2, 1
92 ; CHECK-NEXT: mtfsf 1, 0
93 ; CHECK-NEXT: fctiwz 0, 1
94 ; CHECK-NEXT: stfd 0, 160(1)
96 ; CHECK-NEXT: mtfsb1 31
97 ; CHECK-NEXT: lis 3, .LCPI0_1@ha
98 ; CHECK-NEXT: mtfsb0 30
99 ; CHECK-NEXT: fadd 1, 28, 29
100 ; CHECK-NEXT: mtfsf 1, 0
101 ; CHECK-NEXT: lfs 0, .LCPI0_1@l(3)
102 ; CHECK-NEXT: fctiwz 1, 1
103 ; CHECK-NEXT: stfd 1, 152(1)
104 ; CHECK-NEXT: fcmpu 0, 28, 27
105 ; CHECK-NEXT: lwz 3, 164(1)
106 ; CHECK-NEXT: fcmpu 1, 29, 0
107 ; CHECK-NEXT: lwz 4, 156(1)
108 ; CHECK-NEXT: crandc 20, 6, 0
109 ; CHECK-NEXT: cror 20, 5, 20
110 ; CHECK-NEXT: addis 3, 3, -32768
111 ; CHECK-NEXT: bc 12, 20, .LBB0_4
112 ; CHECK-NEXT: # %bb.3: # %bb1
113 ; CHECK-NEXT: ori 30, 4, 0
114 ; CHECK-NEXT: b .LBB0_5
115 ; CHECK-NEXT: .LBB0_4: # %bb1
116 ; CHECK-NEXT: addi 30, 3, 0
117 ; CHECK-NEXT: .LBB0_5: # %bb1
118 ; CHECK-NEXT: li 4, 0
119 ; CHECK-NEXT: mr 3, 30
120 ; CHECK-NEXT: bl __floatditf
121 ; CHECK-NEXT: lis 3, 17392
122 ; CHECK-NEXT: stfd 1, 208(1)
123 ; CHECK-NEXT: fmr 29, 1
124 ; CHECK-NEXT: stw 3, 240(1)
125 ; CHECK-NEXT: fmr 28, 2
126 ; CHECK-NEXT: lwz 3, 212(1)
127 ; CHECK-NEXT: cmpwi 2, 30, 0
128 ; CHECK-NEXT: stfd 2, 200(1)
129 ; CHECK-NEXT: stw 3, 228(1)
130 ; CHECK-NEXT: lwz 3, 208(1)
131 ; CHECK-NEXT: stw 29, 244(1)
132 ; CHECK-NEXT: stw 3, 224(1)
133 ; CHECK-NEXT: lwz 3, 204(1)
134 ; CHECK-NEXT: stw 29, 236(1)
135 ; CHECK-NEXT: stw 3, 220(1)
136 ; CHECK-NEXT: lwz 3, 200(1)
137 ; CHECK-NEXT: stw 29, 232(1)
138 ; CHECK-NEXT: stw 3, 216(1)
139 ; CHECK-NEXT: lfd 3, 240(1)
140 ; CHECK-NEXT: lfd 4, 232(1)
141 ; CHECK-NEXT: lfd 1, 224(1)
142 ; CHECK-NEXT: lfd 2, 216(1)
143 ; CHECK-NEXT: bl __gcc_qadd
144 ; CHECK-NEXT: blt 2, .LBB0_7
145 ; CHECK-NEXT: # %bb.6: # %bb1
146 ; CHECK-NEXT: fmr 2, 28
147 ; CHECK-NEXT: .LBB0_7: # %bb1
148 ; CHECK-NEXT: blt 2, .LBB0_9
149 ; CHECK-NEXT: # %bb.8: # %bb1
150 ; CHECK-NEXT: fmr 1, 29
151 ; CHECK-NEXT: .LBB0_9: # %bb1
152 ; CHECK-NEXT: stfd 1, 184(1)
153 ; CHECK-NEXT: fmr 1, 31
154 ; CHECK-NEXT: lwz 3, 188(1)
155 ; CHECK-NEXT: stfd 2, 192(1)
156 ; CHECK-NEXT: fmr 2, 30
157 ; CHECK-NEXT: stw 3, 260(1)
158 ; CHECK-NEXT: lwz 3, 184(1)
159 ; CHECK-NEXT: stw 3, 256(1)
160 ; CHECK-NEXT: lwz 3, 196(1)
161 ; CHECK-NEXT: lfd 3, 256(1)
162 ; CHECK-NEXT: stw 3, 252(1)
163 ; CHECK-NEXT: lwz 3, 192(1)
164 ; CHECK-NEXT: stw 3, 248(1)
165 ; CHECK-NEXT: lfd 4, 248(1)
166 ; CHECK-NEXT: bl __gcc_qsub
167 ; CHECK-NEXT: stfd 2, 176(1)
168 ; CHECK-NEXT: fcmpu 1, 2, 27
169 ; CHECK-NEXT: lwz 3, 180(1)
170 ; CHECK-NEXT: fcmpu 0, 1, 27
171 ; CHECK-NEXT: stfd 1, 168(1)
172 ; CHECK-NEXT: crandc 20, 2, 4
173 ; CHECK-NEXT: stw 3, 268(1)
174 ; CHECK-NEXT: lwz 3, 176(1)
175 ; CHECK-NEXT: stw 3, 264(1)
176 ; CHECK-NEXT: lwz 3, 172(1)
177 ; CHECK-NEXT: lfd 30, 264(1)
178 ; CHECK-NEXT: stw 3, 276(1)
179 ; CHECK-NEXT: lwz 3, 168(1)
180 ; CHECK-NEXT: stw 3, 272(1)
181 ; CHECK-NEXT: lfd 31, 272(1)
182 ; CHECK-NEXT: bc 12, 20, .LBB0_14
183 ; CHECK-NEXT: # %bb.10: # %bb1
184 ; CHECK-NEXT: cror 20, 1, 3
185 ; CHECK-NEXT: bc 12, 20, .LBB0_14
186 ; CHECK-NEXT: # %bb.11: # %bb2
187 ; CHECK-NEXT: fneg 29, 31
188 ; CHECK-NEXT: stfd 29, 48(1)
189 ; CHECK-NEXT: lis 3, 16864
190 ; CHECK-NEXT: stw 3, 80(1)
191 ; CHECK-NEXT: fneg 28, 30
192 ; CHECK-NEXT: lwz 3, 52(1)
193 ; CHECK-NEXT: li 29, 0
194 ; CHECK-NEXT: stfd 28, 40(1)
195 ; CHECK-NEXT: stw 3, 68(1)
196 ; CHECK-NEXT: lwz 3, 48(1)
197 ; CHECK-NEXT: stw 29, 84(1)
198 ; CHECK-NEXT: stw 3, 64(1)
199 ; CHECK-NEXT: lwz 3, 44(1)
200 ; CHECK-NEXT: stw 29, 76(1)
201 ; CHECK-NEXT: stw 3, 60(1)
202 ; CHECK-NEXT: lwz 3, 40(1)
203 ; CHECK-NEXT: stw 29, 72(1)
204 ; CHECK-NEXT: stw 3, 56(1)
205 ; CHECK-NEXT: lfd 3, 80(1)
206 ; CHECK-NEXT: lfd 4, 72(1)
207 ; CHECK-NEXT: lfd 1, 64(1)
208 ; CHECK-NEXT: lfd 2, 56(1)
209 ; CHECK-NEXT: bl __gcc_qsub
211 ; CHECK-NEXT: mtfsb1 31
212 ; CHECK-NEXT: mtfsb0 30
213 ; CHECK-NEXT: fadd 1, 2, 1
214 ; CHECK-NEXT: mtfsf 1, 0
215 ; CHECK-NEXT: fctiwz 0, 1
216 ; CHECK-NEXT: stfd 0, 32(1)
218 ; CHECK-NEXT: mtfsb1 31
219 ; CHECK-NEXT: lis 3, .LCPI0_2@ha
220 ; CHECK-NEXT: lfs 2, .LCPI0_2@l(3)
221 ; CHECK-NEXT: mtfsb0 30
222 ; CHECK-NEXT: lis 3, .LCPI0_3@ha
223 ; CHECK-NEXT: fadd 1, 28, 29
224 ; CHECK-NEXT: mtfsf 1, 0
225 ; CHECK-NEXT: lfs 0, .LCPI0_3@l(3)
226 ; CHECK-NEXT: fctiwz 1, 1
227 ; CHECK-NEXT: stfd 1, 24(1)
228 ; CHECK-NEXT: fcmpu 0, 30, 2
229 ; CHECK-NEXT: lwz 3, 36(1)
230 ; CHECK-NEXT: fcmpu 1, 31, 0
231 ; CHECK-NEXT: lwz 4, 28(1)
232 ; CHECK-NEXT: crandc 20, 6, 1
233 ; CHECK-NEXT: cror 20, 4, 20
234 ; CHECK-NEXT: addis 3, 3, -32768
235 ; CHECK-NEXT: bc 12, 20, .LBB0_13
236 ; CHECK-NEXT: # %bb.12: # %bb2
237 ; CHECK-NEXT: ori 3, 4, 0
238 ; CHECK-NEXT: b .LBB0_13
239 ; CHECK-NEXT: .LBB0_13: # %bb2
240 ; CHECK-NEXT: subfic 4, 3, 0
241 ; CHECK-NEXT: subfe 3, 29, 30
242 ; CHECK-NEXT: b .LBB0_17
243 ; CHECK-NEXT: .LBB0_14: # %bb3
244 ; CHECK-NEXT: stfd 31, 112(1)
245 ; CHECK-NEXT: li 3, 0
246 ; CHECK-NEXT: stw 3, 148(1)
247 ; CHECK-NEXT: lis 4, 16864
248 ; CHECK-NEXT: stw 3, 140(1)
249 ; CHECK-NEXT: stw 3, 136(1)
250 ; CHECK-NEXT: lwz 3, 116(1)
251 ; CHECK-NEXT: stfd 30, 104(1)
252 ; CHECK-NEXT: stw 3, 132(1)
253 ; CHECK-NEXT: lwz 3, 112(1)
254 ; CHECK-NEXT: stw 4, 144(1)
255 ; CHECK-NEXT: stw 3, 128(1)
256 ; CHECK-NEXT: lwz 3, 108(1)
257 ; CHECK-NEXT: lfd 3, 144(1)
258 ; CHECK-NEXT: stw 3, 124(1)
259 ; CHECK-NEXT: lwz 3, 104(1)
260 ; CHECK-NEXT: lfd 4, 136(1)
261 ; CHECK-NEXT: stw 3, 120(1)
262 ; CHECK-NEXT: lfd 1, 128(1)
263 ; CHECK-NEXT: lfd 2, 120(1)
264 ; CHECK-NEXT: bl __gcc_qsub
266 ; CHECK-NEXT: mtfsb1 31
267 ; CHECK-NEXT: mtfsb0 30
268 ; CHECK-NEXT: fadd 1, 2, 1
269 ; CHECK-NEXT: mtfsf 1, 0
270 ; CHECK-NEXT: fctiwz 0, 1
271 ; CHECK-NEXT: stfd 0, 96(1)
273 ; CHECK-NEXT: mtfsb1 31
274 ; CHECK-NEXT: lis 3, .LCPI0_0@ha
275 ; CHECK-NEXT: lfs 1, .LCPI0_0@l(3)
276 ; CHECK-NEXT: mtfsb0 30
277 ; CHECK-NEXT: lis 3, .LCPI0_1@ha
278 ; CHECK-NEXT: fadd 2, 30, 31
279 ; CHECK-NEXT: mtfsf 1, 0
280 ; CHECK-NEXT: lfs 0, .LCPI0_1@l(3)
281 ; CHECK-NEXT: fctiwz 2, 2
282 ; CHECK-NEXT: stfd 2, 88(1)
283 ; CHECK-NEXT: fcmpu 0, 30, 1
284 ; CHECK-NEXT: lwz 3, 100(1)
285 ; CHECK-NEXT: fcmpu 1, 31, 0
286 ; CHECK-NEXT: lwz 4, 92(1)
287 ; CHECK-NEXT: crandc 20, 6, 0
288 ; CHECK-NEXT: cror 20, 5, 20
289 ; CHECK-NEXT: addis 3, 3, -32768
290 ; CHECK-NEXT: bc 12, 20, .LBB0_15
291 ; CHECK-NEXT: b .LBB0_16
292 ; CHECK-NEXT: .LBB0_15: # %bb3
293 ; CHECK-NEXT: addi 4, 3, 0
294 ; CHECK-NEXT: .LBB0_16: # %bb3
295 ; CHECK-NEXT: mr 3, 30
296 ; CHECK-NEXT: .LBB0_17: # %bb5
297 ; CHECK-NEXT: lfd 31, 456(1) # 8-byte Folded Reload
298 ; CHECK-NEXT: lfd 30, 448(1) # 8-byte Folded Reload
299 ; CHECK-NEXT: lfd 29, 440(1) # 8-byte Folded Reload
300 ; CHECK-NEXT: lfd 28, 432(1) # 8-byte Folded Reload
301 ; CHECK-NEXT: lwz 12, 408(1)
302 ; CHECK-NEXT: lfd 27, 424(1) # 8-byte Folded Reload
303 ; CHECK-NEXT: mtcrf 32, 12 # cr2
304 ; CHECK-NEXT: lwz 30, 416(1) # 4-byte Folded Reload
305 ; CHECK-NEXT: lwz 29, 412(1) # 4-byte Folded Reload
306 ; CHECK-NEXT: lwz 0, 468(1)
307 ; CHECK-NEXT: addi 1, 1, 464
311 %0 = fcmp olt ppc_fp128 %a, 0xM00000000000000000000000000000000 ; <i1> [#uses=1]
312 br i1 %0, label %bb5, label %bb1
314 bb1: ; preds = %entry
315 %1 = fmul ppc_fp128 %a, 0xM3DF00000000000000000000000000000 ; <ppc_fp128> [#uses=1]
316 %2 = fptoui ppc_fp128 %1 to i32 ; <i32> [#uses=1]
317 %3 = zext i32 %2 to i64 ; <i64> [#uses=1]
318 %4 = shl i64 %3, 32 ; <i64> [#uses=3]
319 %5 = uitofp i64 %4 to ppc_fp128 ; <ppc_fp128> [#uses=1]
320 %6 = fsub ppc_fp128 %a, %5 ; <ppc_fp128> [#uses=3]
321 %7 = fcmp olt ppc_fp128 %6, 0xM00000000000000000000000000000000 ; <i1> [#uses=1]
322 br i1 %7, label %bb2, label %bb3
325 %8 = fsub ppc_fp128 0xM80000000000000000000000000000000, %6 ; <ppc_fp128> [#uses=1]
326 %9 = fptoui ppc_fp128 %8 to i32 ; <i32> [#uses=1]
327 %10 = zext i32 %9 to i64 ; <i64> [#uses=1]
328 %11 = sub i64 %4, %10 ; <i64> [#uses=1]
332 %12 = fptoui ppc_fp128 %6 to i32 ; <i32> [#uses=1]
333 %13 = zext i32 %12 to i64 ; <i64> [#uses=1]
334 %14 = or i64 %13, %4 ; <i64> [#uses=1]
337 bb5: ; preds = %entry