.include "macros.inc"
.section .text, "ax"
.global cos__Ff
cos__Ff:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
bl cosf
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global sin__Ff
sin__Ff:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
bl sinf
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global tanf
tanf:
mflr r0
stw r0, 4(r1)
stwu r1, -0x20(r1)
stfd f31, 0x18(r1)
stfd f30, 0x10(r1)
fmr f30, f1
bl cos__Ff
fmr f31, f1
fmr f1, f30
bl sin__Ff
fdivs f1, f1, f31
lwz r0, 0x24(r1)
lfd f31, 0x18(r1)
lfd f30, 0x10(r1)
mtlr r0
addi r1, r1, 0x20
blr
.global sinf
sinf:
mflr r0
lis r3, __four_over_pi_m1@ha
stw r0, 4(r1)
addi r3, r3, __four_over_pi_m1@l
stwu r1, -0x28(r1)
stfd f31, 0x20(r1)
stw r31, 0x1c(r1)
stfs f1, 8(r1)
lfs f0, "@106"@sda21(r2)
lwz r0, 8(r1)
lfs f6, 8(r1)
rlwinm. r0, r0, 0, 0, 0
fmuls f1, f0, f6
beq lbl_80087154
lfs f0, "@107"@sda21(r2)
fsubs f0, f1, f0
fctiwz f0, f0
stfd f0, 0x10(r1)
lwz r4, 0x14(r1)
b lbl_80087168
lbl_80087154:
lfs f0, "@107"@sda21(r2)
fadds f0, f0, f1
fctiwz f0, f0
stfd f0, 0x10(r1)
lwz r4, 0x14(r1)
lbl_80087168:
slwi r0, r4, 1
lfd f1, "@110"@sda21(r2)
xoris r0, r0, 0x8000
lfs f2, 0(r3)
stw r0, 0x14(r1)
lis r0, 0x4330
lfs f3, 4(r3)
clrlwi r31, r4, 0x1e
stw r0, 0x10(r1)
lfs f4, 8(r3)
lfd f0, 0x10(r1)
lfs f5, 0xc(r3)
fsubs f0, f0, f1
fsubs f0, f6, f0
fmadds f0, f2, f6, f0
fmadds f0, f3, f6, f0
fmadds f0, f4, f6, f0
fmadds f31, f5, f6, f0
fmr f1, f31
bl fabsf__Ff
lfs f0, "@108"@sda21(r2)
fcmpo cr0, f1, f0
bge lbl_800871F4
lis r3, __sincos_on_quadrant@ha
slwi r4, r31, 3
addi r0, r3, __sincos_on_quadrant@l
add r3, r0, r4
lfs f1, 4(r3)
lis r4, __sincos_poly@ha
addi r4, r4, __sincos_poly@l
lfs f0, 0(r3)
fmuls f1, f31, f1
lfs f2, 0x24(r4)
fmadds f1, f2, f1, f0
b lbl_80087290
lbl_800871F4:
clrlwi. r0, r31, 0x1f
fmuls f4, f31, f31
beq lbl_80087248
lis r3, __sincos_poly@ha
addi r4, r3, __sincos_poly@l
lfs f2, 0(r4)
lis r3, __sincos_on_quadrant@ha
lfs f1, 8(r4)
addi r0, r3, __sincos_on_quadrant@l
lfs f0, 0x10(r4)
fmadds f3, f2, f4, f1
lfs f2, 0x18(r4)
lfs f1, 0x20(r4)
slwi r4, r31, 3
add r3, r0, r4
fmadds f3, f4, f3, f0
lfs f0, 0(r3)
fmadds f2, f4, f3, f2
fmadds f1, f4, f2, f1
fmuls f1, f1, f0
b lbl_80087290
lbl_80087248:
lis r3, __sincos_poly@ha
addi r4, r3, __sincos_poly@l
lfs f2, 4(r4)
lis r3, __sincos_on_quadrant@ha
lfs f1, 0xc(r4)
addi r3, r3, __sincos_on_quadrant@l
slwi r0, r31, 3
fmadds f3, f2, f4, f1
lfs f0, 0x14(r4)
lfs f2, 0x1c(r4)
add r3, r3, r0
lfs f1, 0x24(r4)
fmadds f3, f4, f3, f0
lfs f0, 4(r3)
fmadds f2, f4, f3, f2
fmadds f1, f4, f2, f1
fmuls f1, f31, f1
fmuls f1, f1, f0
lbl_80087290:
lwz r0, 0x2c(r1)
lfd f31, 0x20(r1)
lwz r31, 0x1c(r1)
mtlr r0
addi r1, r1, 0x28
blr
.global cosf
cosf:
mflr r0
lis r3, __four_over_pi_m1@ha
stw r0, 4(r1)
addi r3, r3, __four_over_pi_m1@l
stwu r1, -0x28(r1)
stfd f31, 0x20(r1)
stw r31, 0x1c(r1)
stfs f1, 8(r1)
lfs f0, "@106"@sda21(r2)
lwz r0, 8(r1)
lfs f6, 8(r1)
rlwinm. r0, r0, 0, 0, 0
fmuls f1, f0, f6
beq lbl_80086FC0
lfs f0, "@107"@sda21(r2)
fsubs f0, f1, f0
fctiwz f0, f0
stfd f0, 0x10(r1)
lwz r4, 0x14(r1)
b lbl_80086FD4
lbl_80086FC0:
lfs f0, "@107"@sda21(r2)
fadds f0, f0, f1
fctiwz f0, f0
stfd f0, 0x10(r1)
lwz r4, 0x14(r1)
lbl_80086FD4:
slwi r0, r4, 1
lfd f1, "@110"@sda21(r2)
xoris r0, r0, 0x8000
lfs f2, 0(r3)
stw r0, 0x14(r1)
lis r0, 0x4330
lfs f3, 4(r3)
clrlwi r31, r4, 0x1e
stw r0, 0x10(r1)
lfs f4, 8(r3)
lfd f0, 0x10(r1)
lfs f5, 0xc(r3)
fsubs f0, f0, f1
fsubs f0, f6, f0
fmadds f0, f2, f6, f0
fmadds f0, f3, f6, f0
fmadds f0, f4, f6, f0
fmadds f31, f5, f6, f0
fmr f1, f31
bl fabsf__Ff
lfs f0, "@108"@sda21(r2)
fcmpo cr0, f1, f0
bge lbl_80087050
lis r3, __sincos_on_quadrant@ha
slwi r4, r31, 3
addi r0, r3, __sincos_on_quadrant@l
add r3, r0, r4
lfs f1, 0(r3)
lfs f0, 4(r3)
fnmsubs f1, f31, f1, f0
b lbl_800870EC
lbl_80087050:
clrlwi. r0, r31, 0x1f
fmuls f4, f31, f31
beq lbl_800870A8
lis r3, __sincos_poly@ha
addi r4, r3, __sincos_poly@l
lfs f2, 4(r4)
lis r3, __sincos_on_quadrant@ha
lfs f1, 0xc(r4)
addi r0, r3, __sincos_on_quadrant@l
lfs f0, 0x14(r4)
fmadds f3, f2, f4, f1
lfs f2, 0x1c(r4)
lfs f1, 0x24(r4)
slwi r4, r31, 3
add r3, r0, r4
fmadds f3, f4, f3, f0
lfs f0, 0(r3)
fmadds f2, f4, f3, f2
fnmadds f1, f4, f2, f1
fmuls f1, f31, f1
fmuls f1, f1, f0
b lbl_800870EC
lbl_800870A8:
lis r3, __sincos_poly@ha
addi r4, r3, __sincos_poly@l
lfs f2, 0(r4)
lis r3, __sincos_on_quadrant@ha
lfs f1, 8(r4)
addi r3, r3, __sincos_on_quadrant@l
slwi r0, r31, 3
fmadds f3, f2, f4, f1
lfs f0, 0x10(r4)
lfs f2, 0x18(r4)
add r3, r3, r0
lfs f1, 0x20(r4)
fmadds f3, f4, f3, f0
lfs f0, 4(r3)
fmadds f2, f4, f3, f2
fmadds f1, f4, f2, f1
fmuls f1, f1, f0
lbl_800870EC:
lwz r0, 0x2c(r1)
lfd f31, 0x20(r1)
lwz r31, 0x1c(r1)
mtlr r0
addi r1, r1, 0x28
blr
.global __sinit_trigf_c
__sinit_trigf_c:
lis r3, tmp_float@ha
addi r4, r3, tmp_float@l
lfs f0, 0(r4)
lis r3, __four_over_pi_m1@ha
stfsu f0, __four_over_pi_m1@l(r3)
lfs f0, 4(r4)
stfs f0, 4(r3)
lfs f0, 8(r4)
stfs f0, 8(r3)
lfs f0, 0xc(r4)
stfs f0, 0xc(r3)
blr
.section .ctors, "wa"
lbl_constructor:
.4byte __sinit_trigf_c
.section .rodata, "a"
.balign 8
tmp_float:
.4byte 0x3E800000
.4byte 0x3CBE6080
.4byte 0x34372200
.4byte 0x2DA44152
.section .data, "wa"
__four_over_pi_m1:
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.section .sdata2, "a"
.balign 8
"@106":
.4byte 0x3F22F983
"@107":
.4byte 0x3F000000
"@108":
.4byte 0x39B504F3
.4byte 0
"@110":
.4byte 0x43300000
.4byte 0x80000000