Lines 108-119
Link Here
|
108 |
|
108 |
|
109 |
#ifdef __GNUCLIKE_ASM |
109 |
#ifdef __GNUCLIKE_ASM |
110 |
|
110 |
|
111 |
#define __fldcw(addr) __asm __volatile("fldcw %0" : : "m" (*(addr))) |
111 |
#include <fenv.h> |
112 |
#define __fldenv(addr) __asm __volatile("fldenv %0" : : "m" (*(addr))) |
|
|
113 |
#define __fnclex() __asm __volatile("fnclex") |
114 |
#define __fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) |
115 |
#define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr))) |
116 |
#define __fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) |
117 |
|
112 |
|
118 |
/* |
113 |
/* |
119 |
* Load the control word. Be careful not to trap if there is a currently |
114 |
* Load the control word. Be careful not to trap if there is a currently |
Lines 136-146
Link Here
|
136 |
if (((_sw & ~_cw) & FP_STKY_FLD) != 0) { |
131 |
if (((_sw & ~_cw) & FP_STKY_FLD) != 0) { |
137 |
__fnstenv(&_env); |
132 |
__fnstenv(&_env); |
138 |
_env._cw = _newcw; |
133 |
_env._cw = _newcw; |
139 |
__fldenv(&_env); |
134 |
__fldenv(_env); |
140 |
return; |
135 |
return; |
141 |
} |
136 |
} |
142 |
} |
137 |
} |
143 |
__fldcw(&_newcw); |
138 |
__fldcw(_newcw); |
144 |
} |
139 |
} |
145 |
|
140 |
|
146 |
static __inline fp_rnd_t |
141 |
static __inline fp_rnd_t |
Lines 249-255
Link Here
|
249 |
} |
244 |
} |
250 |
__fnstenv(&_env); |
245 |
__fnstenv(&_env); |
251 |
_env._sw &= ~_m; |
246 |
_env._sw &= ~_m; |
252 |
__fldenv(&_env); |
247 |
__fldenv(_env); |
253 |
return (_p); |
248 |
return (_p); |
254 |
} |
249 |
} |
255 |
|
250 |
|