1 #ifndef art_Framework_Services_System_detail_fpControl_h 2 #define art_Framework_Services_System_detail_fpControl_h 5 #if defined __i386__ || defined __x86_64__ 8 #define fpControl_DENORMALOPERAND __FE_DENORM 9 #include <fpu_control.h> 10 #define fpControl_EXTENDED_PREC _FPU_EXTENDED 11 #define fpControl_DOUBLE_PREC _FPU_DOUBLE 12 #define fpControl_SINGLE_PREC _FPU_SINGLE 13 #elif defined __APPLE__ 15 #pragma STDC FENV_ACCESS ON 17 #define fpControl_DENORMALOPERAND FE_DENORMALOPERAND 18 #define fpControl_EXTENDED_PREC 0x300 19 #define fpControl_DOUBLE_PREC 0x200 20 #define fpControl_SINGLE_PREC 0x0 22 #error OS not valid for FP control 24 #define fpControl_ALL_PREC \ 25 (fpControl_EXTENDED_PREC | fpControl_DOUBLE_PREC | fpControl_SINGLE_PREC) 27 #define fpControl_HAVE_MXCSR 31 #define fpControl_FZ 0x8000 33 #define fpControl_R_PLUS 0x4000 35 #define fpControl_R_MINUS 0x2000 37 #define fpControl_RZ (fpControl_R_PLUS | fpControl_R_MINUS) 39 #define fpControl_RN_MASK fpControl_RZ 41 #define fpControl_PM_MASK (0x1000) 43 #define fpControl_UM_MASK (0x0800) 45 #define fpControl_OM_MASK (0x0400) 47 #define fpControl_ZM_MASK (0x0200) 49 #define fpControl_DM_MASK (0x0100) 51 #define fpControl_IM_MASK (0x0080) 53 #define fpControl_DAX 0x0040 55 #define fpControl_PE 0x0020 57 #define fpControl_UE 0x0010 59 #define fpControl_OE 0x0008 61 #define fpControl_ZE 0x0004 63 #define fpControl_DE 0x0002 65 #define fpControl_IE 0x0001 67 #define fpControl_ALL_SSE_EXCEPT 0x1f80 69 #define fpControl_ALL_SSE_FLAGS 0x3f 72 #error Architecture not valid for FP control 80 SINGLE = fpControl_SINGLE_PREC,
81 DOUBLE = fpControl_DOUBLE_PREC,
87 decltype(fenv_t::__status_word)
89 decltype(fenv_t::__status)
95 decltype(fenv_t::__control_word)
97 decltype(fenv_t::__control)
101 #ifdef fpControl_HAVE_MXCSR 102 using mxcsr_t = decltype(fenv_t::__mxcsr);
107 #ifdef fpControl_HAVE_MXCSR 117 #ifdef fpControl_HAVE_MXCSR 119 mxcsr_t setMXCSR(mxcsr_t mxcsr);
133 #ifdef fpControl_HAVE_MXCSR 145 #ifdef fpControl_HAVE_MXCSR 147 setMXCSR(fpControl.mxcsr)
156 return b ?
" on " :
" off";
fpcw_t setFPCW(fpcw_t fpcw)
char const * on_or_off(bool const b)
fp_control_t getFPControl()
fp_control_t setFPControl(fp_control_t const &fpControl)