prime/asm/Runtime/s_floor.s

100 lines
4.5 KiB
ArmAsm
Raw Normal View History

.include "macros.inc"
.section .text, "ax"
.global floor
floor:
/* 803944C4 00391424 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803944C8 00391428 D8 21 00 08 */ stfd f1, 8(r1)
/* 803944CC 0039142C 80 A1 00 08 */ lwz r5, 8(r1)
/* 803944D0 00391430 80 C1 00 0C */ lwz r6, 0xc(r1)
/* 803944D4 00391434 54 A3 65 7E */ rlwinm r3, r5, 0xc, 0x15, 0x1f
/* 803944D8 00391438 38 E3 FC 01 */ addi r7, r3, -1023
/* 803944DC 0039143C 2C 07 00 14 */ cmpwi r7, 0x14
/* 803944E0 00391440 40 80 00 98 */ bge lbl_80394578
/* 803944E4 00391444 2C 07 00 00 */ cmpwi r7, 0
/* 803944E8 00391448 40 80 00 44 */ bge lbl_8039452C
/* 803944EC 0039144C C8 42 D4 A0 */ lfd f2, lbl_805AF1C0@sda21(r2)
/* 803944F0 00391450 C8 02 D4 A8 */ lfd f0, lbl_805AF1C8@sda21(r2)
/* 803944F4 00391454 FC 22 08 2A */ fadd f1, f2, f1
/* 803944F8 00391458 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 803944FC 0039145C 40 81 00 FC */ ble lbl_803945F8
/* 80394500 00391460 2C 05 00 00 */ cmpwi r5, 0
/* 80394504 00391464 41 80 00 10 */ blt lbl_80394514
/* 80394508 00391468 38 C0 00 00 */ li r6, 0
/* 8039450C 0039146C 38 A0 00 00 */ li r5, 0
/* 80394510 00391470 48 00 00 E8 */ b lbl_803945F8
lbl_80394514:
/* 80394514 00391474 54 A0 00 7E */ clrlwi r0, r5, 1
/* 80394518 00391478 7C 00 33 79 */ or. r0, r0, r6
/* 8039451C 0039147C 41 82 00 DC */ beq lbl_803945F8
/* 80394520 00391480 3C A0 BF F0 */ lis r5, 0xbff0
/* 80394524 00391484 38 C0 00 00 */ li r6, 0
/* 80394528 00391488 48 00 00 D0 */ b lbl_803945F8
lbl_8039452C:
/* 8039452C 0039148C 3C 60 00 10 */ lis r3, 0x000FFFFF@ha
/* 80394530 00391490 38 03 FF FF */ addi r0, r3, 0x000FFFFF@l
/* 80394534 00391494 7C 04 3E 30 */ sraw r4, r0, r7
/* 80394538 00391498 7C A0 20 38 */ and r0, r5, r4
/* 8039453C 0039149C 7C C0 03 79 */ or. r0, r6, r0
/* 80394540 003914A0 40 82 00 08 */ bne lbl_80394548
/* 80394544 003914A4 48 00 00 C0 */ b lbl_80394604
lbl_80394548:
/* 80394548 003914A8 C8 42 D4 A0 */ lfd f2, lbl_805AF1C0@sda21(r2)
/* 8039454C 003914AC C8 02 D4 A8 */ lfd f0, lbl_805AF1C8@sda21(r2)
/* 80394550 003914B0 FC 22 08 2A */ fadd f1, f2, f1
/* 80394554 003914B4 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 80394558 003914B8 40 81 00 A0 */ ble lbl_803945F8
/* 8039455C 003914BC 2C 05 00 00 */ cmpwi r5, 0
/* 80394560 003914C0 40 80 00 0C */ bge lbl_8039456C
/* 80394564 003914C4 7C 60 3E 30 */ sraw r0, r3, r7
/* 80394568 003914C8 7C A5 02 14 */ add r5, r5, r0
lbl_8039456C:
/* 8039456C 003914CC 7C A5 20 78 */ andc r5, r5, r4
/* 80394570 003914D0 38 C0 00 00 */ li r6, 0
/* 80394574 003914D4 48 00 00 84 */ b lbl_803945F8
lbl_80394578:
/* 80394578 003914D8 2C 07 00 33 */ cmpwi r7, 0x33
/* 8039457C 003914DC 40 81 00 14 */ ble lbl_80394590
/* 80394580 003914E0 2C 07 04 00 */ cmpwi r7, 0x400
/* 80394584 003914E4 40 82 00 80 */ bne lbl_80394604
/* 80394588 003914E8 FC 21 08 2A */ fadd f1, f1, f1
/* 8039458C 003914EC 48 00 00 78 */ b lbl_80394604
lbl_80394590:
/* 80394590 003914F0 38 07 FF EC */ addi r0, r7, -20
/* 80394594 003914F4 38 60 FF FF */ li r3, -1
/* 80394598 003914F8 7C 64 04 30 */ srw r4, r3, r0
/* 8039459C 003914FC 7C C0 20 39 */ and. r0, r6, r4
/* 803945A0 00391500 40 82 00 08 */ bne lbl_803945A8
/* 803945A4 00391504 48 00 00 60 */ b lbl_80394604
lbl_803945A8:
/* 803945A8 00391508 C8 42 D4 A0 */ lfd f2, lbl_805AF1C0@sda21(r2)
/* 803945AC 0039150C C8 02 D4 A8 */ lfd f0, lbl_805AF1C8@sda21(r2)
/* 803945B0 00391510 FC 22 08 2A */ fadd f1, f2, f1
/* 803945B4 00391514 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 803945B8 00391518 40 81 00 40 */ ble lbl_803945F8
/* 803945BC 0039151C 2C 05 00 00 */ cmpwi r5, 0
/* 803945C0 00391520 40 80 00 34 */ bge lbl_803945F4
/* 803945C4 00391524 2C 07 00 14 */ cmpwi r7, 0x14
/* 803945C8 00391528 40 82 00 0C */ bne lbl_803945D4
/* 803945CC 0039152C 38 A5 00 01 */ addi r5, r5, 1
/* 803945D0 00391530 48 00 00 24 */ b lbl_803945F4
lbl_803945D4:
/* 803945D4 00391534 20 07 00 34 */ subfic r0, r7, 0x34
/* 803945D8 00391538 38 60 00 01 */ li r3, 1
/* 803945DC 0039153C 7C 60 00 30 */ slw r0, r3, r0
/* 803945E0 00391540 7C 06 02 14 */ add r0, r6, r0
/* 803945E4 00391544 7C 00 30 40 */ cmplw r0, r6
/* 803945E8 00391548 40 80 00 08 */ bge lbl_803945F0
/* 803945EC 0039154C 38 A5 00 01 */ addi r5, r5, 1
lbl_803945F0:
/* 803945F0 00391550 7C 06 03 78 */ mr r6, r0
lbl_803945F4:
/* 803945F4 00391554 7C C6 20 78 */ andc r6, r6, r4
lbl_803945F8:
/* 803945F8 00391558 90 A1 00 08 */ stw r5, 8(r1)
/* 803945FC 0039155C 90 C1 00 0C */ stw r6, 0xc(r1)
/* 80394600 00391560 C8 21 00 08 */ lfd f1, 8(r1)
lbl_80394604:
/* 80394604 00391564 38 21 00 10 */ addi r1, r1, 0x10
/* 80394608 00391568 4E 80 00 20 */ blr