mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
4f18f6078f
Thanks to magumagu's softfp experiments, we know a lot more about the Wii's strange floating point unit than we used to. In particular, when doing a single-precision floating point multiply (fmulsx), it rounds the right hand side's mantissa so as to lose the low 28 bits (of the 53-bit mantissa). Emulating this behavior in Dolphin fixes a bunch of issues with games that require extremely precise emulation of floating point hardware, especially game replays. Fortunately, we can do this with rather little CPU cost; just ~5 extra instructions per multiply, instead of the vast load of a pure-software float implementation. This doesn't make floating-point behavior at all perfect. I still suspect fmadd rounding might not be quite right, since the Wii uses fused instructions and Dolphin doesn't, and NaN/infinity/exception handling is probably off in various ways... but it's definitely way better than before. This appears to fix replays in Mario Kart Wii, Mario Kart Double Dash, and Super Smash Brothers Brawl. I wouldn't be surprised if it fixes a bunch of other stuff too. The changes to instructions other than fmulsx may not be strictly necessary, but I included them for completeness, since it feels wrong to fix some instructions but not others, since some games we didn't test might rely on them. |
||
---|---|---|
.. | ||
AudioCommon | ||
Common | ||
Core | ||
DiscIO | ||
DolphinWX | ||
InputCommon | ||
VideoBackends | ||
VideoCommon | ||
CMakeLists.txt |