|
16 | 16 | #define rint16D(a,b) __asm__ __volatile__("fistps %0": "=m"(a): "t"(b): "st") |
17 | 17 | #define rint32F rint32D |
18 | 18 | #define rint16F rint16D |
19 | | - #define FE_INVALID 1 |
20 | | - static __inline int fe_test_invalid(void) { |
21 | | - int status_word; |
22 | | - __asm__ __volatile__("fnstsw %%ax": "=a"(status_word)); |
23 | | - return status_word & FE_INVALID; |
24 | | - } |
25 | | - static __inline int fe_clear_invalid(void) { |
26 | | - int32_t status[7]; |
27 | | - __asm__ __volatile__("fnstenv %0": "=m"(status)); |
28 | | - status[1] &= ~FE_INVALID; |
29 | | - __asm__ __volatile__("fldenv %0": : "m"(*status)); |
30 | | - return 0; |
31 | | - } |
| 19 | + //#define FE_INVALID 1 |
| 20 | + // static __inline int fe_test_invalid(void) { |
| 21 | + // int status_word; |
| 22 | + // __asm__ __volatile__("fnstsw %%ax": "=a"(status_word)); |
| 23 | + // return status_word & FE_INVALID; |
| 24 | + // } |
| 25 | + // static __inline int fe_clear_invalid(void) { |
| 26 | + // int32_t status[7]; |
| 27 | + // __asm__ __volatile__("fnstenv %0": "=m"(status)); |
| 28 | + // status[1] &= ~FE_INVALID; |
| 29 | + // __asm__ __volatile__("fldenv %0": : "m"(*status)); |
| 30 | + // return 0; |
| 31 | + // } |
32 | 32 | #elif defined _MSC_VER && defined _M_IX86 |
33 | 33 | #define FPU_RINT32 |
34 | 34 | #define FPU_RINT16 |
|
42 | 42 | #define rint32F(y,x) rint32f(&(y),x) |
43 | 43 | #define rint16D(y,x) rint16d(&(y),x) |
44 | 44 | #define rint16F(y,x) rint16f(&(y),x) |
45 | | - #define FE_INVALID 1 |
46 | | - static __inline int fe_test_invalid(void) { |
47 | | - short status_word; |
48 | | - __asm fnstsw status_word |
49 | | - return status_word & FE_INVALID; |
50 | | - } |
51 | | - static __inline int fe_clear_invalid(void) { |
52 | | - int32_t status[7]; |
53 | | - __asm fnstenv status |
54 | | - status[1] &= ~FE_INVALID; |
55 | | - __asm fldenv status |
56 | | - return 0; |
57 | | - } |
| 45 | + //#define FE_INVALID 1 |
| 46 | + // static __inline int fe_test_invalid(void) { |
| 47 | + // short status_word; |
| 48 | + // __asm fnstsw status_word |
| 49 | + // return status_word & FE_INVALID; |
| 50 | + // } |
| 51 | + // static __inline int fe_clear_invalid(void) { |
| 52 | + // int32_t status[7]; |
| 53 | + // __asm fnstenv status |
| 54 | + // status[1] &= ~FE_INVALID; |
| 55 | + // __asm fldenv status |
| 56 | + // return 0; |
| 57 | + // } |
58 | 58 | #elif defined _MSC_VER && defined _M_X64 |
59 | 59 | #include <emmintrin.h> |
60 | 60 | #include <float.h> |
|
70 | 70 | #define rint32F(y,x) rint32f(&(y),x) |
71 | 71 | #define rint16D(y,x) rint16d(&(y),x) |
72 | 72 | #define rint16F(y,x) rint16d(&(y),(double)(x)) |
73 | | - #define FE_INVALID 1 |
74 | | - #define fe_test_invalid() (_statusfp() & _SW_INVALID) |
75 | | - #define fe_clear_invalid _clearfp /* Note: clears all. */ |
| 73 | + //#define FE_INVALID 1 |
| 74 | + // #define fe_test_invalid() (_statusfp() & _SW_INVALID) |
| 75 | + // #define fe_clear_invalid _clearfp /* Note: clears all. */ |
76 | 76 | #elif HAVE_LRINT && LONG_MAX == 2147483647L && HAVE_FENV_H |
77 | 77 | #include <math.h> |
78 | 78 | #include <fenv.h> |
79 | 79 | #define FPU_RINT32 |
80 | 80 | #define rint32D(y,x) ((y)=lrint(x)) |
81 | 81 | #define rint32F(y,x) ((y)=lrintf(x)) |
82 | | - #define fe_test_invalid() fetestexcept(FE_INVALID) |
83 | | - #define fe_clear_invalid() feclearexcept(FE_INVALID) |
| 82 | + // #define fe_test_invalid() fetestexcept(FE_INVALID) |
| 83 | + // #define fe_clear_invalid() feclearexcept(FE_INVALID) |
84 | 84 | #endif |
85 | 85 |
|
86 | 86 | #if !defined FPU_RINT32 |
|
0 commit comments