1 // commit: f657fe4b9f734d7fdea515af8dffbf7c28ce4fbc 2013-09-05
2 // classify invalid x86 ld80 representations (this is ub, we follow the fpu)
9 static char *strclass(int c)
11 #define C(n) case n: return #n;
22 #define T(desc,got,want) do{ \
23 if (got!=want) t_error("fpclassify(%s) failed: got %s want %s\n", desc, strclass(got), #want); \
38 u.i.m = (uint64_t)1<<63;
40 T("zero with msb set", c, FP_NORMAL);
43 T("subnormal with msb set", c, FP_NORMAL);
47 T("normal with msb unset", c, FP_NAN);
51 T("infinity with msb unset", c, FP_NAN);
53 u.i.m&=(uint64_t)-1/2;
55 T("nan with msb unset", c, FP_NAN);