link fdlibm e_log files

two to go
This commit is contained in:
EpochFlame 2022-02-09 21:25:04 -05:00
parent 42d824f8e4
commit 55c409b8b1
5 changed files with 160 additions and 547 deletions

View File

@ -1,247 +0,0 @@
.include "macros.inc"
.section .sbss # 0x80514D80 - 0x80516360
.balign 8
zero:
.skip 0x8
.section .sdata2, "a" # 0x80516360 - 0x80520E40
.balign 8
.global lbl_80517248
lbl_80517248:
.4byte 0xC3500000
.4byte 0x00000000
.global lbl_80517250
lbl_80517250:
.4byte 0x43500000
.4byte 0x00000000
.global lbl_80517258
lbl_80517258:
.4byte 0x3FF00000
.4byte 0x00000000
.global lbl_80517260
lbl_80517260:
.4byte 0x3FE62E42
.4byte 0xFEE00000
.global lbl_80517268
lbl_80517268:
.4byte 0x3DEA39EF
.4byte 0x35793C76
.global lbl_80517270
lbl_80517270:
.4byte 0x3FE00000
.4byte 0x00000000
.global lbl_80517278
lbl_80517278:
.4byte 0x3FD55555
.4byte 0x55555555
.global lbl_80517280
lbl_80517280:
.4byte 0x40000000
.4byte 0x00000000
.global lbl_80517288
lbl_80517288:
.4byte 0x3FE55555
.4byte 0x55555593
.global lbl_80517290
lbl_80517290:
.4byte 0x3FD24924
.4byte 0x94229359
.global lbl_80517298
lbl_80517298:
.4byte 0x3FC74664
.4byte 0x96CB03DE
.global lbl_805172A0
lbl_805172A0:
.4byte 0x3FC2F112
.4byte 0xDF3E5244
.global lbl_805172A8
lbl_805172A8:
.4byte 0x3FD99999
.4byte 0x9997FA04
.global lbl_805172B0
lbl_805172B0:
.4byte 0x3FCC71C5
.4byte 0x1D8E78AF
.global lbl_805172B8
lbl_805172B8:
.4byte 0x3FC39A09
.4byte 0xD078C69F
.global lbl_805172C0
lbl_805172C0:
.4byte 0x43300000
.4byte 0x80000000
.section .text, "ax" # 0x800056C0 - 0x80472F00
.global __ieee754_log
__ieee754_log:
/* 800CCDD8 000C9D18 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 800CCDDC 000C9D1C 3C 00 00 10 */ lis r0, 0x10
/* 800CCDE0 000C9D20 39 00 00 00 */ li r8, 0
/* 800CCDE4 000C9D24 D8 21 00 08 */ stfd f1, 8(r1)
/* 800CCDE8 000C9D28 80 61 00 08 */ lwz r3, 8(r1)
/* 800CCDEC 000C9D2C 80 81 00 0C */ lwz r4, 0xc(r1)
/* 800CCDF0 000C9D30 7C 03 00 00 */ cmpw r3, r0
/* 800CCDF4 000C9D34 40 80 00 54 */ bge lbl_800CCE48
/* 800CCDF8 000C9D38 54 60 00 7E */ clrlwi r0, r3, 1
/* 800CCDFC 000C9D3C 7C 00 23 79 */ or. r0, r0, r4
/* 800CCE00 000C9D40 40 82 00 14 */ bne lbl_800CCE14
/* 800CCE04 000C9D44 C8 22 8E E8 */ lfd f1, lbl_80517248@sda21(r2)
/* 800CCE08 000C9D48 C8 0D 8C D0 */ lfd f0, zero@sda21(r13)
/* 800CCE0C 000C9D4C FC 21 00 24 */ fdiv f1, f1, f0
/* 800CCE10 000C9D50 48 00 02 3C */ b lbl_800CD04C
lbl_800CCE14:
/* 800CCE14 000C9D54 2C 03 00 00 */ cmpwi r3, 0
/* 800CCE18 000C9D58 40 80 00 1C */ bge lbl_800CCE34
/* 800CCE1C 000C9D5C FC 21 08 28 */ fsub f1, f1, f1
/* 800CCE20 000C9D60 C8 0D 8C D0 */ lfd f0, zero@sda21(r13)
/* 800CCE24 000C9D64 38 00 00 21 */ li r0, 0x21
/* 800CCE28 000C9D68 90 0D 8C C0 */ stw r0, errno@sda21(r13)
/* 800CCE2C 000C9D6C FC 21 00 24 */ fdiv f1, f1, f0
/* 800CCE30 000C9D70 48 00 02 1C */ b lbl_800CD04C
lbl_800CCE34:
/* 800CCE34 000C9D74 C8 02 8E F0 */ lfd f0, lbl_80517250@sda21(r2)
/* 800CCE38 000C9D78 39 00 FF CA */ li r8, -54
/* 800CCE3C 000C9D7C FC 01 00 32 */ fmul f0, f1, f0
/* 800CCE40 000C9D80 D8 01 00 08 */ stfd f0, 8(r1)
/* 800CCE44 000C9D84 80 61 00 08 */ lwz r3, 8(r1)
lbl_800CCE48:
/* 800CCE48 000C9D88 3C 00 7F F0 */ lis r0, 0x7ff0
/* 800CCE4C 000C9D8C 7C 03 00 00 */ cmpw r3, r0
/* 800CCE50 000C9D90 41 80 00 10 */ blt lbl_800CCE60
/* 800CCE54 000C9D94 C8 01 00 08 */ lfd f0, 8(r1)
/* 800CCE58 000C9D98 FC 20 00 2A */ fadd f1, f0, f0
/* 800CCE5C 000C9D9C 48 00 01 F0 */ b lbl_800CD04C
lbl_800CCE60:
/* 800CCE60 000C9DA0 54 66 03 3E */ clrlwi r6, r3, 0xc
/* 800CCE64 000C9DA4 7C 64 A6 70 */ srawi r4, r3, 0x14
/* 800CCE68 000C9DA8 3C 66 00 09 */ addis r3, r6, 9
/* 800CCE6C 000C9DAC C8 02 8E F8 */ lfd f0, lbl_80517258@sda21(r2)
/* 800CCE70 000C9DB0 38 A3 5F 64 */ addi r5, r3, 0x5f64
/* 800CCE74 000C9DB4 7D 04 42 14 */ add r8, r4, r8
/* 800CCE78 000C9DB8 54 A3 02 D6 */ rlwinm r3, r5, 0, 0xb, 0xb
/* 800CCE7C 000C9DBC 38 06 00 02 */ addi r0, r6, 2
/* 800CCE80 000C9DC0 6C 63 3F F0 */ xoris r3, r3, 0x3ff0
/* 800CCE84 000C9DC4 39 08 FC 01 */ addi r8, r8, -1023
/* 800CCE88 000C9DC8 7C C4 1B 78 */ or r4, r6, r3
/* 800CCE8C 000C9DCC 54 00 03 3E */ clrlwi r0, r0, 0xc
/* 800CCE90 000C9DD0 90 81 00 08 */ stw r4, 8(r1)
/* 800CCE94 000C9DD4 54 A3 67 FE */ rlwinm r3, r5, 0xc, 0x1f, 0x1f
/* 800CCE98 000C9DD8 2C 00 00 03 */ cmpwi r0, 3
/* 800CCE9C 000C9DDC C8 21 00 08 */ lfd f1, 8(r1)
/* 800CCEA0 000C9DE0 7D 08 1A 14 */ add r8, r8, r3
/* 800CCEA4 000C9DE4 FC 01 00 28 */ fsub f0, f1, f0
/* 800CCEA8 000C9DE8 40 80 00 A4 */ bge lbl_800CCF4C
/* 800CCEAC 000C9DEC C8 2D 8C D0 */ lfd f1, zero@sda21(r13)
/* 800CCEB0 000C9DF0 FC 00 08 00 */ fcmpu cr0, f0, f1
/* 800CCEB4 000C9DF4 40 82 00 40 */ bne lbl_800CCEF4
/* 800CCEB8 000C9DF8 2C 08 00 00 */ cmpwi r8, 0
/* 800CCEBC 000C9DFC 40 82 00 08 */ bne lbl_800CCEC4
/* 800CCEC0 000C9E00 48 00 01 8C */ b lbl_800CD04C
lbl_800CCEC4:
/* 800CCEC4 000C9E04 6D 03 80 00 */ xoris r3, r8, 0x8000
/* 800CCEC8 000C9E08 3C 00 43 30 */ lis r0, 0x4330
/* 800CCECC 000C9E0C 90 61 00 14 */ stw r3, 0x14(r1)
/* 800CCED0 000C9E10 C8 62 8F 60 */ lfd f3, lbl_805172C0@sda21(r2)
/* 800CCED4 000C9E14 90 01 00 10 */ stw r0, 0x10(r1)
/* 800CCED8 000C9E18 C8 02 8F 08 */ lfd f0, lbl_80517268@sda21(r2)
/* 800CCEDC 000C9E1C C8 41 00 10 */ lfd f2, 0x10(r1)
/* 800CCEE0 000C9E20 C8 22 8F 00 */ lfd f1, lbl_80517260@sda21(r2)
/* 800CCEE4 000C9E24 FC 42 18 28 */ fsub f2, f2, f3
/* 800CCEE8 000C9E28 FC 00 00 B2 */ fmul f0, f0, f2
/* 800CCEEC 000C9E2C FC 21 00 BA */ fmadd f1, f1, f2, f0
/* 800CCEF0 000C9E30 48 00 01 5C */ b lbl_800CD04C
lbl_800CCEF4:
/* 800CCEF4 000C9E34 C8 62 8F 18 */ lfd f3, lbl_80517278@sda21(r2)
/* 800CCEF8 000C9E38 FC 20 00 32 */ fmul f1, f0, f0
/* 800CCEFC 000C9E3C C8 42 8F 10 */ lfd f2, lbl_80517270@sda21(r2)
/* 800CCF00 000C9E40 2C 08 00 00 */ cmpwi r8, 0
/* 800CCF04 000C9E44 FC 43 10 3C */ fnmsub f2, f3, f0, f2
/* 800CCF08 000C9E48 FC A2 00 72 */ fmul f5, f2, f1
/* 800CCF0C 000C9E4C 40 82 00 0C */ bne lbl_800CCF18
/* 800CCF10 000C9E50 FC 20 28 28 */ fsub f1, f0, f5
/* 800CCF14 000C9E54 48 00 01 38 */ b lbl_800CD04C
lbl_800CCF18:
/* 800CCF18 000C9E58 6D 03 80 00 */ xoris r3, r8, 0x8000
/* 800CCF1C 000C9E5C 3C 00 43 30 */ lis r0, 0x4330
/* 800CCF20 000C9E60 90 61 00 14 */ stw r3, 0x14(r1)
/* 800CCF24 000C9E64 C8 82 8F 60 */ lfd f4, lbl_805172C0@sda21(r2)
/* 800CCF28 000C9E68 90 01 00 10 */ stw r0, 0x10(r1)
/* 800CCF2C 000C9E6C C8 22 8F 08 */ lfd f1, lbl_80517268@sda21(r2)
/* 800CCF30 000C9E70 C8 61 00 10 */ lfd f3, 0x10(r1)
/* 800CCF34 000C9E74 C8 42 8F 00 */ lfd f2, lbl_80517260@sda21(r2)
/* 800CCF38 000C9E78 FC 63 20 28 */ fsub f3, f3, f4
/* 800CCF3C 000C9E7C FC 21 28 FC */ fnmsub f1, f1, f3, f5
/* 800CCF40 000C9E80 FC 01 00 28 */ fsub f0, f1, f0
/* 800CCF44 000C9E84 FC 22 00 F8 */ fmsub f1, f2, f3, f0
/* 800CCF48 000C9E88 48 00 01 04 */ b lbl_800CD04C
lbl_800CCF4C:
/* 800CCF4C 000C9E8C C8 22 8F 20 */ lfd f1, lbl_80517280@sda21(r2)
/* 800CCF50 000C9E90 6D 05 80 00 */ xoris r5, r8, 0x8000
/* 800CCF54 000C9E94 3C 80 43 30 */ lis r4, 0x4330
/* 800CCF58 000C9E98 3C 60 00 07 */ lis r3, 0x0006B851@ha
/* 800CCF5C 000C9E9C FC 21 00 2A */ fadd f1, f1, f0
/* 800CCF60 000C9EA0 3C E6 FF FA */ addis r7, r6, 0xfffa
/* 800CCF64 000C9EA4 38 03 B8 51 */ addi r0, r3, 0x0006B851@l
/* 800CCF68 000C9EA8 C9 02 8F 40 */ lfd f8, lbl_805172A0@sda21(r2)
/* 800CCF6C 000C9EAC C8 E2 8F 38 */ lfd f7, lbl_80517298@sda21(r2)
/* 800CCF70 000C9EB0 7C 06 00 50 */ subf r0, r6, r0
/* 800CCF74 000C9EB4 FC 20 08 24 */ fdiv f1, f0, f1
/* 800CCF78 000C9EB8 38 E7 EB 86 */ addi r7, r7, -5242
/* 800CCF7C 000C9EBC C8 C2 8F 30 */ lfd f6, lbl_80517290@sda21(r2)
/* 800CCF80 000C9EC0 7C E7 03 79 */ or. r7, r7, r0
/* 800CCF84 000C9EC4 C8 82 8F 58 */ lfd f4, lbl_805172B8@sda21(r2)
/* 800CCF88 000C9EC8 C8 62 8F 50 */ lfd f3, lbl_805172B0@sda21(r2)
/* 800CCF8C 000C9ECC FD 61 00 72 */ fmul f11, f1, f1
/* 800CCF90 000C9ED0 C8 A2 8F 28 */ lfd f5, lbl_80517288@sda21(r2)
/* 800CCF94 000C9ED4 C8 42 8F 48 */ lfd f2, lbl_805172A8@sda21(r2)
/* 800CCF98 000C9ED8 90 A1 00 14 */ stw r5, 0x14(r1)
/* 800CCF9C 000C9EDC C9 42 8F 60 */ lfd f10, lbl_805172C0@sda21(r2)
/* 800CCFA0 000C9EE0 FD 8B 02 F2 */ fmul f12, f11, f11
/* 800CCFA4 000C9EE4 90 81 00 10 */ stw r4, 0x10(r1)
/* 800CCFA8 000C9EE8 C9 21 00 10 */ lfd f9, 0x10(r1)
/* 800CCFAC 000C9EEC FC E8 3B 3A */ fmadd f7, f8, f12, f7
/* 800CCFB0 000C9EF0 FC 64 1B 3A */ fmadd f3, f4, f12, f3
/* 800CCFB4 000C9EF4 FC 8C 31 FA */ fmadd f4, f12, f7, f6
/* 800CCFB8 000C9EF8 FC 4C 10 FA */ fmadd f2, f12, f3, f2
/* 800CCFBC 000C9EFC FC 6C 29 3A */ fmadd f3, f12, f4, f5
/* 800CCFC0 000C9F00 FC 4C 00 B2 */ fmul f2, f12, f2
/* 800CCFC4 000C9F04 FC 6B 00 F2 */ fmul f3, f11, f3
/* 800CCFC8 000C9F08 FC A9 50 28 */ fsub f5, f9, f10
/* 800CCFCC 000C9F0C FC 63 10 2A */ fadd f3, f3, f2
/* 800CCFD0 000C9F10 40 81 00 4C */ ble lbl_800CD01C
/* 800CCFD4 000C9F14 C8 42 8F 10 */ lfd f2, lbl_80517270@sda21(r2)
/* 800CCFD8 000C9F18 2C 08 00 00 */ cmpwi r8, 0
/* 800CCFDC 000C9F1C FC 42 00 32 */ fmul f2, f2, f0
/* 800CCFE0 000C9F20 FC C2 00 32 */ fmul f6, f2, f0
/* 800CCFE4 000C9F24 40 82 00 14 */ bne lbl_800CCFF8
/* 800CCFE8 000C9F28 FC 46 18 2A */ fadd f2, f6, f3
/* 800CCFEC 000C9F2C FC 21 30 BC */ fnmsub f1, f1, f2, f6
/* 800CCFF0 000C9F30 FC 20 08 28 */ fsub f1, f0, f1
/* 800CCFF4 000C9F34 48 00 00 58 */ b lbl_800CD04C
lbl_800CCFF8:
/* 800CCFF8 000C9F38 C8 42 8F 08 */ lfd f2, lbl_80517268@sda21(r2)
/* 800CCFFC 000C9F3C FC 66 18 2A */ fadd f3, f6, f3
/* 800CD000 000C9F40 C8 82 8F 00 */ lfd f4, lbl_80517260@sda21(r2)
/* 800CD004 000C9F44 FC 42 01 72 */ fmul f2, f2, f5
/* 800CD008 000C9F48 FC 21 10 FA */ fmadd f1, f1, f3, f2
/* 800CD00C 000C9F4C FC 26 08 28 */ fsub f1, f6, f1
/* 800CD010 000C9F50 FC 01 00 28 */ fsub f0, f1, f0
/* 800CD014 000C9F54 FC 24 01 78 */ fmsub f1, f4, f5, f0
/* 800CD018 000C9F58 48 00 00 34 */ b lbl_800CD04C
lbl_800CD01C:
/* 800CD01C 000C9F5C 2C 08 00 00 */ cmpwi r8, 0
/* 800CD020 000C9F60 40 82 00 10 */ bne lbl_800CD030
/* 800CD024 000C9F64 FC 40 18 28 */ fsub f2, f0, f3
/* 800CD028 000C9F68 FC 21 00 BC */ fnmsub f1, f1, f2, f0
/* 800CD02C 000C9F6C 48 00 00 20 */ b lbl_800CD04C
lbl_800CD030:
/* 800CD030 000C9F70 C8 42 8F 08 */ lfd f2, lbl_80517268@sda21(r2)
/* 800CD034 000C9F74 FC 60 18 28 */ fsub f3, f0, f3
/* 800CD038 000C9F78 C8 82 8F 00 */ lfd f4, lbl_80517260@sda21(r2)
/* 800CD03C 000C9F7C FC 42 01 72 */ fmul f2, f2, f5
/* 800CD040 000C9F80 FC 21 10 F8 */ fmsub f1, f1, f3, f2
/* 800CD044 000C9F84 FC 01 00 28 */ fsub f0, f1, f0
/* 800CD048 000C9F88 FC 24 01 78 */ fmsub f1, f4, f5, f0
lbl_800CD04C:
/* 800CD04C 000C9F8C 38 21 00 20 */ addi r1, r1, 0x20
/* 800CD050 000C9F90 4E 80 00 20 */ blr

