asm: add some f80 tests

This commit is contained in:
Denis Drakhnia 2024-01-04 06:07:15 +02:00
parent 2cbb6bf699
commit 233cea585c
5 changed files with 58 additions and 0 deletions

14
tests/asm/f80/fxaddxx-1.S Normal file
View File

@ -0,0 +1,14 @@
#include "test_start.S"
setwd wsz=8, nfx=0
shld,0 1, 63, %r0
{
movif,0 %r0, 0x4000, %r0
movif,1 %r0, 0x4001, %r1
}
fxaddxx,0 %r0, %r1, %r2
movfi,0 %r2, %r3
assert_eq_i64(%r2, 0xc000000000000000)
assert_eq_i32(%r3, 0x4001)
#include "test_end.S"

14
tests/asm/f80/fxmulxx-1.S Normal file
View File

@ -0,0 +1,14 @@
#include "test_start.S"
setwd wsz=8, nfx=0
shld,0 1, 63, %r0
{
movif,0 %r0, 0x4000, %r0
movif,1 %r0, 0x4001, %r1
}
fxmulxx,0 %r0, %r1, %r2
movfi,0 %r2, %r3
assert_eq_i64(%r2, 0x8000000000000000)
assert_eq_i32(%r3, 0x4002)
#include "test_end.S"

14
tests/asm/f80/fxsubxx-1.S Normal file
View File

@ -0,0 +1,14 @@
#include "test_start.S"
setwd wsz=8, nfx=0
shld,0 1, 63, %r0
{
movif,0 %r0, 0x4000, %r0
movif,1 %r0, 0x4001, %r1
}
fxsubxx,0 %r0, %r1, %r2
movfi,0 %r2, %r3
assert_eq_i64(%r2, 0x8000000000000000)
assert_eq_i32(%r3, 0xc000)
#include "test_end.S"

View File

@ -0,0 +1,10 @@
#include "test_start.S"
setwd wsz=8, nfx=0
addd,0 0, 0xaaaaaaaa, %g16
movif %g16, 0xbeef, %g17
movfi %g17, %g18
assert_eq_i64(%g17, 0xaaaaaaaa)
assert_eq_i32(%g18, 0xbeef)
#include "test_end.S"

View File

@ -190,6 +190,12 @@ asm_tests = {
'invalid-arg-1': {},
'invalid-arg-hi-1': {},
},
'f80': {
'movif-movfi-1': {},
'fxaddxx-1': {},
'fxsubxx-1': {},
'fxmulxx-1': {},
},
}
foreach suite, tests : asm_tests