PPU LLVM: Improve VMADDFP and VNMSUBFP #7798
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the accuracy of the
VMADDFP
andVUMSUBFP
PPU instructions.VMADDFP
was written to use native FMA if possible, but I couldn't get the accuracy ofVNMSUBFP
to match the behavior of the emulated FMA path, so it's not using native FMA for now.This fixes an issue in Nier that caused a boss's turn rate to go haywire, which would then cause the boss to dive out of bounds rendering the fight impossible.
fixes #7158
I tested against the tests here: https://github.com/RPCS3/ps3autotests/tree/master/tests/cpu/ppu_vpu
ppu_vpu diff against master
diff_vpu_fma_master.txt
ppu_vpu diff against this pr
Diff_vpu_fma_pr.txt
ppu_vpu diff against this pr with native fma for
VNMSUBFP
(there is a regression with positive and negative zero)diff_vnmsub_native_fma.txt
If you want to test make sure you remove the PPU cache before testing, since this PR doesn't invalidate it.