aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-09-16 01:44:45 -0700
committerChris Robinson <[email protected]>2012-09-16 01:44:45 -0700
commita1daec66e29cf90132d4a5e51e00b04a162f15be (patch)
tree8f6dc98a0e1100d7bdd18fc7c663c251b418f143 /Alc
parent657ee85136861c9da105a67050ae84a85ecfe808 (diff)
Use __control87_2 when available
Diffstat (limited to 'Alc')
-rw-r--r--Alc/helpers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c
index 5acf2be2..625c9c96 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -185,6 +185,10 @@ void SetMixerFPUMode(FPUCtl *ctl)
if((CPUCapFlags&CPU_CAP_SSE))
newState |= 0x8000; /* flush-to-zero */
_FPU_SETCW(newState);
+#elif defined(HAVE___CONTROL87_2)
+ int mode;
+ __control87_2(0, 0, &ctl->state, NULL);
+ __control87_2(_RC_CHOP|_DN_FLUSH|_PC_24, _MCW_RC|_MCW_DN|_MCW_PC, &mode, NULL);
#elif defined(HAVE__CONTROLFP)
ctl->state = _controlfp(0, 0);
(void)_controlfp(_RC_CHOP|_DN_FLUSH|_PC_24, _MCW_RC|_MCW_DN|_MCW_PC);
@@ -201,6 +205,9 @@ void RestoreFPUMode(const FPUCtl *ctl)
#if defined(_FPU_GETCW) && defined(_FPU_SETCW) && (defined(__i386__) || defined(__x86_64__))
fpu_control_t fpuState = ctl->state;
_FPU_SETCW(fpuState);
+#elif defined(HAVE___CONTROL87_2)
+ int mode;
+ __control87_2(ctl->state, _MCW_RC|_MCW_DN|_MCW_PC, &mode, NULL);
#elif defined(HAVE__CONTROLFP)
_controlfp(ctl->state, _MCW_RC|_MCW_DN|_MCW_PC);
#elif defined(HAVE_FESETROUND)