summaryrefslogtreecommitdiff
path: root/asm/MSL_C.PPCEABI.bare.H/ansi_fp.s
blob: 641a10fafefe1c431e9811d1568f9a56e5f4b1ed (plain)
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
340
341
342
343
.include "macros.inc"

.section .text, "ax"  # 0x80005600 - 0x8036FBA0
.global __num2dec
__num2dec:
/* 800833A4 000802E4  7C 08 02 A6 */	mflr r0
/* 800833A8 000802E8  90 01 00 04 */	stw r0, 4(r1)
/* 800833AC 000802EC  94 21 FF 98 */	stwu r1, -0x68(r1)
/* 800833B0 000802F0  DB E1 00 60 */	stfd f31, 0x60(r1)
/* 800833B4 000802F4  FF E0 08 90 */	fmr f31, f1
/* 800833B8 000802F8  93 E1 00 5C */	stw r31, 0x5c(r1)
/* 800833BC 000802FC  93 C1 00 58 */	stw r30, 0x58(r1)
/* 800833C0 00080300  3B C4 00 00 */	addi r30, r4, 0
/* 800833C4 00080304  93 A1 00 54 */	stw r29, 0x54(r1)
/* 800833C8 00080308  7C 7D 1B 78 */	mr r29, r3
/* 800833CC 0008030C  A8 03 00 02 */	lha r0, 2(r3)
/* 800833D0 00080310  2C 00 00 10 */	cmpwi r0, 0x10
/* 800833D4 00080314  7C 1F 03 78 */	mr r31, r0
/* 800833D8 00080318  40 81 00 08 */	ble lbl_800833E0
/* 800833DC 0008031C  3B E0 00 10 */	li r31, 0x10
lbl_800833E0:
/* 800833E0 00080320  38 60 00 00 */	li r3, 0
/* 800833E4 00080324  98 7E 00 00 */	stb r3, 0(r30)
/* 800833E8 00080328  38 00 00 01 */	li r0, 1
/* 800833EC 0008032C  B0 7E 00 02 */	sth r3, 2(r30)
/* 800833F0 00080330  98 1E 00 04 */	stb r0, 4(r30)
/* 800833F4 00080334  C8 02 89 58 */	lfd f0, "@268"@sda21(r2)
/* 800833F8 00080338  FC 00 F8 00 */	fcmpu cr0, f0, f31
/* 800833FC 0008033C  40 82 00 10 */	bne lbl_8008340C
/* 80083400 00080340  38 00 00 30 */	li r0, 0x30
/* 80083404 00080344  98 1E 00 05 */	stb r0, 5(r30)
/* 80083408 00080348  48 00 03 30 */	b lbl_80083738
lbl_8008340C:
/* 8008340C 0008034C  DB E1 00 28 */	stfd f31, 0x28(r1)
/* 80083410 00080350  3C 00 7F F0 */	lis r0, 0x7ff0
/* 80083414 00080354  80 81 00 28 */	lwz r4, 0x28(r1)
/* 80083418 00080358  54 83 00 56 */	rlwinm r3, r4, 0, 1, 0xb
/* 8008341C 0008035C  7C 03 00 00 */	cmpw r3, r0
/* 80083420 00080360  41 82 00 14 */	beq lbl_80083434
/* 80083424 00080364  40 80 00 58 */	bge lbl_8008347C
/* 80083428 00080368  2C 03 00 00 */	cmpwi r3, 0
/* 8008342C 0008036C  41 82 00 2C */	beq lbl_80083458
/* 80083430 00080370  48 00 00 4C */	b lbl_8008347C
lbl_80083434:
/* 80083434 00080374  54 80 03 3F */	clrlwi. r0, r4, 0xc
/* 80083438 00080378  40 82 00 10 */	bne lbl_80083448
/* 8008343C 0008037C  80 01 00 2C */	lwz r0, 0x2c(r1)
/* 80083440 00080380  2C 00 00 00 */	cmpwi r0, 0
/* 80083444 00080384  41 82 00 0C */	beq lbl_80083450
lbl_80083448:
/* 80083448 00080388  38 00 00 01 */	li r0, 1
/* 8008344C 0008038C  48 00 00 34 */	b lbl_80083480
lbl_80083450:
/* 80083450 00080390  38 00 00 02 */	li r0, 2
/* 80083454 00080394  48 00 00 2C */	b lbl_80083480
lbl_80083458:
/* 80083458 00080398  54 80 03 3F */	clrlwi. r0, r4, 0xc
/* 8008345C 0008039C  40 82 00 10 */	bne lbl_8008346C
/* 80083460 000803A0  80 01 00 2C */	lwz r0, 0x2c(r1)
/* 80083464 000803A4  2C 00 00 00 */	cmpwi r0, 0
/* 80083468 000803A8  41 82 00 0C */	beq lbl_80083474
lbl_8008346C:
/* 8008346C 000803AC  38 00 00 05 */	li r0, 5
/* 80083470 000803B0  48 00 00 10 */	b lbl_80083480
lbl_80083474:
/* 80083474 000803B4  38 00 00 03 */	li r0, 3
/* 80083478 000803B8  48 00 00 08 */	b lbl_80083480
lbl_8008347C:
/* 8008347C 000803BC  38 00 00 04 */	li r0, 4
lbl_80083480:
/* 80083480 000803C0  2C 00 00 02 */	cmpwi r0, 2
/* 80083484 000803C4  41 81 00 94 */	bgt lbl_80083518
/* 80083488 000803C8  DB E1 00 20 */	stfd f31, 0x20(r1)
/* 8008348C 000803CC  3C 00 7F F0 */	lis r0, 0x7ff0
/* 80083490 000803D0  80 81 00 20 */	lwz r4, 0x20(r1)
/* 80083494 000803D4  54 83 00 56 */	rlwinm r3, r4, 0, 1, 0xb
/* 80083498 000803D8  7C 03 00 00 */	cmpw r3, r0
/* 8008349C 000803DC  41 82 00 14 */	beq lbl_800834B0
/* 800834A0 000803E0  40 80 00 58 */	bge lbl_800834F8
/* 800834A4 000803E4  2C 03 00 00 */	cmpwi r3, 0
/* 800834A8 000803E8  41 82 00 2C */	beq lbl_800834D4
/* 800834AC 000803EC  48 00 00 4C */	b lbl_800834F8
lbl_800834B0:
/* 800834B0 000803F0  54 80 03 3F */	clrlwi. r0, r4, 0xc
/* 800834B4 000803F4  40 82 00 10 */	bne lbl_800834C4
/* 800834B8 000803F8  80 01 00 24 */	lwz r0, 0x24(r1)
/* 800834BC 000803FC  2C 00 00 00 */	cmpwi r0, 0
/* 800834C0 00080400  41 82 00 0C */	beq lbl_800834CC
lbl_800834C4:
/* 800834C4 00080404  38 00 00 01 */	li r0, 1
/* 800834C8 00080408  48 00 00 34 */	b lbl_800834FC
lbl_800834CC:
/* 800834CC 0008040C  38 00 00 02 */	li r0, 2
/* 800834D0 00080410  48 00 00 2C */	b lbl_800834FC
lbl_800834D4:
/* 800834D4 00080414  54 80 03 3F */	clrlwi. r0, r4, 0xc
/* 800834D8 00080418  40 82 00 10 */	bne lbl_800834E8
/* 800834DC 0008041C  80 01 00 24 */	lwz r0, 0x24(r1)
/* 800834E0 00080420  2C 00 00 00 */	cmpwi r0, 0
/* 800834E4 00080424  41 82 00 0C */	beq lbl_800834F0
lbl_800834E8:
/* 800834E8 00080428  38 00 00 05 */	li r0, 5
/* 800834EC 0008042C  48 00 00 10 */	b lbl_800834FC
lbl_800834F0:
/* 800834F0 00080430  38 00 00 03 */	li r0, 3
/* 800834F4 00080434  48 00 00 08 */	b lbl_800834FC
lbl_800834F8:
/* 800834F8 00080438  38 00 00 04 */	li r0, 4
lbl_800834FC:
/* 800834FC 0008043C  2C 00 00 01 */	cmpwi r0, 1
/* 80083500 00080440  40 82 00 0C */	bne lbl_8008350C
/* 80083504 00080444  38 00 00 4E */	li r0, 0x4e
/* 80083508 00080448  48 00 00 08 */	b lbl_80083510
lbl_8008350C:
/* 8008350C 0008044C  38 00 00 49 */	li r0, 0x49
lbl_80083510:
/* 80083510 00080450  98 1E 00 05 */	stb r0, 5(r30)
/* 80083514 00080454  48 00 02 24 */	b lbl_80083738
lbl_80083518:
/* 80083518 00080458  38 00 00 00 */	li r0, 0
/* 8008351C 0008045C  98 1E 00 04 */	stb r0, 4(r30)
/* 80083520 00080460  C8 02 89 58 */	lfd f0, "@268"@sda21(r2)
/* 80083524 00080464  FC 1F 00 40 */	fcmpo cr0, f31, f0
/* 80083528 00080468  40 80 00 10 */	bge lbl_80083538
/* 8008352C 0008046C  38 00 00 01 */	li r0, 1
/* 80083530 00080470  FF E0 F8 50 */	fneg f31, f31
/* 80083534 00080474  98 1E 00 00 */	stb r0, 0(r30)
lbl_80083538:
/* 80083538 00080478  FC 20 F8 90 */	fmr f1, f31
/* 8008353C 0008047C  38 61 00 30 */	addi r3, r1, 0x30
/* 80083540 00080480  48 00 35 49 */	bl frexp
/* 80083544 00080484  3C 60 00 05 */	lis r3, 0x000497E5@ha
/* 80083548 00080488  80 81 00 30 */	lwz r4, 0x30(r1)
/* 8008354C 0008048C  38 03 97 E5 */	addi r0, r3, 0x000497E5@l
/* 80083550 00080490  7C 04 01 D6 */	mullw r0, r4, r0
/* 80083554 00080494  3C 60 43 1C */	lis r3, 0x431BDE83@ha
/* 80083558 00080498  38 63 DE 83 */	addi r3, r3, 0x431BDE83@l
/* 8008355C 0008049C  7C 03 00 96 */	mulhw r0, r3, r0
/* 80083560 000804A0  7C 00 96 70 */	srawi r0, r0, 0x12
/* 80083564 000804A4  54 03 0F FE */	srwi r3, r0, 0x1f
/* 80083568 000804A8  7C 80 1A 15 */	add. r4, r0, r3
/* 8008356C 000804AC  3C 60 80 37 */	lis r3, bit_values@ha
/* 80083570 000804B0  38 03 15 98 */	addi r0, r3, bit_values@l
/* 80083574 000804B4  38 64 00 00 */	addi r3, r4, 0
/* 80083578 000804B8  7C 05 03 78 */	mr r5, r0
/* 8008357C 000804BC  40 80 00 30 */	bge lbl_800835AC
/* 80083580 000804C0  7C 84 00 D0 */	neg r4, r4
/* 80083584 000804C4  48 00 00 1C */	b lbl_800835A0
lbl_80083588:
/* 80083588 000804C8  54 80 07 FF */	clrlwi. r0, r4, 0x1f
/* 8008358C 000804CC  41 82 00 0C */	beq lbl_80083598
/* 80083590 000804D0  C8 05 00 00 */	lfd f0, 0(r5)
/* 80083594 000804D4  FF FF 00 32 */	fmul f31, f31, f0
lbl_80083598:
/* 80083598 000804D8  7C 84 0E 70 */	srawi r4, r4, 1
/* 8008359C 000804DC  38 A5 00 08 */	addi r5, r5, 8
lbl_800835A0:
/* 800835A0 000804E0  2C 04 00 00 */	cmpwi r4, 0
/* 800835A4 000804E4  40 82 FF E4 */	bne lbl_80083588
/* 800835A8 000804E8  48 00 00 34 */	b lbl_800835DC
lbl_800835AC:
/* 800835AC 000804EC  40 81 00 30 */	ble lbl_800835DC
/* 800835B0 000804F0  C8 22 89 60 */	lfd f1, "@270"@sda21(r2)
/* 800835B4 000804F4  48 00 00 1C */	b lbl_800835D0
lbl_800835B8:
/* 800835B8 000804F8  54 80 07 FF */	clrlwi. r0, r4, 0x1f
/* 800835BC 000804FC  41 82 00 0C */	beq lbl_800835C8
/* 800835C0 00080500  C8 05 00 00 */	lfd f0, 0(r5)
/* 800835C4 00080504  FC 21 00 32 */	fmul f1, f1, f0
lbl_800835C8:
/* 800835C8 00080508  7C 84 0E 70 */	srawi r4, r4, 1
/* 800835CC 0008050C  38 A5 00 08 */	addi r5, r5, 8
lbl_800835D0:
/* 800835D0 00080510  2C 04 00 00 */	cmpwi r4, 0
/* 800835D4 00080514  40 82 FF E4 */	bne lbl_800835B8
/* 800835D8 00080518  FF FF 08 24 */	fdiv f31, f31, f1
lbl_800835DC:
/* 800835DC 0008051C  C8 22 89 70 */	lfd f1, "@362"@sda21(r2)
/* 800835E0 00080520  C8 02 89 60 */	lfd f0, "@270"@sda21(r2)
/* 800835E4 00080524  48 00 00 0C */	b lbl_800835F0
lbl_800835E8:
/* 800835E8 00080528  FF FF 00 72 */	fmul f31, f31, f1
/* 800835EC 0008052C  38 63 00 01 */	addi r3, r3, 1
lbl_800835F0:
/* 800835F0 00080530  FC 1F 00 40 */	fcmpo cr0, f31, f0
/* 800835F4 00080534  4C 41 13 82 */	cror 2, 1, 2
/* 800835F8 00080538  41 82 FF F0 */	beq lbl_800835E8
/* 800835FC 0008053C  C8 22 89 78 */	lfd f1, "@363"@sda21(r2)
/* 80083600 00080540  C8 02 89 70 */	lfd f0, "@362"@sda21(r2)
/* 80083604 00080544  48 00 00 0C */	b lbl_80083610
lbl_80083608:
/* 80083608 00080548  FF FF 00 72 */	fmul f31, f31, f1
/* 8008360C 0008054C  38 63 FF FF */	addi r3, r3, -1
lbl_80083610:
/* 80083610 00080550  FC 1F 00 40 */	fcmpo cr0, f31, f0
/* 80083614 00080554  41 80 FF F4 */	blt lbl_80083608
/* 80083618 00080558  3C A0 66 66 */	lis r5, 0x66666667@ha
/* 8008361C 0008055C  C8 22 89 68 */	lfd f1, "@272"@sda21(r2)
/* 80083620 00080560  3C C0 80 37 */	lis r6, digit_values@ha
/* 80083624 00080564  38 9E 00 05 */	addi r4, r30, 5
/* 80083628 00080568  38 E5 66 67 */	addi r7, r5, 0x66666667@l
/* 8008362C 0008056C  39 46 15 E0 */	addi r10, r6, digit_values@l
/* 80083630 00080570  3D 20 43 30 */	lis r9, 0x4330
/* 80083634 00080574  48 00 00 AC */	b lbl_800836E0
lbl_80083638:
/* 80083638 00080578  2C 1F 00 08 */	cmpwi r31, 8
/* 8008363C 0008057C  39 9F 00 00 */	addi r12, r31, 0
/* 80083640 00080580  40 81 00 08 */	ble lbl_80083648
/* 80083644 00080584  39 80 00 08 */	li r12, 8
lbl_80083648:
/* 80083648 00080588  88 DE 00 04 */	lbz r6, 4(r30)
/* 8008364C 0008058C  55 80 18 38 */	slwi r0, r12, 3
/* 80083650 00080590  7C AA 02 14 */	add r5, r10, r0
/* 80083654 00080594  7C 06 62 14 */	add r0, r6, r12
/* 80083658 00080598  98 1E 00 04 */	stb r0, 4(r30)
/* 8008365C 0008059C  7F EC F8 50 */	subf r31, r12, r31
/* 80083660 000805A0  7C 6C 18 50 */	subf r3, r12, r3
/* 80083664 000805A4  C8 05 FF F8 */	lfd f0, -8(r5)
/* 80083668 000805A8  7C 84 62 14 */	add r4, r4, r12
/* 8008366C 000805AC  39 6C 00 01 */	addi r11, r12, 1
/* 80083670 000805B0  FF FF 00 32 */	fmul f31, f31, f0
/* 80083674 000805B4  FC 00 F8 1E */	fctiwz f0, f31
/* 80083678 000805B8  D8 01 00 40 */	stfd f0, 0x40(r1)
/* 8008367C 000805BC  80 01 00 44 */	lwz r0, 0x44(r1)
/* 80083680 000805C0  D8 01 00 48 */	stfd f0, 0x48(r1)
/* 80083684 000805C4  6C 00 80 00 */	xoris r0, r0, 0x8000
/* 80083688 000805C8  90 01 00 3C */	stw r0, 0x3c(r1)
/* 8008368C 000805CC  80 C1 00 4C */	lwz r6, 0x4c(r1)
/* 80083690 000805D0  91 21 00 38 */	stw r9, 0x38(r1)
/* 80083694 000805D4  C8 01 00 38 */	lfd f0, 0x38(r1)
/* 80083698 000805D8  FC 00 08 28 */	fsub f0, f0, f1
/* 8008369C 000805DC  FF FF 00 28 */	fsub f31, f31, f0
/* 800836A0 000805E0  48 00 00 34 */	b lbl_800836D4
lbl_800836A4:
/* 800836A4 000805E4  7D 07 30 96 */	mulhw r8, r7, r6
/* 800836A8 000805E8  7D 00 16 70 */	srawi r0, r8, 2
/* 800836AC 000805EC  54 05 0F FE */	srwi r5, r0, 0x1f
/* 800836B0 000805F0  7C 00 2A 14 */	add r0, r0, r5
/* 800836B4 000805F4  1C 00 00 0A */	mulli r0, r0, 0xa
/* 800836B8 000805F8  7C C0 30 50 */	subf r6, r0, r6
/* 800836BC 000805FC  7D 00 16 70 */	srawi r0, r8, 2
/* 800836C0 00080600  38 C6 00 30 */	addi r6, r6, 0x30
/* 800836C4 00080604  98 C4 FF FF */	stb r6, -1(r4)
/* 800836C8 00080608  54 05 0F FE */	srwi r5, r0, 0x1f
/* 800836CC 0008060C  7C C0 2A 14 */	add r6, r0, r5
/* 800836D0 00080610  38 84 FF FF */	addi r4, r4, -1
lbl_800836D4:
/* 800836D4 00080614  35 6B FF FF */	addic. r11, r11, -1
/* 800836D8 00080618  40 82 FF CC */	bne lbl_800836A4
/* 800836DC 0008061C  7C 84 62 14 */	add r4, r4, r12
lbl_800836E0:
/* 800836E0 00080620  2C 1F 00 00 */	cmpwi r31, 0
/* 800836E4 00080624  40 82 FF 54 */	bne lbl_80083638
/* 800836E8 00080628  A8 BD 00 02 */	lha r5, 2(r29)
/* 800836EC 0008062C  2C 05 00 24 */	cmpwi r5, 0x24
/* 800836F0 00080630  40 81 00 08 */	ble lbl_800836F8
/* 800836F4 00080634  38 A0 00 24 */	li r5, 0x24
lbl_800836F8:
/* 800836F8 00080638  88 1E 00 04 */	lbz r0, 4(r30)
/* 800836FC 0008063C  7C A0 28 51 */	subf. r5, r0, r5
/* 80083700 00080640  40 81 00 30 */	ble lbl_80083730
/* 80083704 00080644  38 C5 00 01 */	addi r6, r5, 1
/* 80083708 00080648  38 00 00 30 */	li r0, 0x30
/* 8008370C 0008064C  48 00 00 0C */	b lbl_80083718
lbl_80083710:
/* 80083710 00080650  98 04 00 00 */	stb r0, 0(r4)
/* 80083714 00080654  38 84 00 01 */	addi r4, r4, 1
lbl_80083718:
/* 80083718 00080658  34 C6 FF FF */	addic. r6, r6, -1
/* 8008371C 0008065C  40 82 FF F4 */	bne lbl_80083710
/* 80083720 00080660  88 1E 00 04 */	lbz r0, 4(r30)
/* 80083724 00080664  7C 65 18 50 */	subf r3, r5, r3
/* 80083728 00080668  7C 00 2A 14 */	add r0, r0, r5
/* 8008372C 0008066C  98 1E 00 04 */	stb r0, 4(r30)
lbl_80083730:
/* 80083730 00080670  7C 60 07 34 */	extsh r0, r3
/* 80083734 00080674  B0 1E 00 02 */	sth r0, 2(r30)
lbl_80083738:
/* 80083738 00080678  80 01 00 6C */	lwz r0, 0x6c(r1)
/* 8008373C 0008067C  CB E1 00 60 */	lfd f31, 0x60(r1)
/* 80083740 00080680  83 E1 00 5C */	lwz r31, 0x5c(r1)
/* 80083744 00080684  7C 08 03 A6 */	mtlr r0
/* 80083748 00080688  83 C1 00 58 */	lwz r30, 0x58(r1)
/* 8008374C 0008068C  83 A1 00 54 */	lwz r29, 0x54(r1)
/* 80083750 00080690  38 21 00 68 */	addi r1, r1, 0x68
/* 80083754 00080694  4E 80 00 20 */	blr 

