Merge pull request #25 from Tilka/ppc_fp

Fix non-IEEE mode
This commit is contained in:
Pierre Bourdon
2014-02-23 04:15:37 +01:00
10 changed files with 357 additions and 57 deletions

View File

@ -15,11 +15,11 @@ static const unsigned short FPU_ROUND_MASK = 3 << 10;
#endif
// OR-mask for disabling FPU exceptions (bits 7-12 in the MXCSR register)
const u32 EXCEPTION_MASK = 0x1F80;
static const u32 EXCEPTION_MASK = 0x1F80;
// Denormals-Are-Zero (non-IEEE mode: denormal inputs are set to +/- 0)
const u32 DAZ = 0x40;
static const u32 DAZ = 0x40;
// Flush-To-Zero (non-IEEE mode: denormal outputs are set to +/- 0)
const u32 FTZ = 0x8000;
static const u32 FTZ = 0x8000;
namespace FPURoundMode
{
@ -100,8 +100,7 @@ namespace FPURoundMode
FTZ, // flush-to-zero only
FTZ | DAZ, // flush-to-zero and denormals-are-zero (may not be supported)
};
// FIXME: proper (?) non-IEEE mode emulation causes issues in lots of games
if (nonIEEEMode && false)
if (nonIEEEMode)
{
csr |= denormalLUT[cpu_info.bFlushToZero];
}