Test floats

This commit is contained in:
Simon Gellis 2024-10-13 22:53:18 -04:00
parent 46d9d35e21
commit 67b3dce1d5
1 changed files with 158 additions and 3 deletions

View File

@ -2171,7 +2171,160 @@ return_from_trap2:
be 4
halt
# TODO: Floats
# floats
cvt.ws:
movea 1337, r0, r6
cvt.ws r6, r6
bnz 4
halt
bp 4
halt
bnv 4 # Always
halt
movhi hi(0x44a72000), r0, r7
movea lo(0x44a72000), r7, r7
cmp r6, r7
be 4
halt
cvt.sw:
movhi hi(0x460ca200), r0, r6
movea lo(0x460ca200), r6, r6
cvt.sw r6, r6
bnz 4
halt
bp 4
halt
bnv 4 # Always
halt
movea 9001, r0, r7
cmp r6, r7
be 4
halt
trnc.sw:
movhi hi(0x460ca200), r0, r6
movea lo(0x460ca200), r6, r6
trnc.sw r6, r6
bnz 4
halt
bp 4
halt
bnv 4 # Always
halt
movea 9000, r0, r7
cmp r6, r7
be 4
halt
addf.s:
mov 8, r6
cvt.ws r6, r6
mov 5, r7
cvt.ws r7, r7
addf.s r6, r7
bnz 4
halt
bp 4
halt
bnv 4 # Always
halt
mov 13, r6
cvt.ws r6, r6
cmp r6, r7
be 4
halt
subf.s:
mov 8, r6
cvt.ws r6, r6
mov 5, r7
cvt.ws r7, r7
subf.s r6, r7
bnz 4
halt
bn 4
halt
bnv 4 # Always
halt
mov -3, r6
cvt.ws r6, r6
cmp r6, r7
be 4
halt
mulf.s:
mov 8, r6
cvt.ws r6, r6
mov 5, r7
cvt.ws r7, r7
mulf.s r6, r7
bnz 4
halt
bp 4
halt
bnv 4 # Always
halt
movea 40, r0, r6
cvt.ws r6, r6
cmp r6, r7
be 4
halt
divf.s:
mov 8, r6
cvt.ws r6, r6
mov 5, r7
cvt.ws r7, r7
divf.s r6, r7
bnz 4
halt
bp 4
halt
bnv 4 # Always
halt
movhi hi(0x3f200000), r0, r6
movea lo(0x3f200000), r6, r6
cmp r6, r7
be 4
halt
cmpf.s:
mov 10, r1
cvt.ws r1, r1
mov r1, r6
cmpf.s r6, r1
be 4
halt
mov 9, r6
cvt.ws r6, r6
cmpf.s r6, r1
blt 4
br 4
halt
be 4
br 4
halt
bgt 4
halt
mov 11, r6
cvt.ws r6, r6
cmpf.s r6, r1
blt 4
halt
be 4
br 4
halt
bgt 4
br 4
halt
# TODO: Bitstring search
#========= I / O ============================
@ -2741,7 +2894,8 @@ _rom_title:
.fill 0x110
/* (7FFFF60h) - Float exception */
.fill 0x10
br 0
.fill 0x0E
/* Unused vector */
.fill 0x10
@ -2771,7 +2925,8 @@ _rom_title:
.fill 0x10
/* (7FFFFD0h) - NMI/Duplex exception */
.fill 0x10
br 0
.fill 0x0E
/* Unused vector */
.fill 0x10