Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPU LLVM: Improve VMADDFP and VNMSUBFP #7798

Merged
merged 1 commit into from Mar 19, 2020
Merged

Conversation

Whatcookie
Copy link
Member

This PR improves the accuracy of the VMADDFP and VUMSUBFP PPU instructions. VMADDFP was written to use native FMA if possible, but I couldn't get the accuracy of VNMSUBFP 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.

@Whatcookie
Copy link
Member Author

Pushed a version where native FMA is active for VNMSUBFP as well, neko said it doesn't matter.

- Use native FMA to emulate VMADDFP, with a fallback for processors that don't support FMA
- Use native FMA to emulate VNMSUBFP as well, but note that it differs from the emulated path with regards to negative zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NieR [BLUS30481] Softlock during boss fight in part 2
2 participants