Skip to content
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

Merged
merged 8 commits into from
Dec 28, 2017

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Dec 28, 2017

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]

@iOS4all
Copy link

iOS4all commented Dec 28, 2017

Thanks for taking care about iOS. We really appreciate a lot.
But we have an issue.

This is the last update on Cydia
img_0610

Even though inside ppsspp it's still on v1.4.2-575

@unknownbrackets
Copy link
Collaborator Author

That's not at all related to this PR. I'm not planning on spending any time looking at Cydia.

-[Unknown]

@iOS4all
Copy link

iOS4all commented Dec 28, 2017

Thank you so much bro.
I'll waiting for someone to update ppsspp on Cydia.

@hrydgard
Copy link
Owner

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 :)

@hrydgard hrydgard merged commit 3aba563 into hrydgard:master Dec 28, 2017
@unknownbrackets
Copy link
Collaborator Author

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]

@unknownbrackets unknownbrackets deleted the arm64-jit branch December 28, 2017 08:35
if (jo.enablePointerify) {
MOVK(SCRATCH1_64, ((uint64_t)Memory::base) >> 32, SHIFT_32);
} else {
ADD(SCRATCH1_64, SCRATCH1_64, MEMBASEREG);
Copy link
Collaborator Author

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]

Copy link
Owner

@hrydgard hrydgard Dec 28, 2017

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.

Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants