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