41#if defined(__SSE4_1__)
51 _mm_setcsr(_mm_getcsr() | 0x8040);
52#elif defined(__amd64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
56 unsigned int flags = 0x8000;
57 alignas(16) uint8_t buf[512] = {0};
58 #if defined(__amd64__) || defined(_M_AMD64)
60 #elif defined(__i386__) || defined(_M_IX86)
63 flags |= buf[28] & 0x0040;
64 _mm_setcsr(_mm_getcsr() | flags);
65#elif defined(_M_ARM64)
69 _WriteStatusReg(0x5a20, _ReadStatusReg(0x5a20) | 0x1000000);
75 _controlfp(0x03000000, 0x1000000);
76#elif defined(__aarch64__)
79 __asm__
volatile (
"mrs %0, fpcr" :
"=r" (fpcr));
80 __asm__
volatile (
"msr fpcr, %0" ::
"ri" (fpcr | 0x1000000));
84 __asm__
volatile (
"vmrs %0, fpscr" :
"=r" (fpscr));
85 __asm__
volatile (
"vmsr fpscr, %0" ::
"ri" (fpscr | 0x1000000));
87 #warning nec_disable_denormals() is not implemented on this architecture and will have no effect.
static void nec_disable_denormals(void)
Disable IEEE 754 denormals on the current thread.
Definition denormals.h:40
static void nec_enable_denormals(void)
Enable IEEE 754 denormals on the current thread.
Definition denormals.h:97