dolphin/Source/Core/Core/PowerPC
Tillmann Karras db196d8c5b Jit64[IL]: fix float conversions
Floating-point is complicated...

Some background: Denormals are floats that are too close to zero to be
stored in a normalized way (their exponent would need more bits). Since
they are stored unnormalized, they are hard to work with, even in
hardware.  That's why both PowerPC and SSE can be configured to operate
in faster but non-standard-conpliant modes in which these numbers are
simply rounded ('flushed') to zero.

Internally, we do the same as the PowerPC CPU and store all floats in
double format. This means that for loading and storing singles we need a
conversion. The PowerPC CPU does this in hardware. We previously did
this using CVTSS2SD/CVTSD2SS. Unfortunately, these instructions are
considered arithmetic and therefore flush denormals to zero if non-IEEE
mode is active. This normally wouldn't be a problem since the next
arithmetic floating-point instruction would do the same anyway but as it
turns out some games actually use floating-point instructions for
copying arbitrary data.

My idea for fixing this problem was to use x87 instructions since the
x87 FPU never supported flush-to-zero and thus doesn't mangle denormals.
However, there is one more problem to deal with: SNaNs are automatically
converted to QNaNs (by setting the most-significant bit of the
fraction). I opted to fix this by manually resetting the QNaN bit of all
values with all-1s exponent.
2014-02-12 23:12:15 +01:00
..
Interpreter Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Jit64 Jit64[IL]: fix float conversions 2014-02-12 23:12:15 +01:00
Jit64IL Jit64[IL]: fix float conversions 2014-02-12 23:12:15 +01:00
JitArm32 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
JitArmIL Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
JitCommon Jit64[IL]: fix float conversions 2014-02-12 23:12:15 +01:00
JitILCommon Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
CPUCoreBase.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
GDBStub.cpp
GDBStub.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Gekko.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
JitInterface.cpp
JitInterface.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
LUT_frsqrtex.cpp
LUT_frsqrtex.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PowerPC.cpp
PowerPC.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PPCAnalyst.cpp
PPCAnalyst.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PPCCache.cpp
PPCCache.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PPCSymbolDB.cpp
PPCSymbolDB.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PPCTables.cpp Fix warnings found by StringFromFormat having printf style checking. 2014-02-07 01:38:08 +13:00
PPCTables.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Profiler.cpp
Profiler.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
SignatureDB.cpp
SignatureDB.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00