asm tests for fld/fadd

This commit is contained in:
Scott Mansell 2019-12-10 04:36:19 +13:00 committed by Stefanos Kornilios Mitsis Poiitidis
parent d4cffa5354
commit 4abe6a9165
2 changed files with 57 additions and 0 deletions

27
unittests/ASM/fadd.asm Normal file
View File

@ -0,0 +1,27 @@
%ifdef CONFIG
{
"Match": "All",
"RegData": {
"MM0": ["0x0000000000000000", "0x0000"],
"MM1": ["0x0000000000000000", "0x0000"],
"MM2": ["0x0000000000000000", "0x0000"],
"MM3": ["0x0000000000000000", "0x0000"],
"MM4": ["0x0000000000000000", "0x0000"],
"MM5": ["0x0000000000000000", "0x0000"],
"MM6": ["0xc90fdb0000000000", "0x4000"],
"MM7": ["0xc90fdb0000000000", "0x4001"]
}
}
%endif
; calcuate pi + pi
fld dword [rel pi]
fld dword [rel pi]
faddp
hlt
align 8
pi: dd 0x40490fdb ; 3.14...
one: dd 0x3f800000 ; 1.0
ptone: dd 0x3dcccccd ; 0.1

30
unittests/ASM/fld.asm Normal file
View File

@ -0,0 +1,30 @@
%ifdef CONFIG
{
"Match": "All",
"RegData": {
"MM4": ["0xfffffffffffff800", "0xffff"],
"MM5": ["0xffffff0000000000", "0xffff"],
"MM6": ["0xaaaaaa0000000000", "0xbfd5"],
"MM7": ["0xc90fdb0000000000", "0x4000"]
}
}
%endif
lea rbp, [rel data]
; 32bit FLDs
fld dword [rbp]
fld dword [rbp + 4]
fld dword [rel allf] ; Currently fails due to lack of infinity handling
; 64bit FLDs
fld qword [rel allf] ; Currently fails due to lack of infinity handling
hlt
align 8
data:
dd 0x40490fdb
dd 0xaaaaaaaa
allf: dq 0xffffffffffffffff
dw 0xffff