summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2014-05-10 20:26:56 -0700
committershuffle2 <godisgovernment@gmail.com>2014-05-10 20:26:56 -0700
commit2983ae2823cb8ff022d896c98df581064a6bb763 (patch)
treec06e45c20672e93daa24c60a9154ae95c3a57b4b /Source/Core
parent004af614cf1399491d4238faf82a1eeb02463854 (diff)
parent700c1353866bcc4490d6957a1a6a09ef02ffa9bd (diff)
Merge pull request #357 from shuffle2/master
Revert "x64FPURoundMode: always set x87 precision"
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/x64FPURoundMode.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/Core/Common/x64FPURoundMode.cpp b/Source/Core/Common/x64FPURoundMode.cpp
index 1dd2fd18f0..403473ab1a 100644
--- a/Source/Core/Common/x64FPURoundMode.cpp
+++ b/Source/Core/Common/x64FPURoundMode.cpp
@@ -34,6 +34,10 @@ namespace FPURoundMode
void SetPrecisionMode(PrecisionMode mode)
{
+ #ifdef _M_X86_32
+ // sets the floating-point lib to 53-bit
+ // PowerPC has a 53bit floating pipeline only
+ // eg: sscanf is very sensitive
#ifdef _WIN32
_control87(_PC_53, MCW_PC);
#else
@@ -43,10 +47,14 @@ namespace FPURoundMode
2 << 8, // 53 bits
3 << 8, // 64 bits
};
- unsigned short cw;
- asm ("fnstcw %0" : "=m" (cw));
- cw = (cw & ~PRECISION_MASK) | precision_table[mode];
- asm ("fldcw %0" : : "m" (cw));
+ unsigned short _mode;
+ asm ("fstcw %0" : "=m" (_mode));
+ _mode = (_mode & ~PRECISION_MASK) | precision_table[mode];
+ asm ("fldcw %0" : : "m" (_mode));
+ #endif
+ #else
+ //x64 doesn't need this - fpu is done with SSE
+ //but still - set any useful sse options here
#endif
}