dolphin/Source/Core
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
..
AudioCommon Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Common Jit64[IL]: fix float conversions 2014-02-12 23:12:15 +01:00
Core Jit64[IL]: fix float conversions 2014-02-12 23:12:15 +01:00
DiscIO Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
DolphinWX Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
InputCommon Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
VideoBackends Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
VideoCommon Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
CMakeLists.txt Put Plugins/ in Core/, rename to VideoBackends 2013-10-07 10:37:01 -04:00