ieeefp.h (143063) | ieeefp.h (143658) |
---|---|
1/*- 2 * Copyright (c) 2003 Peter Wemm. 3 * Copyright (c) 1990 Andrew Moore, Talke Studio 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * from: @(#) ieeefp.h 1.0 (Berkeley) 9/23/93 | 1/*- 2 * Copyright (c) 2003 Peter Wemm. 3 * Copyright (c) 1990 Andrew Moore, Talke Studio 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * from: @(#) ieeefp.h 1.0 (Berkeley) 9/23/93 |
35 * $FreeBSD: head/sys/amd64/include/ieeefp.h 143063 2005-03-02 21:33:29Z joerg $ | 35 * $FreeBSD: head/sys/amd64/include/ieeefp.h 143658 2005-03-15 15:53:39Z das $ |
36 */ 37 38/* 39 * IEEE floating point type and constant definitions. 40 */ 41 42#ifndef _MACHINE_IEEEFP_H_ 43#define _MACHINE_IEEEFP_H_ --- 200 unchanged lines hidden (view full) --- 244 245 __fnstsw(&_sw); 246 _ex = _sw & FP_STKY_FLD; 247 __stmxcsr(&_mxcsr); 248 _ex |= _mxcsr & SSE_STKY_FLD; 249 return (_ex); 250} 251 | 36 */ 37 38/* 39 * IEEE floating point type and constant definitions. 40 */ 41 42#ifndef _MACHINE_IEEEFP_H_ 43#define _MACHINE_IEEEFP_H_ --- 200 unchanged lines hidden (view full) --- 244 245 __fnstsw(&_sw); 246 _ex = _sw & FP_STKY_FLD; 247 __stmxcsr(&_mxcsr); 248 _ex |= _mxcsr & SSE_STKY_FLD; 249 return (_ex); 250} 251 |
252/* Note that this should really be called fpresetsticky() */ 253static __inline__ fp_except_t 254__fpsetsticky(fp_except_t _m) 255{ 256 unsigned _env[7]; 257 unsigned int _mxcsr; 258 fp_except_t _p; 259 260 __fnstenv(_env); 261 _p = _env[FP_STKY_REG] & _m; 262 __stmxcsr(&_mxcsr); 263 _p |= _mxcsr & SSE_STKY_FLD; 264 _env[FP_STKY_REG] &= ~_m; 265 __fldenv(_env); 266 _mxcsr &= ~_m; 267 __ldmxcsr(&_mxcsr); 268 return (_p); 269} 270 | |
271#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE__ && !__cplusplus */ 272 273#if !defined(__IEEEFP_NOINLINES__) && !defined(__cplusplus) \ 274 && defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE__) 275 276#define fpgetround() __fpgetround() 277#define fpsetround(_m) __fpsetround(_m) 278#define fpgetprec() __fpgetprec() 279#define fpsetprec(_m) __fpsetprec(_m) 280#define fpgetmask() __fpgetmask() 281#define fpsetmask(_m) __fpsetmask(_m) 282#define fpgetsticky() __fpgetsticky() | 252#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE__ && !__cplusplus */ 253 254#if !defined(__IEEEFP_NOINLINES__) && !defined(__cplusplus) \ 255 && defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE__) 256 257#define fpgetround() __fpgetround() 258#define fpsetround(_m) __fpsetround(_m) 259#define fpgetprec() __fpgetprec() 260#define fpsetprec(_m) __fpsetprec(_m) 261#define fpgetmask() __fpgetmask() 262#define fpsetmask(_m) __fpsetmask(_m) 263#define fpgetsticky() __fpgetsticky() |
283#define fpsetsticky(_m) __fpsetsticky(_m) | |
284 285/* Suppress prototypes in the MI header. */ 286#define _IEEEFP_INLINED_ 1 287 288#else /* !__IEEEFP_NOINLINES__ && !__cplusplus && __GNUCLIKE_ASM 289 && __CC_SUPPORTS___INLINE__ */ 290 291/* Augment the userland declarations */ 292__BEGIN_DECLS 293extern fp_prec_t fpgetprec(void); 294extern fp_prec_t fpsetprec(fp_prec_t); 295__END_DECLS 296 297#endif /* !__IEEEFP_NOINLINES__ && !__cplusplus && __GNUCLIKE_ASM 298 && __CC_SUPPORTS___INLINE__ */ 299 300#endif /* !_MACHINE_IEEEFP_H_ */ | 264 265/* Suppress prototypes in the MI header. */ 266#define _IEEEFP_INLINED_ 1 267 268#else /* !__IEEEFP_NOINLINES__ && !__cplusplus && __GNUCLIKE_ASM 269 && __CC_SUPPORTS___INLINE__ */ 270 271/* Augment the userland declarations */ 272__BEGIN_DECLS 273extern fp_prec_t fpgetprec(void); 274extern fp_prec_t fpsetprec(fp_prec_t); 275__END_DECLS 276 277#endif /* !__IEEEFP_NOINLINES__ && !__cplusplus && __GNUCLIKE_ASM 278 && __CC_SUPPORTS___INLINE__ */ 279 280#endif /* !_MACHINE_IEEEFP_H_ */ |