|
@@ -31,6 +31,8 @@ |
|
|
#include <dbghelp.h> |
|
|
#include <dbghelp.h> |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include <simd/common.hpp> // for _mm_getcsr etc |
|
|
|
|
|
|
|
|
#include <archive.h> |
|
|
#include <archive.h> |
|
|
#include <archive_entry.h> |
|
|
#include <archive_entry.h> |
|
|
#if defined ARCH_MAC |
|
|
#if defined ARCH_MAC |
|
@@ -971,7 +973,7 @@ void setFpuFlags(uint32_t flags) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void resetFpuFlags() { |
|
|
void resetFpuFlags() { |
|
|
uint32_t flags = 0; |
|
|
|
|
|
|
|
|
uint32_t flags = getFpuFlags(); |
|
|
|
|
|
|
|
|
#if defined ARCH_X64 |
|
|
#if defined ARCH_X64 |
|
|
// Set CPU to flush-to-zero (FTZ) and denormals-are-zero (DAZ) mode |
|
|
// Set CPU to flush-to-zero (FTZ) and denormals-are-zero (DAZ) mode |
|
@@ -981,11 +983,13 @@ void resetFpuFlags() { |
|
|
// _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); |
|
|
// _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); |
|
|
flags |= 0x0040; |
|
|
flags |= 0x0040; |
|
|
// Round-to-nearest is default |
|
|
// Round-to-nearest is default |
|
|
|
|
|
flags &= ~0x6000; |
|
|
#elif defined ARCH_ARM64 |
|
|
#elif defined ARCH_ARM64 |
|
|
// Set Flush-to-Zero |
|
|
// Set Flush-to-Zero |
|
|
flags |= 1 << 24; |
|
|
flags |= 1 << 24; |
|
|
// ARM64 always uses DAZ |
|
|
// ARM64 always uses DAZ |
|
|
// Round-to-nearest is default |
|
|
// Round-to-nearest is default |
|
|
|
|
|
flags &= ~((1 << 22) | (1 << 23)); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
setFpuFlags(flags); |
|
|
setFpuFlags(flags); |
|
|