Browse Source

Merge pull request #901 from Winterleaf/winMath_ASM.cpp

FFP 64bit
Daniel Buckmaster 10 years ago
parent
commit
50183c6a2a
1 changed files with 9 additions and 7 deletions
  1. 9 7
      Engine/source/platformWin32/winMath_ASM.cpp

+ 9 - 7
Engine/source/platformWin32/winMath_ASM.cpp

@@ -91,25 +91,27 @@ void Platform::setMathControlStateKnown()
       fldcw cw
       fldcw cw
    }
    }
 }
 }
-
 #else
 #else
-
+// @source http://msdn.microsoft.com/en-us/library/c9676k6h.aspx
 U32 Platform::getMathControlState( )
 U32 Platform::getMathControlState( )
 {
 {
-   // @todo x64 See http://msdn.microsoft.com/en-us/library/c9676k6h.aspx
-   return 0;
+   U32 control_word = 0;
+   S32 error = _controlfp_s( &control_word, _DN_FLUSH, _MCW_DN );
+
+   return error ? 0 : control_word;
 }
 }
 
 
 void Platform::setMathControlState( U32 state )
 void Platform::setMathControlState( U32 state )
 {
 {
-   // @todo x64 See http://msdn.microsoft.com/en-us/library/c9676k6h.aspx
+   U32 control_word = 0;
+   _controlfp_s( &control_word, state, _MCW_DN );
 }
 }
 
 
 void Platform::setMathControlStateKnown( )
 void Platform::setMathControlStateKnown( )
 {
 {
-   // @todo x64 See http://msdn.microsoft.com/en-us/library/c9676k6h.aspx
+   U32 control_word = 0;
+   _controlfp_s (&control_word, _PC_64, _MCW_DN);
 }
 }
-
 #endif
 #endif
 
 
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------