1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 05:19:36 +00:00
oot/asm/fp.s

166 lines
2.5 KiB
ArmAsm
Raw Normal View History

#include "ultra64/asm.h"
2020-03-21 02:09:42 +00:00
.set noreorder
2020-03-21 02:09:42 +00:00
.section .data
2020-03-21 02:09:42 +00:00
.balign 16
2020-03-21 02:09:42 +00:00
DATA(qNaN0x3FFFFF)
.word 0x7FBFFFFF
ENDDATA(qNaN0x3FFFFF)
2020-03-21 02:09:42 +00:00
DATA(qNaN0x10000)
.word 0x7F810000
ENDDATA(qNaN0x10000)
2020-03-21 02:09:42 +00:00
DATA(sNaN0x3FFFFF)
.word 0x7FFFFFFF
ENDDATA(sNaN0x3FFFFF)
2020-03-21 02:09:42 +00:00
.section .text
2020-03-21 02:09:42 +00:00
.balign 16
LEAF(floorf)
2020-03-21 02:09:42 +00:00
floor.w.s $f12, $f12
jr $ra
cvt.s.w $f0, $f12
END(floorf)
2020-03-21 02:09:42 +00:00
LEAF(floor)
2020-03-21 02:09:42 +00:00
floor.w.d $f12, $f12
jr $ra
cvt.d.w $f0, $f12
END(floor)
2020-03-21 02:09:42 +00:00
LEAF(lfloorf)
2020-03-21 02:09:42 +00:00
floor.w.s $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(lfloorf)
2020-03-21 02:09:42 +00:00
LEAF(lfloor)
2020-03-21 02:09:42 +00:00
floor.w.d $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(lfloor)
2020-03-21 02:09:42 +00:00
LEAF(ceilf)
2020-03-21 02:09:42 +00:00
ceil.w.s $f12, $f12
jr $ra
cvt.s.w $f0, $f12
END(ceilf)
2020-03-21 02:09:42 +00:00
LEAF(ceil)
2020-03-21 02:09:42 +00:00
ceil.w.d $f12, $f12
jr $ra
cvt.d.w $f0, $f12
END(ceil)
2020-03-21 02:09:42 +00:00
LEAF(lceilf)
2020-03-21 02:09:42 +00:00
ceil.w.s $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(lceilf)
2020-03-21 02:09:42 +00:00
LEAF(lceil)
2020-03-21 02:09:42 +00:00
ceil.w.d $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(lceil)
2020-03-21 02:09:42 +00:00
LEAF(truncf)
2020-03-21 02:09:42 +00:00
trunc.w.s $f12, $f12
jr $ra
cvt.s.w $f0, $f12
END(truncf)
2020-03-21 02:09:42 +00:00
LEAF(trunc)
2020-03-21 02:09:42 +00:00
trunc.w.d $f12, $f12
jr $ra
cvt.d.w $f0, $f12
END(trunc)
2020-03-21 02:09:42 +00:00
LEAF(ltruncf)
2020-03-21 02:09:42 +00:00
trunc.w.s $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(ltruncf)
2020-03-21 02:09:42 +00:00
LEAF(ltrunc)
2020-03-21 02:09:42 +00:00
trunc.w.d $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(ltrunc)
2020-03-21 02:09:42 +00:00
LEAF(nearbyintf)
2020-03-21 02:09:42 +00:00
round.w.s $f12, $f12
jr $ra
cvt.s.w $f0, $f12
END(nearbyintf)
2020-03-21 02:09:42 +00:00
LEAF(nearbyint)
2020-03-21 02:09:42 +00:00
round.w.d $f12, $f12
jr $ra
cvt.d.w $f0, $f12
END(nearbyint)
2020-03-21 02:09:42 +00:00
LEAF(lnearbyintf)
2020-03-21 02:09:42 +00:00
round.w.s $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(lnearbyintf)
2020-03-21 02:09:42 +00:00
LEAF(lnearbyint)
2020-03-21 02:09:42 +00:00
round.w.d $f4, $f12
mfc1 $v0, $f4
jr $ra
nop
END(lnearbyint)
2020-03-21 02:09:42 +00:00
LEAF(roundf)
2020-03-21 02:09:42 +00:00
li.s $f4, 0.5
nop
add.s $f0, $f12, $f4
floor.w.s $f0, $f0
jr $ra
cvt.s.w $f0, $f0
END(roundf)
2020-03-21 02:09:42 +00:00
LEAF(round)
2020-03-21 02:09:42 +00:00
li.d $f4, 0.5
nop
add.d $f0, $f12, $f4
floor.w.d $f0, $f0
jr $ra
cvt.d.w $f0, $f0
END(round)
2020-03-21 02:09:42 +00:00
LEAF(lroundf)
2020-03-21 02:09:42 +00:00
li.s $f4, 0.5
nop
add.s $f0, $f12, $f4
floor.w.s $f0, $f0
mfc1 $v0, $f0
jr $ra
nop
END(lroundf)
2020-03-21 02:09:42 +00:00
LEAF(lround)
2020-03-21 02:09:42 +00:00
li.d $f4, 0.5
nop
add.d $f0, $f12, $f4
floor.w.d $f0, $f0
mfc1 $v0, $f0
jr $ra
nop
END(lround)