Commit b2a8e5922426a9b8080f63b757bf302797f83fcc
1 parent
447c2cef
fxam test
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1996 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
0 deletions
tests/test-i386.c
| ... | ... | @@ -789,6 +789,12 @@ void test_fcmp(double a, double b) |
| 789 | 789 | a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C)); |
| 790 | 790 | } |
| 791 | 791 | fpu_clear_exceptions(); |
| 792 | + asm volatile("fxam\n" | |
| 793 | + "fstsw %%ax\n" | |
| 794 | + : "=a" (fpus) | |
| 795 | + : "t" (a)); | |
| 796 | + printf("fxam(%f)=%04lx\n", a, fpus & 0x4700); | |
| 797 | + fpu_clear_exceptions(); | |
| 792 | 798 | } |
| 793 | 799 | |
| 794 | 800 | void test_fcvt(double a) |
| ... | ... | @@ -958,12 +964,17 @@ void test_floats(void) |
| 958 | 964 | test_fcmp(2, 3); |
| 959 | 965 | test_fcmp(2, q_nan.d); |
| 960 | 966 | test_fcmp(q_nan.d, -1); |
| 967 | + test_fcmp(-1.0/0.0, -1); | |
| 968 | + test_fcmp(1.0/0.0, -1); | |
| 961 | 969 | test_fcvt(0.5); |
| 962 | 970 | test_fcvt(-0.5); |
| 963 | 971 | test_fcvt(1.0/7.0); |
| 964 | 972 | test_fcvt(-1.0/9.0); |
| 965 | 973 | test_fcvt(32768); |
| 966 | 974 | test_fcvt(-1e20); |
| 975 | + test_fcvt(-1.0/0.0); | |
| 976 | + test_fcvt(1.0/0.0); | |
| 977 | + test_fcvt(q_nan.d); | |
| 967 | 978 | test_fconst(); |
| 968 | 979 | test_fbcd(1234567890123456); |
| 969 | 980 | test_fbcd(-123451234567890); | ... | ... |