33#include "../inc/cdefs-compat.h"
34#include "../inc/types-compat.h"
37#define __fenv_static static
53#define __get_mxcsr(env) (((env).__mxcsr_hi << 16) | \
56#define __set_mxcsr(env, x) do { \
57 (env).__mxcsr_hi = (uint32_t)(x) >> 16; \
58 (env).__mxcsr_lo = (uint16_t)(x); \
64#define FE_INVALID 0x01
65#define FE_DENORMAL 0x02
66#define FE_DIVBYZERO 0x04
67#define FE_OVERFLOW 0x08
68#define FE_UNDERFLOW 0x10
69#define FE_INEXACT 0x20
70#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_DENORMAL | FE_INEXACT | \
71 FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
74#define FE_TONEAREST 0x0000
75#define FE_DOWNWARD 0x0400
76#define FE_UPWARD 0x0800
77#define FE_TOWARDZERO 0x0c00
78#define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \
79 FE_UPWARD | FE_TOWARDZERO)
86#define _SSE_ROUND_SHIFT 3
87#define _SSE_EMASK_SHIFT 7
98#define __HAS_SSE() (__has_sse == __SSE_YES || \
99 (__has_sse == __SSE_UNK && __test_sse()))
104#define FE_DFL_ENV (&__fe_dfl_env)
107#define __fldcw(__cw) __asm __volatile("fldcw %0" : : "m" (__cw))
108#define __fldenv(__env) __asm __volatile("fldenv %0" : : "m" (__env))
109#define __fldenvx(__env) __asm __volatile("fldenv %0" : : "m" (__env) \
110 : "st", "st(1)", "st(2)", "st(3)", "st(4)", \
111 "st(5)", "st(6)", "st(7)")
112#define __fnclex() __asm __volatile("fnclex")
113#define __fnstenv(__env) __asm __volatile("fnstenv %0" : "=m" (*(__env)))
114#define __fnstcw(__cw) __asm __volatile("fnstcw %0" : "=m" (*(__cw)))
115#define __fnstsw(__sw) __asm __volatile("fnstsw %0" : "=am" (*(__sw)))
116#define __fwait() __asm __volatile("fwait")
117#define __ldmxcsr(__csr) __asm __volatile("ldmxcsr %0" : : "m" (__csr))
118#define __stmxcsr(__csr) __asm __volatile("stmxcsr %0" : "=m" (*(__csr)))
120#define __fldcw(__cw) __asm { __asm fldcw __cw }
121#define __fldenv(__env) __asm { __asm fldenv __env }
122#define __fnclex() __asm { __asm fnclex }
123#define __fnstenv(__env) __asm { __asm fnstenv (__env) }
124#define __fnstcw(__cw) __asm { __asm fnstcw __cw }
125#define __fnstsw(__sw) __asm { __asm fnstsw __sw }
126#define __fwait() __asm { __asm fwait }
127#define __ldmxcsr(__csr) __asm { __asm ldmxcsr __csr }
128#define __stmxcsr(__csr) __asm { __asm stmxcsr __csr }
147 __mxcsr &= ~__excepts;
168 __mxcsr &= ~__excepts;
187 *__flagp = (__mxcsr | __status) & __excepts;
204 *__flagp = (
fexcept_t)((__mxcsr | __status) & __excepts);
225 return ((__status | __mxcsr) & __excepts);
253 __control &= ~_ROUND_MASK;
254 __control |= __round;
__fenv_static int fesetround(int __round)
__fenv_static int fetestexcept(int __excepts)
OLM_DLLEXPORT int feraiseexcept(int __excepts)
OLM_DLLEXPORT int feupdateenv(const fenv_t *__envp)
OLM_DLLEXPORT int feholdexcept(fenv_t *__envp)
#define __set_mxcsr(env, x)
const fenv_t __fe_dfl_env
__fenv_static int fegetexceptflag(fexcept_t *__flagp, int __excepts)
enum __sse_support __has_sse
__fenv_static int fegetround(void)
__fenv_static int fesetenv(const fenv_t *__envp)
__fenv_static int feclearexcept(int __excepts)
OLM_DLLEXPORT int fegetenv(fenv_t *__envp)
OLM_DLLEXPORT int fesetexceptflag(const fexcept_t *__flagp, int __excepts)
unsigned __int16 uint16_t
unsigned __int32 uint32_t