-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow arm64 jit when memory base is not nicely aligned #10465
Conversation
For platforms where we can't get base aligned.
Unless IMM, we don't need to store non-dirty mapped regs.
This is always of size 0, and crashes on iOS anyway...
c3ee271
to
092f98d
Compare
That's not at all related to this PR. I'm not planning on spending any time looking at Cydia. -[Unknown] |
Thank you so much bro. |
Very nice, thanks. @angelXwind , any chance you can have a look at the cydia buildbot? Regarding 32 vs 64-bit, there are a few sections of the JIT that are still disabled in 64-bit (lwl/lwr etc). Plus, 32-bit is removed in ios 11 and will be deprecated on Android 2019 so it's not like we have a choice long term anyway :) |
Well, keep in mind I've disabled two of the nicer optimizations in the 64-bit jit - I didn't say it's slower on Android. Plus, agreed, there's more room to optimize. Just trying to temper expectations. -[Unknown] |
if (jo.enablePointerify) { | ||
MOVK(SCRATCH1_64, ((uint64_t)Memory::base) >> 32, SHIFT_32); | ||
} else { | ||
ADD(SCRATCH1_64, SCRATCH1_64, MEMBASEREG); |
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.
Note: Would be better to just use MEMBASEREG as the last arg to LDR and not do either of these?
-[Unknown]
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.
Well, that form of LDR takes an immediate offset, not a register, but changing to the register sum LDR would indeed probably be a win. Definitely not a loss. Don't remember, do we initialize MEMBASEREG even if pointerization is enabled? Because if we don't gain an extra register from pointerization, I'm not sure it's even really worth it... I think Dolphin moved away from it.
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.
Though I suppose not needing to reload registers to "depointerize" should still be quite a win.
This basically adds the arm32-style ML_ARMREG_AS_PTR to arm64, but only uses it when pointerify is disabled.
This at least improves the situation on 64-bit iOS 10. Only really tested with Final Fantasy 4. It may crash in iOS 11 or with jailbreaks or etc., and I'm not planning to do anything about that right now. Don't ask.
FlushIcache() seems to crash a lot, though, not sure why.It was because it didn't account for the start offset.FWIW: In the singular game I tested, it seems like 64-bit is slower by about 10% (550% -> 500%.) This may be the jit, since IR seemed roughly the same (around 250% with fast forward.)
-[Unknown]