diff options
-rw-r--r-- | vecmathlib.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/vecmathlib.h b/vecmathlib.h index aa81110..7818b26 100644 --- a/vecmathlib.h +++ b/vecmathlib.h @@ -12,11 +12,9 @@ # define VML_DEBUG #endif -#undef VML_HAVE_DENORMALS -#undef VML_HAVE_FP_CONTRACT // see below -#undef VML_HAVE_INF -#undef VML_HAVE_NAN -#define VML_HAVE_SIGNED_ZERO + + +// FP settings // Possible effects of not having VML_HAVE_FP_CONTRACT: // - can re-associate @@ -24,6 +22,25 @@ // - can break ties differently when rounding (?) // - can evaluate functions with reduced precision (80% of significant digits) +// default settings +#define VML_HAVE_DENORMALS +#define VML_HAVE_FP_CONTRACT +#define VML_HAVE_INF +#define VML_HAVE_NAN +#define VML_HAVE_SIGNED_ZERO + +// optimized settings +#ifdef __FAST_MATH__ +# undef VML_HAVE_DENORMALS +# undef VML_HAVE_FP_CONTRACT +# undef VML_HAVE_INF +# undef VML_HAVE_NAN +#endif + +#warning "TODO: introduce mad, as fast version of fma" +#warning "TODO: introduce ieee_isnan and friends" +#warning "TODO: switch between isnan and ieee_isnan at an outside level" + // This workaround is needed for older libstdc++ versions such as the |