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
Jit64: Use farcode for exception exit in twX. #10275
Conversation
|
I added the following extra instruction when fixing True Crime. Maybe that managed to push it over the edge...
Do you think it would make sense to make |
|
I have not even the slightest idea how often this path is taken. Would be nice if we had metrics like that... But yes, if it's somewhat rare that's probably not a bad idea. |
|
dolphin/Source/Core/Core/PowerPC/PowerPC.cpp Line 486 in b997048
|
|
I tested this build with this pull request on Windows x64 [pr-10275-win-x64] (i saw that is based in Dolphin 5.0-15605) x64 and the problem of "Jump target too far away, needs force5Bytes = true" is now gone, now the Not64 emulator works again as a charm, as i specified in my thread (https://forums.dolphin-emu.org/Thread-new-5-0-15445-causes-jump-target-too-far-away-needs-force5bytes-true) with old 5.0-15262. Will you bring this fix for a new development or beta release? |
|
Do we know of any other titles using tw/twi? Issue 7253 mentions Monopoly, but I couldn't hit this instruction for any title that I happened to have at hand. |
|
Does forcing 5 bytes mean that we lose performance? Does this cost performance in general? |
|
It will make the code size a little larger. In some cases, this can cause a small performance drop due to less code being able to fit in the icache. |
|
The difference should be minuscule in practice though, especially since apparently this instruction is barely used by games. |
|
I hacked myself some metrics and didn't encounter a single exceptional exit while playing around, so yes moving this to farcode is probably a good idea. |
As a byproduct, this fixes the dont_trap jump not having enough available jump distance to its target in some instances (eg. in Not64).
d2baa32
to
4856013
Compare
See https://forums.dolphin-emu.org/Thread-new-5-0-15445-causes-jump-target-too-far-away-needs-force5bytes-true
I didn't do it yet, but it might be worth bisecting what change exactly caused the distance to become too long?