.section .rodata, "a"  # 0x8036FFA0 - 0x803A8380
.balign 8
bit_values:
	.4byte 0x40240000
	.4byte 0
	.4byte 0x40590000
	.4byte 0
	.4byte 0x40C38800
	.4byte 0
	.4byte 0x4197D784
	.4byte 0
	.4byte 0x4341C379
	.4byte 0x37E08000
	.4byte 0x4693B8B5
	.4byte 0xB5056E17
	.4byte 0x4D384F03
	.4byte 0xE93FF9F5
	.4byte 0x5A827748
	.4byte 0xF9301D32
	.4byte 0x75154FDD
	.4byte 0x7F73BF3C
digit_values:
	.4byte 0x40240000
	.4byte 0
	.4byte 0x40590000
	.4byte 0
	.4byte 0x408F4000
	.4byte 0
	.4byte 0x40C38800
	.4byte 0
	.4byte 0x40F86A00
	.4byte 0
	.4byte 0x412E8480
	.4byte 0
	.4byte 0x416312D0
	.4byte 0
	.4byte 0x4197D784
	.4byte 0

.section .sdata2, "a"  # 0x8040B460 - 0x80414020
.balign 8
"@268":
  .4byte 0
  .4byte 0
"@270":
	.4byte 0x3FF00000
	.4byte 0
"@272":
	.4byte 0x43300000
	.4byte 0x80000000
"@362":
	.4byte 0x3FB99999
	.4byte 0x9999999A
"@363":
	.4byte 0x40240000
	.4byte 0