View File

@ -1,109 +0,0 @@
.include "macros.inc"
.section .sbss # 0x80514D80 - 0x80516360
.balign 8
zero:
.skip 0x8
.section .sdata2, "a" # 0x80516360 - 0x80520E40
.balign 8
.global lbl_805172C8
lbl_805172C8:
.4byte 0xC3500000
.4byte 0x00000000
.global lbl_805172D0
lbl_805172D0:
.4byte 0x43500000
.4byte 0x00000000
.global lbl_805172D8
lbl_805172D8:
.4byte 0x3D59FEF3
.4byte 0x11F12B36
.global lbl_805172E0
lbl_805172E0:
.4byte 0x3FDBCB7B
.4byte 0x1526E50E
.global lbl_805172E8
lbl_805172E8:
.4byte 0x3FD34413
.4byte 0x509F6000
.global lbl_805172F0
lbl_805172F0:
.4byte 0x43300000
.4byte 0x80000000
.section .text, "ax" # 0x800056C0 - 0x80472F00
.global __ieee754_log10
__ieee754_log10:
/* 800CD054 000C9F94 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 800CD058 000C9F98 7C 08 02 A6 */ mflr r0
/* 800CD05C 000C9F9C 38 80 00 00 */ li r4, 0
/* 800CD060 000C9FA0 D8 21 00 08 */ stfd f1, 8(r1)
/* 800CD064 000C9FA4 80 A1 00 08 */ lwz r5, 8(r1)
/* 800CD068 000C9FA8 90 01 00 24 */ stw r0, 0x24(r1)
/* 800CD06C 000C9FAC 3C 00 00 10 */ lis r0, 0x10
/* 800CD070 000C9FB0 7C 05 00 00 */ cmpw r5, r0
/* 800CD074 000C9FB4 80 61 00 0C */ lwz r3, 0xc(r1)
/* 800CD078 000C9FB8 DB E1 00 18 */ stfd f31, 0x18(r1)
/* 800CD07C 000C9FBC 40 80 00 5C */ bge lbl_800CD0D8
/* 800CD080 000C9FC0 54 A0 00 7E */ clrlwi r0, r5, 1
/* 800CD084 000C9FC4 7C 00 1B 79 */ or. r0, r0, r3
/* 800CD088 000C9FC8 40 82 00 1C */ bne lbl_800CD0A4
/* 800CD08C 000C9FCC C8 22 8F 68 */ lfd f1, lbl_805172C8@sda21(r2)
/* 800CD090 000C9FD0 38 00 00 21 */ li r0, 0x21
/* 800CD094 000C9FD4 C8 0D 8C D8 */ lfd f0, zero@sda21(r13)
/* 800CD098 000C9FD8 90 0D 8C C0 */ stw r0, errno@sda21(r13)
/* 800CD09C 000C9FDC FC 21 00 24 */ fdiv f1, f1, f0
/* 800CD0A0 000C9FE0 48 00 00 B0 */ b lbl_800CD150
lbl_800CD0A4:
/* 800CD0A4 000C9FE4 2C 05 00 00 */ cmpwi r5, 0
/* 800CD0A8 000C9FE8 40 80 00 1C */ bge lbl_800CD0C4
/* 800CD0AC 000C9FEC FC 21 08 28 */ fsub f1, f1, f1
/* 800CD0B0 000C9FF0 C8 0D 8C D8 */ lfd f0, zero@sda21(r13)
/* 800CD0B4 000C9FF4 38 00 00 21 */ li r0, 0x21
/* 800CD0B8 000C9FF8 90 0D 8C C0 */ stw r0, errno@sda21(r13)
/* 800CD0BC 000C9FFC FC 21 00 24 */ fdiv f1, f1, f0
/* 800CD0C0 000CA000 48 00 00 90 */ b lbl_800CD150
lbl_800CD0C4:
/* 800CD0C4 000CA004 C8 02 8F 70 */ lfd f0, lbl_805172D0@sda21(r2)
/* 800CD0C8 000CA008 38 80 FF CA */ li r4, -54
/* 800CD0CC 000CA00C FC 01 00 32 */ fmul f0, f1, f0
/* 800CD0D0 000CA010 D8 01 00 08 */ stfd f0, 8(r1)
/* 800CD0D4 000CA014 80 A1 00 08 */ lwz r5, 8(r1)
lbl_800CD0D8:
/* 800CD0D8 000CA018 3C 00 7F F0 */ lis r0, 0x7ff0
/* 800CD0DC 000CA01C 7C 05 00 00 */ cmpw r5, r0
/* 800CD0E0 000CA020 41 80 00 10 */ blt lbl_800CD0F0
/* 800CD0E4 000CA024 C8 01 00 08 */ lfd f0, 8(r1)
/* 800CD0E8 000CA028 FC 20 00 2A */ fadd f1, f0, f0
/* 800CD0EC 000CA02C 48 00 00 64 */ b lbl_800CD150
lbl_800CD0F0:
/* 800CD0F0 000CA030 7C A3 A6 70 */ srawi r3, r5, 0x14
/* 800CD0F4 000CA034 3C 00 43 30 */ lis r0, 0x4330
/* 800CD0F8 000CA038 7C 83 22 14 */ add r4, r3, r4
/* 800CD0FC 000CA03C 90 01 00 10 */ stw r0, 0x10(r1)
/* 800CD100 000CA040 38 84 FC 01 */ addi r4, r4, -1023
/* 800CD104 000CA044 C8 22 8F 90 */ lfd f1, lbl_805172F0@sda21(r2)
/* 800CD108 000CA048 54 83 0F FE */ srwi r3, r4, 0x1f
/* 800CD10C 000CA04C 7C 04 1A 14 */ add r0, r4, r3
/* 800CD110 000CA050 6C 00 80 00 */ xoris r0, r0, 0x8000
/* 800CD114 000CA054 20 63 03 FF */ subfic r3, r3, 0x3ff
/* 800CD118 000CA058 90 01 00 14 */ stw r0, 0x14(r1)
/* 800CD11C 000CA05C 54 60 A0 16 */ slwi r0, r3, 0x14
/* 800CD120 000CA060 50 A0 03 3E */ rlwimi r0, r5, 0, 0xc, 0x1f
/* 800CD124 000CA064 C8 01 00 10 */ lfd f0, 0x10(r1)
/* 800CD128 000CA068 90 01 00 08 */ stw r0, 8(r1)
/* 800CD12C 000CA06C FF E0 08 28 */ fsub f31, f0, f1
/* 800CD130 000CA070 C8 21 00 08 */ lfd f1, 8(r1)
/* 800CD134 000CA074 4B FF FC A5 */ bl __ieee754_log
/* 800CD138 000CA078 C8 02 8F 80 */ lfd f0, lbl_805172E0@sda21(r2)
/* 800CD13C 000CA07C C8 42 8F 78 */ lfd f2, lbl_805172D8@sda21(r2)
/* 800CD140 000CA080 FC 20 00 72 */ fmul f1, f0, f1
/* 800CD144 000CA084 C8 02 8F 88 */ lfd f0, lbl_805172E8@sda21(r2)
/* 800CD148 000CA088 FC 22 0F FA */ fmadd f1, f2, f31, f1
/* 800CD14C 000CA08C FC 20 0F FA */ fmadd f1, f0, f31, f1
lbl_800CD150:
/* 800CD150 000CA090 80 01 00 24 */ lwz r0, 0x24(r1)
/* 800CD154 000CA094 CB E1 00 18 */ lfd f31, 0x18(r1)
/* 800CD158 000CA098 7C 08 03 A6 */ mtlr r0
/* 800CD15C 000CA09C 38 21 00 20 */ addi r1, r1, 0x20
/* 800CD160 000CA0A0 4E 80 00 20 */ blr

