summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index b29e161869c..20a0ce064f5 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -57,20 +57,19 @@
#if defined(PIPE_CC_GCC) && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
-#include <fpu_control.h>
-
static void nine_setup_fpu()
{
- fpu_control_t c;
+ uint16_t c;
+
+ __asm__ __volatile__ ("fnstcw %0" : "=m" (*&c));
- _FPU_GETCW(c);
/* clear the control word */
- c &= _FPU_RESERVED;
+ c &= 0xF0C0;
/* d3d9 doc/wine tests: mask all exceptions, use single-precision
* and round to nearest */
- c |= _FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM |
- _FPU_MASK_UM | _FPU_MASK_PM | _FPU_SINGLE | _FPU_RC_NEAREST;
- _FPU_SETCW(c);
+ c |= 0x003F;
+
+ __asm__ __volatile__ ("fldcw %0" : : "m" (*&c));
}
#else