-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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/RawSPU: Implement MMIO violation elimination pass #14137
Conversation
5fd0861
to
f1348e8
Compare
WIP because I want to add more MMIO patterns. |
Added patterns seen in Crysis, if you have already tested this pull request you may need to remove PPU cache again before retesting. |
e4dfc21
to
4004ea4
Compare
for (u32 inst : insts) | ||
{ | ||
// Common around MMIO (orders IO) | ||
if (inst == ppu_instructions::EIEIO()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old MacDonald Had A Farm... 😆
2eee272
to
a5050fc
Compare
Eliminated MMIO violations in Crysis completely while making false positives extremely rare. (this includes in fw as well, as well as in sys_raw_spu functions in liblv2.sprx) LLVM: Detected potential MMIO32 write at [address] For detected optmizations. |
rpcs3/Emu/Cell/PPUTranslator.cpp
Outdated
@@ -2527,6 +2590,7 @@ void PPUTranslator::LDX(ppu_opcode_t op) | |||
|
|||
void PPUTranslator::LWZX(ppu_opcode_t op) | |||
{ | |||
m_may_be_mmio &= (op.ra != 1u && op.ra != 13u && op.rb != 1u && op.rb != 13u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does register check signify here and in similar places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stack register and TLS address register are unlikely to be used in MMIO address calculation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it as comment.
Implement detection of RawSPU MMIO usage in PPU code and eliminate the need to handle it in access violation handler which is a performance expensive procedure.
Massively improves performance for RawSPU games when launched with a debugger such as visual studio (because it eats the exception). going from sub-2 fps to 36 fps on Plants vs Zombies on my machine when visual studio is attached.
When a debugger is not attached, performance gains are smaller.
For the optimization to apply, you need to have a game that creates RawSPU and remove PPU cache before you do.
Some like Crysis create 5 RawSPU threads but some only 1 so some games may be more affected than others.
Here is a list of RawSPU games if you want to test.
sys_raw_spu_create.txt