bug #1178: Simplified modification of the SSE control register for better portability

This commit is contained in:
Christoph Hertzberg 2016-03-20 10:59:45 +01:00
parent b4388ee38b
commit ea12669f7a

View File

@ -44,15 +44,10 @@
#define BTL_ASM_COMMENT(X) #define BTL_ASM_COMMENT(X)
#endif #endif
#if (defined __GNUC__) && (!defined __INTEL_COMPILER) && !defined(__arm__) && !defined(__powerpc__) #ifdef __SSE__
#define BTL_DISABLE_SSE_EXCEPTIONS() { \ #include "xmmintrin.h"
int aux; \ // This enables flush to zero (FTZ) and denormals are zero (DAZ) modes:
asm( \ #define BTL_DISABLE_SSE_EXCEPTIONS() { _mm_setcsr(_mm_getcsr() | 0x8040); }
"stmxcsr %[aux] \n\t" \
"orl $32832, %[aux] \n\t" \
"ldmxcsr %[aux] \n\t" \
: : [aux] "m" (aux)); \
}
#else #else
#define BTL_DISABLE_SSE_EXCEPTIONS() #define BTL_DISABLE_SSE_EXCEPTIONS()
#endif #endif