dolphin-emulator/Source/Core/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
..
Boot Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Debugger Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
DSP Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
FifoPlayer Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
HLE Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
HW Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
IPC_HLE Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PowerPC Jit64[IL]: fix float conversions 2014-02-12 23:12:15 +01:00
ActionReplay.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
ActionReplay.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
ARDecrypt.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
ARDecrypt.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
ArmMemTools.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
BootManager.cpp Drop framelimit by fps 2014-02-10 16:08:03 +01:00
BootManager.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
CMakeLists.txt Merge of GL-AutoChoose. 2014-01-18 04:11:59 +00:00
ConfigManager.cpp Drop framelimit by fps 2014-02-10 16:08:03 +01:00
ConfigManager.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Console.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
Console.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Core.cpp Use float to calculate the fps/vps 2014-02-10 16:08:03 +01:00
Core.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Core.vcxproj Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
Core.vcxproj.filters Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
CoreParameter.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
CoreParameter.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
CoreTiming.cpp Fix warnings found by StringFromFormat having printf style checking. 2014-02-07 01:38:08 +13:00
CoreTiming.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
DSPEmulator.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
DSPEmulator.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
ec_wii.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
ec_wii.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
GeckoCode.cpp Add const qualifiers to two foreach loop variables for consistency. 2014-02-04 19:44:02 -05:00
GeckoCode.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
GeckoCodeConfig.cpp Change some for+iterator loops in GeckoCode.cpp and GeckoCodeConfig.cpp into foreach loops. 2014-02-04 19:19:48 -05:00
GeckoCodeConfig.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Host.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
MemTools.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Movie.cpp Code cleanup 2014-01-08 20:36:27 -05:00
Movie.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
NetPlayClient.cpp Clarify an if statement in NetPlayClient.cpp. See: https://github.com/LaurentGomila/SFML/issues/26. 2014-02-10 09:26:29 -05:00
NetPlayClient.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
NetPlayProto.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
NetPlayServer.cpp NetPlay: Sync CPU engine between NetPlay clients/servers 2014-01-08 19:42:02 -05:00
NetPlayServer.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
PatchEngine.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
PatchEngine.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
State.cpp Increase save state version. 2014-01-24 00:15:56 -05:00
State.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
stdafx.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
stdafx.h Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
Tracer.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
Tracer.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
VolumeHandler.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
VolumeHandler.h Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
x64MemTools.cpp Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00