Commit b2a8e5922426a9b8080f63b757bf302797f83fcc

Authored by bellard
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,6 +789,12 @@ void test_fcmp(double a, double b)
789 a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C)); 789 a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C));
790 } 790 }
791 fpu_clear_exceptions(); 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 void test_fcvt(double a) 800 void test_fcvt(double a)
@@ -958,12 +964,17 @@ void test_floats(void) @@ -958,12 +964,17 @@ void test_floats(void)
958 test_fcmp(2, 3); 964 test_fcmp(2, 3);
959 test_fcmp(2, q_nan.d); 965 test_fcmp(2, q_nan.d);
960 test_fcmp(q_nan.d, -1); 966 test_fcmp(q_nan.d, -1);
  967 + test_fcmp(-1.0/0.0, -1);
  968 + test_fcmp(1.0/0.0, -1);
961 test_fcvt(0.5); 969 test_fcvt(0.5);
962 test_fcvt(-0.5); 970 test_fcvt(-0.5);
963 test_fcvt(1.0/7.0); 971 test_fcvt(1.0/7.0);
964 test_fcvt(-1.0/9.0); 972 test_fcvt(-1.0/9.0);
965 test_fcvt(32768); 973 test_fcvt(32768);
966 test_fcvt(-1e20); 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 test_fconst(); 978 test_fconst();
968 test_fbcd(1234567890123456); 979 test_fbcd(1234567890123456);
969 test_fbcd(-123451234567890); 980 test_fbcd(-123451234567890);