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

JitArm64: Improve psq_l/psq_st address checking #9884

Merged
merged 7 commits into from Oct 11, 2021

Conversation

JosJuice
Copy link
Member

psq_l and psq_st, which both do not use backpatching in the general case due to their reliance on asm routines, are rather lacking when it comes to address checking. psq_st assumes fixed BAT mappings, and psq_l has no address checking at all – if you give it a funny-looking address it will simply crash. This PR improves the situation by implementing Jit64's way of handling psq_l/psq_st address checking.

@JosJuice JosJuice force-pushed the jitarm64-paired-loadstore-addr branch from c3c1c16 to b37c5cd Compare July 13, 2021 10:28
@JosJuice JosJuice force-pushed the jitarm64-paired-loadstore-addr branch from b37c5cd to c0cab30 Compare July 23, 2021 08:35
@JosJuice JosJuice force-pushed the jitarm64-paired-loadstore-addr branch 2 times, most recently from cdb6bdf to 642a5d2 Compare August 5, 2021 17:14
@JosJuice JosJuice force-pushed the jitarm64-paired-loadstore-addr branch 3 times, most recently from b1c2f8e to 99bf2d6 Compare August 23, 2021 17:11
@JosJuice JosJuice force-pushed the jitarm64-paired-loadstore-addr branch 2 times, most recently from f3352f4 to 5462338 Compare September 5, 2021 20:14
This makes it possible to construct flag combinations like
"load 16 bits into an FPR".
EmitBackpatchRoutine (see the upcoming commits) expects
the address to be in W0 for loads and W1 for stores.
In the case of the JitAsm routines, we can't actually use
backpatching. Still, I would like to gather all the load and
store instructions in one place to make future changes easier.
This way the address check will take up less icache (since it's
only emitted once for each routine rather than once for each
psq_st instruction), and we also get address checking for psq_l.
Matches Jit64's approach.

The disadvantage: In the slowmem case, the routines have to
push *every* caller-saved register onto the stack, even though
most callers probably don't need it. But at long as the slowmem
case isn't hit frequently, this is fine.
Same approach as Jit64 here as well.
@JosJuice JosJuice force-pushed the jitarm64-paired-loadstore-addr branch from 5462338 to 15eb561 Compare September 8, 2021 19:32
@JMC47 JMC47 merged commit 3bfb3fa into dolphin-emu:master Oct 11, 2021
11 checks passed
@JosJuice JosJuice deleted the jitarm64-paired-loadstore-addr branch October 11, 2021 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants