Precision control bits don't exist with SSE

This commit is contained in:
Chris Robinson 2012-09-18 15:08:36 -07:00
parent eedbd1e81c
commit f0732426f2

View File

@ -194,8 +194,7 @@ void SetMixerFPUMode(FPUCtl *ctl)
int sseState;
__asm__ __volatile__("stmxcsr %0" : "=m" (*&sseState));
ctl->sse_state = sseState;
sseState &= ~0x300; /* clear precision to single */
sseState |= 0xC00; /* set round-to-zero */
sseState |= 0x0C00; /* set round-to-zero */
sseState |= 0x8000; /* set flush-to-zero */
__asm__ __volatile__("ldmxcsr %0" : : "m" (*&sseState));
}
@ -206,7 +205,7 @@ void SetMixerFPUMode(FPUCtl *ctl)
__control87_2(_RC_CHOP|_PC_24, _MCW_RC|_MCW_PC, &mode, NULL);
#ifdef HAVE_SSE
if((CPUCapFlags&CPU_CAP_SSE))
__control87_2(_RC_CHOP|_PC_24|_DN_FLUSH, _MCW_RC|_MCW_PC|_MCW_DN, NULL, &mode);
__control87_2(_RC_CHOP|_DN_FLUSH, _MCW_RC|_MCW_DN, NULL, &mode);
#endif
#elif defined(HAVE__CONTROLFP)
ctl->state = _controlfp(0, 0);
@ -233,7 +232,7 @@ void RestoreFPUMode(const FPUCtl *ctl)
__control87_2(ctl->state, _MCW_RC|_MCW_PC, &mode, NULL);
#ifdef HAVE_SSE
if((CPUCapFlags&CPU_CAP_SSE))
__control87_2(ctl->sse_state, _MCW_RC|_MCW_PC|_MCW_DN, NULL, &mode);
__control87_2(ctl->sse_state, _MCW_RC|_MCW_DN, NULL, &mode);
#endif
#elif defined(HAVE__CONTROLFP)
_controlfp(ctl->state, _MCW_RC|_MCW_PC);