View File

@ -310,8 +310,8 @@ DOLPHIN:=\
$(BUILD_DIR)/src/Dolphin/e_atan2.o\
$(BUILD_DIR)/src/Dolphin/e_exp.o\
$(BUILD_DIR)/src/Dolphin/e_fmod.o\
$(BUILD_DIR)/asm/Dolphin/e_log.o\
$(BUILD_DIR)/asm/Dolphin/e_log10.o\
$(BUILD_DIR)/src/Dolphin/e_log.o\
$(BUILD_DIR)/src/Dolphin/e_log10.o\
$(BUILD_DIR)/src/Dolphin/e_pow.o\
$(BUILD_DIR)/src/Dolphin/e_rem_pio2.o\
$(BUILD_DIR)/src/Dolphin/k_cos.o\

View File

@ -1,196 +1,163 @@
/*
* --INFO--
* Address: 800CCDD8
* Size: 00027C
*/
void __ieee754_log(void)
/* @(#)e_log.c 1.3 95/01/18 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/* __ieee754_log(x)
* Return the logrithm of x
*
* Method :
* 1. Argument Reduction: find k and f such that
* x = 2^k * (1+f),
* where sqrt(2)/2 < 1+f < sqrt(2) .
*
* 2. Approximation of log(1+f).
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
* = 2s + s*R
* We use a special Reme algorithm on [0,0.1716] to generate
* a polynomial of degree 14 to approximate R The maximum error
* of this polynomial approximation is bounded by 2**-58.45. In
* other words,
* 2 4 6 8 10 12 14
* R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
* (the values of Lg1 to Lg7 are listed in the program)
* and
* | 2 14 | -58.45
* | Lg1*s +...+Lg7*s - R(z) | <= 2
* | |
* Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
* In order to guarantee error in log below 1ulp, we compute log
* by
* log(1+f) = f - s*(f - R) (if f is not too large)
* log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
*
* 3. Finally, log(x) = k*ln2 + log(1+f).
* = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
* Here ln2 is split into two floating point number:
* ln2_hi + ln2_lo,
* where n*ln2_hi is always exact for |n| < 2000.
*
* Special cases:
* log(x) is NaN with signal if x < 0 (including -INF) ;
* log(+INF) is +INF; log(0) is -INF with signal;
* log(NaN) is that NaN with no signal.
*
* Accuracy:
* according to an error analysis, the error is always less than
* 1 ulp (unit in the last place).
*
* Constants:
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
#include "fdlibm.h"
#include "errno.h"
#ifdef __STDC__
static const double
#else
static double
#endif
ln2_hi
= 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
static double zero = 0.0;
#ifdef __STDC__
double __ieee754_log(double x)
#else
double __ieee754_log(x) double x;
#endif
{
/*
.loc_0x0:
stwu r1, -0x20(r1)
lis r0, 0x10
li r8, 0
stfd f1, 0x8(r1)
lwz r3, 0x8(r1)
lwz r4, 0xC(r1)
cmpw r3, r0
bge- .loc_0x70
rlwinm r0,r3,0,1,31
or. r0, r0, r4
bne- .loc_0x3C
lfd f1, -0x7118(r2)
lfd f0, -0x7330(r13)
fdiv f1, f1, f0
b .loc_0x274
double hfsq, f, s, z, R, w, t1, t2, dk;
int k, hx, i, j;
unsigned lx;
.loc_0x3C:
cmpwi r3, 0
bge- .loc_0x5C
fsub f1, f1, f1
lfd f0, -0x7330(r13)
li r0, 0x21
stw r0, -0x7340(r13)
fdiv f1, f1, f0
b .loc_0x274
hx = __HI(x); /* high word of x */
lx = __LO(x); /* low word of x */
.loc_0x5C:
lfd f0, -0x7110(r2)
li r8, -0x36
fmul f0, f1, f0
stfd f0, 0x8(r1)
lwz r3, 0x8(r1)
.loc_0x70:
lis r0, 0x7FF0
cmpw r3, r0
blt- .loc_0x88
lfd f0, 0x8(r1)
fadd f1, f0, f0
b .loc_0x274
.loc_0x88:
rlwinm r6,r3,0,12,31
srawi r4, r3, 0x14
addis r3, r6, 0x9
lfd f0, -0x7108(r2)
addi r5, r3, 0x5F64
add r8, r4, r8
rlwinm r3,r5,0,11,11
addi r0, r6, 0x2
xoris r3, r3, 0x3FF0
subi r8, r8, 0x3FF
or r4, r6, r3
rlwinm r0,r0,0,12,31
stw r4, 0x8(r1)
rlwinm r3,r5,12,31,31
cmpwi r0, 0x3
lfd f1, 0x8(r1)
add r8, r8, r3
fsub f0, f1, f0
bge- .loc_0x174
lfd f1, -0x7330(r13)
fcmpu cr0, f0, f1
bne- .loc_0x11C
cmpwi r8, 0
bne- .loc_0xEC
b .loc_0x274
.loc_0xEC:
xoris r3, r8, 0x8000
lis r0, 0x4330
stw r3, 0x14(r1)
lfd f3, -0x70A0(r2)
stw r0, 0x10(r1)
lfd f0, -0x70F8(r2)
lfd f2, 0x10(r1)
lfd f1, -0x7100(r2)
fsub f2, f2, f3
fmul f0, f0, f2
fmadd f1, f1, f2, f0
b .loc_0x274
.loc_0x11C:
lfd f3, -0x70E8(r2)
fmul f1, f0, f0
lfd f2, -0x70F0(r2)
cmpwi r8, 0
fnmsub f2, f3, f0, f2
fmul f5, f2, f1
bne- .loc_0x140
fsub f1, f0, f5
b .loc_0x274
.loc_0x140:
xoris r3, r8, 0x8000
lis r0, 0x4330
stw r3, 0x14(r1)
lfd f4, -0x70A0(r2)
stw r0, 0x10(r1)
lfd f1, -0x70F8(r2)
lfd f3, 0x10(r1)
lfd f2, -0x7100(r2)
fsub f3, f3, f4
fnmsub f1, f1, f3, f5
fsub f0, f1, f0
fmsub f1, f2, f3, f0
b .loc_0x274
.loc_0x174:
lfd f1, -0x70E0(r2)
xoris r5, r8, 0x8000
lis r4, 0x4330
lis r3, 0x7
fadd f1, f1, f0
subis r7, r6, 0x6
subi r0, r3, 0x47AF
lfd f8, -0x70C0(r2)
lfd f7, -0x70C8(r2)
sub r0, r0, r6
fdiv f1, f0, f1
subi r7, r7, 0x147A
lfd f6, -0x70D0(r2)
or. r7, r7, r0
lfd f4, -0x70A8(r2)
lfd f3, -0x70B0(r2)
fmul f11, f1, f1
lfd f5, -0x70D8(r2)
lfd f2, -0x70B8(r2)
stw r5, 0x14(r1)
lfd f10, -0x70A0(r2)
fmul f12, f11, f11
stw r4, 0x10(r1)
lfd f9, 0x10(r1)
fmadd f7, f8, f12, f7
fmadd f3, f4, f12, f3
fmadd f4, f12, f7, f6
fmadd f2, f12, f3, f2
fmadd f3, f12, f4, f5
fmul f2, f12, f2
fmul f3, f11, f3
fsub f5, f9, f10
fadd f3, f3, f2
ble- .loc_0x244
lfd f2, -0x70F0(r2)
cmpwi r8, 0
fmul f2, f2, f0
fmul f6, f2, f0
bne- .loc_0x220
fadd f2, f6, f3
fnmsub f1, f1, f2, f6
fsub f1, f0, f1
b .loc_0x274
.loc_0x220:
lfd f2, -0x70F8(r2)
fadd f3, f6, f3
lfd f4, -0x7100(r2)
fmul f2, f2, f5
fmadd f1, f1, f3, f2
fsub f1, f6, f1
fsub f0, f1, f0
fmsub f1, f4, f5, f0
b .loc_0x274
.loc_0x244:
cmpwi r8, 0
bne- .loc_0x258
fsub f2, f0, f3
fnmsub f1, f1, f2, f0
b .loc_0x274
.loc_0x258:
lfd f2, -0x70F8(r2)
fsub f3, f0, f3
lfd f4, -0x7100(r2)
fmul f2, f2, f5
fmsub f1, f1, f3, f2
fsub f0, f1, f0
fmsub f1, f4, f5, f0
.loc_0x274:
addi r1, r1, 0x20
blr
*/
k = 0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx & 0x7fffffff) | lx) == 0)
return -two54 / zero; /* log(+-0)=-inf */
if (hx < 0) {
errno = 33;
return (x - x) / zero;
} /* log(-#) = NaN */
k -= 54;
x *= two54; /* subnormal number, scale up x */
hx = __HI(x); /* high word of x */
}
if (hx >= 0x7ff00000)
return x + x;
k += (hx >> 20) - 1023;
hx &= 0x000fffff;
i = (hx + 0x95f64) & 0x100000;
__HI(x) = hx | (i ^ 0x3ff00000); /* normalize x or x/2 */
k += (i >> 20);
f = x - 1.0;
if ((0x000fffff & (2 + hx)) < 3) { /* |f| < 2**-20 */
if (f == zero)
if (k == 0)
return zero;
else {
dk = (double)k;
return dk * ln2_hi + dk * ln2_lo;
}
R = f * f * (0.5 - 0.33333333333333333 * f);
if (k == 0)
return f - R;
else {
dk = (double)k;
return dk * ln2_hi - ((R - dk * ln2_lo) - f);
}
}
s = f / (2.0 + f);
dk = (double)k;
z = s * s;
i = hx - 0x6147a;
w = z * z;
j = 0x6b851 - hx;
t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
i |= j;
R = t2 + t1;
if (i > 0) {
hfsq = 0.5 * f * f;
if (k == 0)
return f - (hfsq - s * (hfsq + R));
else
return dk * ln2_hi - ((hfsq - (s * (hfsq + R) + dk * ln2_lo)) - f);
} else {
if (k == 0)
return f - s * (f - R);
else
return dk * ln2_hi - ((s * (f - R) - dk * ln2_lo) - f);
}
}

View File

@ -75,8 +75,10 @@ double __ieee754_log10(x) double x;
k = 0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx & 0x7fffffff) | lx) == 0)
return -two54 / zero; /* log(+-0)=-inf */
if (((hx & 0x7fffffff) | lx) == 0) {
errno = 33;
return -two54 / zero;
} /* log(+-0)=-inf */
if (hx < 0) {
errno = 33;
return (x - x) / zero;