aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-19 22:42:57 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-19 22:42:57 +0000
commitb2a8e5922426a9b8080f63b757bf302797f83fcc (patch)
treeaf8e272042dc7a45f2dc0769a253036eb035d7e2 /tests
parent447c2cefcb6b52c659f474490377b2721ff6a00a (diff)
fxam test
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1996 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests')
-rw-r--r--tests/test-i386.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-i386.c b/tests/test-i386.c
index 310a93aebe..df7c1bf8e3 100644
--- a/tests/test-i386.c
+++ b/tests/test-i386.c
@@ -789,6 +789,12 @@ void test_fcmp(double a, double b)
a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C));
}
fpu_clear_exceptions();
+ asm volatile("fxam\n"
+ "fstsw %%ax\n"
+ : "=a" (fpus)
+ : "t" (a));
+ printf("fxam(%f)=%04lx\n", a, fpus & 0x4700);
+ fpu_clear_exceptions();
}
void test_fcvt(double a)
@@ -958,12 +964,17 @@ void test_floats(void)
test_fcmp(2, 3);
test_fcmp(2, q_nan.d);
test_fcmp(q_nan.d, -1);
+ test_fcmp(-1.0/0.0, -1);
+ test_fcmp(1.0/0.0, -1);
test_fcvt(0.5);
test_fcvt(-0.5);
test_fcvt(1.0/7.0);
test_fcvt(-1.0/9.0);
test_fcvt(32768);
test_fcvt(-1e20);
+ test_fcvt(-1.0/0.0);
+ test_fcvt(1.0/0.0);
+ test_fcvt(q_nan.d);
test_fconst();
test_fbcd(1234567890123456);
test_fbcd(-123451234567890);