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
Prefetch MFC list elements #5345
Conversation
Can I get a review on this? seems like a forgotten pr @Nekotekina |
Copying potentially huge list will always cause the overhead with memcpy. It's also unrealistic that PS3 is able to fetch the huge list. I'd expect something rather small, like aligned 16-byte reads. |
I've written a testcase specifically for that - https://github.com/elad335/myps3tests/tree/master/spu_tests/Max%20list%20elements%20prefetch%20count |
That seems more realistic. This amount should fit into registers instead of memcpying it. |
What do you mean? |
any update for this pr |
Its pending for review. |
228622c
to
21d5c09
Compare
@elad335 update this pr with Latest master Build want it for testing only |
Rewritten to be 100% UB-free. |
de23946
to
a395765
Compare
Also move some stuff away from command processing such as a few constant arguments setup
Waiting for merge 👍👍 |
rpcs3/Emu/Cell/SPUThread.cpp
Outdated
if (index == fetch_size) | ||
{ | ||
const auto src = _ptr<void>(args.eal & 0x3fff8); | ||
if ((uptr)src % alignof(v128)) |
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.
Can union be replaced with simple alignas(16) list_element items[fetch_size];
, and the whole alignment check with two pathes with single memcpy?
* Prefetch mfc list elemets to protect from overwriting Also move some stuff away from command processing such as a few constant arguments setup
Prefetch elements to protect them from destruction by the previous elements processing in the GET list. That is happening when the destination of the command overlaps the list entries.
Seen in Calling All Cars, Brings him from intro to ingame (could be playable).
It seems logical that the mfc in realhw caches chunks of entries rather than one after another each element execution.
Should fix a few other access violations caused by poor commands management, apparently some games are self destructive.
I did only prefetch up to the list end or the list stall, whatever comes first. becuase prefetching more than that seems overkill.