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
SPU LLVM: LS Memory Mirrors (Optimize loads/stores) #8592
Conversation
baeb7c3
to
4a64d18
Compare
8f5c443
to
8571e09
Compare
Someone wants to perf test? |
no performance difference on TLOU either |
a0a37da
to
a7e102c
Compare
Breaks compatibility with Uncharted Drake's Fortune, make the emulator crash with error |
|
I tried it in windows 10 and it worked fine but tried the emulator with two games in Ubuntu 20.04 and the emulator crashed in both. I will try later with Ubuntu 20.04 live usb. |
I tried under windows 10 and it’s became unstable a lot of crash while loading game or playing with it. |
Fixed Linux issue in #8598 |
I've succedded to repro Windows issue consistently using these added changes in spu_thread constructor:
utils::shm::unmap_critical seems to be the cause for the bug, as it can release(amend) memory not within the target memory reservation, causing the assertation in utils::memory_release to trigger as it cant release memory not of the start of the base. |
For all crashes use #8598 |
By allowing the SPU Local Storage to wrap around on addressing overflows around 256k+- offsets stores/loads are allowed to not mask the immediate value after the calculating the sum of addresses.
This makes it use a native, single x86 memory address calculation instruction (e.g. as a LEA instruction) instead of separating it into different instructions and masking it everytime.
An example for a start of a function which stores a few registers one after one for registers savings to stack from GOW3:
Before:
https://user-images.githubusercontent.com/18193363/87683427-be936880-c789-11ea-9f88-a94ffd2c7138.png
After:
https://cdn.discordapp.com/attachments/485204327800242177/733052633950191626/unknown.png
Notice how ($SP) is masked with 0x3fff0 only once and there are no additional LEA instructions using the new code.
Misc: Also fixes MFC transfers which went of bounds of Local Storage, making them wrap around.