Merge pull request #357 from shuffle2/master
Revert "x64FPURoundMode: always set x87 precision"
This commit is contained in:
commit
2983ae2823
|
@ -34,6 +34,10 @@ namespace FPURoundMode
|
||||||
|
|
||||||
void SetPrecisionMode(PrecisionMode mode)
|
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
|
#ifdef _WIN32
|
||||||
_control87(_PC_53, MCW_PC);
|
_control87(_PC_53, MCW_PC);
|
||||||
#else
|
#else
|
||||||
|
@ -43,10 +47,14 @@ namespace FPURoundMode
|
||||||
2 << 8, // 53 bits
|
2 << 8, // 53 bits
|
||||||
3 << 8, // 64 bits
|
3 << 8, // 64 bits
|
||||||
};
|
};
|
||||||
unsigned short cw;
|
unsigned short _mode;
|
||||||
asm ("fnstcw %0" : "=m" (cw));
|
asm ("fstcw %0" : "=m" (_mode));
|
||||||
cw = (cw & ~PRECISION_MASK) | precision_table[mode];
|
_mode = (_mode & ~PRECISION_MASK) | precision_table[mode];
|
||||||
asm ("fldcw %0" : : "m" (cw));
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue