From 125901648af729ddad49c464b437bbee067bbd57 Mon Sep 17 00:00:00 2001 From: Vincent Gee Date: Tue, 4 Nov 2014 07:19:14 -0500 Subject: [PATCH] 64bit, from @source http://msdn.microsoft.com/en-us/library/c9676k6h.aspx --- Engine/source/platformWin32/winMath_ASM.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Engine/source/platformWin32/winMath_ASM.cpp b/Engine/source/platformWin32/winMath_ASM.cpp index 53150afa0..16e0b8b6f 100644 --- a/Engine/source/platformWin32/winMath_ASM.cpp +++ b/Engine/source/platformWin32/winMath_ASM.cpp @@ -91,25 +91,27 @@ void Platform::setMathControlStateKnown() fldcw cw } } - #else - +// @source http://msdn.microsoft.com/en-us/library/c9676k6h.aspx 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 ) { - // @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( ) { - // @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 //------------------------------------------------------------------------------