.include "macros.inc"
.section .text, "ax"
.global atanf
atanf:
stwu r1, -0x10(r1)
lis r3, atan_coeff$96@ha
addi r4, r3, atan_coeff$96@l
stfs f1, 8(r1)
li r6, -1
lfs f0, "@156"@sda21(r2)
li r7, 0
lwz r3, 8(r1)
clrlwi r0, r3, 1
stw r0, 8(r1)
rlwinm r8, r3, 0, 0, 0
lfs f2, 8(r1)
fcmpo cr0, f2, f0
cror 2, 1, 2
bne lbl_80086B9C
lfs f0, "@157"@sda21(r2)
li r7, 1
fdivs f0, f0, f2
stfs f0, 0xc(r1)
b lbl_80086C8C
lbl_80086B9C:
lfs f0, "@158"@sda21(r2)
fcmpo cr0, f0, f2
bge lbl_80086C88
lwz r5, 8(r1)
lis r0, 0x3f80
li r6, 0
rlwinm r3, r5, 0, 1, 8
cmpw r3, r0
beq lbl_80086C10
bge lbl_80086BD4
lis r0, 0x3f00
cmpw r3, r0
beq lbl_80086BE4
b lbl_80086C44
lbl_80086BD4:
lis r0, 0x4000
cmpw r3, r0
beq lbl_80086C40
b lbl_80086C44
lbl_80086BE4:
lis r3, 0x3F08D5B9@ha
addi r0, r3, 0x3F08D5B9@l
cmpw r5, r0
blt lbl_80086BF8
li r6, 1
lbl_80086BF8:
lis r3, 0x3F521801@ha
addi r0, r3, 0x3F521801@l
cmpw r5, r0
blt lbl_80086C44
addi r6, r6, 1
b lbl_80086C44
lbl_80086C10:
lis r3, 0x3F9BF7EC@ha
addi r0, r3, 0x3F9BF7EC@l
cmpw r5, r0
li r6, 2
blt lbl_80086C28
li r6, 3
lbl_80086C28:
lis r3, 0x3FEF789E@ha
addi r0, r3, 0x3FEF789E@l
cmpw r5, r0
blt lbl_80086C44
addi r6, r6, 1
b lbl_80086C44
lbl_80086C40:
li r6, 4
lbl_80086C44:
slwi r0, r6, 2
lfs f1, "@157"@sda21(r2)
add r3, r4, r0
lfs f3, 0x9c(r3)
lfs f4, 0x84(r3)
fadds f0, f2, f3
fadds f0, f4, f0
fdivs f0, f1, f0
stfs f0, 0xc(r1)
lfs f2, 0xc(r1)
lfs f1, 0x1c(r3)
lfs f0, 0x34(r3)
fnmsubs f1, f2, f1, f4
fnmsubs f0, f2, f0, f3
fadds f0, f1, f0
stfs f0, 0xc(r1)
b lbl_80086C8C
lbl_80086C88:
stfs f2, 0xc(r1)
lbl_80086C8C:
lfs f5, 0xc(r1)
slwi r0, r6, 2
lfs f2, 0x18(r4)
add r3, r4, r0
fmuls f6, f5, f5
lfs f1, 0x14(r4)
cmpwi r7, 0
lfs f0, 0x10(r4)
fmadds f3, f6, f2, f1
lfs f2, 0xc(r4)
fmuls f4, f5, f6
lfs f1, 8(r4)
fmadds f3, f6, f3, f0
lfs f0, 4(r4)
fmadds f2, f6, f3, f2
fmadds f1, f6, f2, f1
fmadds f0, f6, f1, f0
fmadds f0, f4, f0, f5
stfs f0, 0xc(r1)
lfs f1, 0xc(r1)
lfs f0, 0x6c(r3)
fadds f0, f1, f0
stfs f0, 0xc(r1)
lfs f1, 0xc(r1)
lfs f0, 0x50(r3)
fadds f0, f1, f0
stfs f0, 0xc(r1)
beq lbl_80086D28
lfs f1, 0xc(r1)
cmpwi r8, 0
lfs f0, "@159"@sda21(r2)
fsubs f0, f1, f0
stfs f0, 0xc(r1)
beq lbl_80086D1C
lfs f1, 0xc(r1)
b lbl_80086D38
lbl_80086D1C:
lfs f0, 0xc(r1)
fneg f1, f0
b lbl_80086D38
lbl_80086D28:
lwz r0, 0xc(r1)
or r0, r0, r8
stw r0, 0xc(r1)
lfs f1, 0xc(r1)
lbl_80086D38:
addi r1, r1, 0x10
blr
.global atan__Ff
atan__Ff:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
bl atanf
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global _inv_sqrtf
_inv_sqrtf:
lfs f0, "@168"@sda21(r2)
fcmpo cr0, f1, f0
ble lbl_80086DB0
frsqrte f2, f1
lfs f4, "@169"@sda21(r2)
lfs f3, "@170"@sda21(r2)
frsp f2, f2
fmuls f0, f2, f2
fmuls f2, f4, f2
fnmsubs f0, f1, f0, f3
fmuls f2, f2, f0
fmuls f0, f2, f2
fmuls f2, f4, f2
fnmsubs f0, f1, f0, f3
fmuls f2, f2, f0
fmuls f0, f2, f2
fmuls f2, f4, f2
fnmsubs f0, f1, f0, f3
fmuls f1, f2, f0
blr
lbl_80086DB0:
fcmpu cr0, f1, f0
beq lbl_80086DC4
lis r3, __float_nan@ha
lfs f1, __float_nan@l(r3)
blr
lbl_80086DC4:
lis r3, __float_huge@ha
lfs f1, __float_huge@l(r3)
blr
.global acosf
acosf:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stfd f31, 0x10(r1)
fmr f31, f1
lfs f0, "@157"@sda21(r2)
fnmsubs f1, f31, f31, f0
bl _inv_sqrtf
fmuls f1, f31, f1
bl atan__Ff
lfs f0, "@159"@sda21(r2)
lwz r0, 0x1c(r1)
fsubs f1, f0, f1
lfd f31, 0x10(r1)
mtlr r0
addi r1, r1, 0x18
blr
.global atan2f
atan2f:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stfs f1, 8(r1)
stfs f2, 0xc(r1)
lwz r0, 8(r1)
lwz r3, 0xc(r1)
rlwinm r4, r0, 0, 0, 0
rlwinm r0, r3, 0, 0, 0
cmpw r0, r4
bne lbl_80086E8C
cmpwi r0, 0
beq lbl_80086E64
lfs f1, 8(r1)
lfs f0, 0xc(r1)
fdivs f1, f1, f0
bl atanf
lfs f0, "@188"@sda21(r2)
fsubs f1, f1, f0
b lbl_80086EDC
lbl_80086E64:
lfs f1, 0xc(r1)
lfs f0, "@168"@sda21(r2)
fcmpu cr0, f1, f0
beq lbl_80086E84
lfs f0, 8(r1)
fdivs f1, f0, f1
bl atanf
b lbl_80086EDC
lbl_80086E84:
lfs f1, "@159"@sda21(r2)
b lbl_80086EDC
lbl_80086E8C:
lfs f1, 0xc(r1)
lfs f0, "@168"@sda21(r2)
fcmpo cr0, f1, f0
bge lbl_80086EB4
lfs f0, 8(r1)
fdivs f1, f0, f1
bl atanf
lfs f0, "@188"@sda21(r2)
fadds f1, f0, f1
b lbl_80086EDC
lbl_80086EB4:
fcmpu cr0, f1, f0
beq lbl_80086ECC
lfs f0, 8(r1)
fdivs f1, f0, f1
bl atanf
b lbl_80086EDC
lbl_80086ECC:
addis r3, r4, 0x3fc9
addi r0, r3, 0xfdb
stw r0, 8(r1)
lfs f1, 8(r1)
lbl_80086EDC:
lwz r0, 0x14(r1)
addi r1, r1, 0x10
mtlr r0
blr
.section .rodata, "a"
.balign 8
atan_coeff$96:
.4byte 0x3F800000
.4byte 0xBEAAAAAA
.4byte 0x3E4CCC81
.4byte 0xBE123E7D
.4byte 0x3DE21F95
.4byte 0xBDAD417C
.4byte 0x3D41186D
onep_one_over_xisqr_hi$97:
.4byte 0x40DA826B
.asciz "@OYX@"
.balign 4
.4byte 0x3FB925AB
.4byte 0x3F95F61A
.4byte 0x3F851081
onep_one_over_xisqr_lo$98:
.4byte 0x36EF692F
.4byte 0x355C1DF9
.4byte 0
.4byte 0x35291D45
.4byte 0
.4byte 0
atan_xi_hi$99:
.4byte 0
.4byte 0x3EC90EAA
.4byte 0x3F16CBE4
.4byte 0x3F490FDA
.4byte 0x3F7B53C5
.4byte 0x3F96CBE2
.4byte 0x3FAFEDD9
atan_xi_lo$100:
.4byte 0
.4byte 0x37185D99
.4byte 0x32C59189
.4byte 0x33874A9E
.4byte 0x353CFA83
.4byte 0x348637BD
.4byte 0x35541063
one_over_xi_hi$101:
.4byte 0x401A8277
.4byte 0x3FBF90C7
.4byte 0x3F800000
.4byte 0x3F2B0DC1
.4byte 0x3ED413CD
.4byte 0x3E4BAFAF
one_over_xi_lo$102:
.4byte 0x3516DC59
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.section .sdata2, "a"
.balign 8
"@156":
.4byte 0x401A827A
"@157":
.4byte 0x3F800000
"@158":
.4byte 0x3ED413CD
"@159":
.4byte 0x3FC90FDB
"@168":
.4byte 0
"@169":
.4byte 0x3F000000
"@170":
.4byte 0x40400000
"@188":
.4byte 0x40490FDB