9 #ifndef TEMPUS_UNIT_TEST_MAIN_UTILS_HPP
10 #define TEMPUS_UNIT_TEST_MAIN_UTILS_HPP
12 #if defined(__linux__) && defined(__GNUC__) && !defined(__INTEL_COMPILER)
14 #elif defined(__APPLE__) && defined(__GNUC__) && defined(__SSE__)
15 #include <xmmintrin.h>
19 namespace Tempus_Test {
31 #if defined(__APPLE__) && defined(__GNUC__) && defined(__SSE__)
32 static int eMask = _MM_GET_EXCEPTION_MASK();
36 #if defined(__linux__) && defined(__GNUC__) && !defined(__INTEL_COMPILER)
37 feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
38 #elif defined(__APPLE__) && defined(__GNUC__) && defined(__SSE__)
39 eMask = _MM_GET_EXCEPTION_MASK();
40 _MM_SET_EXCEPTION_MASK(eMask & ~_MM_MASK_DIV_ZERO
45 #if defined(__linux__) && defined(__GNUC__) && !defined(__INTEL_COMPILER)
46 fedisableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
47 #elif defined(__APPLE__) && defined(__GNUC__) && defined(__SSE__)
48 _MM_SET_EXCEPTION_MASK(eMask);
55 #endif // TEMPUS_UNIT_TEST_MAIN_UTILS_HPP
void enableFPE(bool enableFPE)
Enable Floating Point Exceptions.