Commit e1d92059 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9: Implement FPUSETUP for msvc.

parent 35f2e91f
...@@ -3306,6 +3306,11 @@ static void setup_fpu(void) ...@@ -3306,6 +3306,11 @@ static void setup_fpu(void)
__asm__ volatile ("fnstcw %0" : "=m" (cw)); __asm__ volatile ("fnstcw %0" : "=m" (cw));
cw = (cw & ~0xf3f) | 0x3f; cw = (cw & ~0xf3f) | 0x3f;
__asm__ volatile ("fldcw %0" : : "m" (cw)); __asm__ volatile ("fldcw %0" : : "m" (cw));
#elif defined(__i386__) && defined(_MSC_VER)
WORD cw;
__asm fnstcw cw;
cw = (cw & ~0xf3f) | 0x3f;
__asm fldcw cw;
#else #else
FIXME("FPU setup not implemented for this platform.\n"); FIXME("FPU setup not implemented for this platform.\n");
#endif #endif
......
...@@ -2913,8 +2913,13 @@ cleanup: ...@@ -2913,8 +2913,13 @@ cleanup:
static inline void set_fpu_cw(WORD cw) static inline void set_fpu_cw(WORD cw)
{ {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define D3D9_TEST_SET_FPU_CW 1
__asm__ volatile ("fnclex"); __asm__ volatile ("fnclex");
__asm__ volatile ("fldcw %0" : : "m" (cw)); __asm__ volatile ("fldcw %0" : : "m" (cw));
#elif defined(__i386__) && defined(_MSC_VER)
#define D3D9_TEST_SET_FPU_CW 1
__asm fnclex;
__asm fldcw cw;
#endif #endif
} }
...@@ -2922,14 +2927,18 @@ static inline WORD get_fpu_cw(void) ...@@ -2922,14 +2927,18 @@ static inline WORD get_fpu_cw(void)
{ {
WORD cw = 0; WORD cw = 0;
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define D3D9_TEST_GET_FPU_CW 1
__asm__ volatile ("fnstcw %0" : "=m" (cw)); __asm__ volatile ("fnstcw %0" : "=m" (cw));
#elif defined(__i386__) && defined(_MSC_VER)
#define D3D9_TEST_GET_FPU_CW 1
__asm fnstcw cw;
#endif #endif
return cw; return cw;
} }
static void test_fpu_setup(void) static void test_fpu_setup(void)
{ {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #if defined(D3D9_TEST_SET_FPU_CW) && defined(D3D9_TEST_GET_FPU_CW)
D3DPRESENT_PARAMETERS present_parameters; D3DPRESENT_PARAMETERS present_parameters;
IDirect3DDevice9 *device; IDirect3DDevice9 *device;
HWND window = NULL; HWND window = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment