-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
PowerPC: Raise alignment exceptions in more situations #9865
base: master
Are you sure you want to change the base?
Conversation
@@ -340,6 +340,9 @@ alignas(16) static const float m_m128 = -128.0f; | |||
// Sizes of the various quantized store types | |||
constexpr std::array<u8, 8> sizes{{32, 0, 0, 0, 8, 16, 8, 16}}; | |||
|
|||
// TODO: Use the actual instruction being emulated (needed for alignment exception emulation) | |||
static const UGeckoInstruction ps_placeholder_instruction = 0; |
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.
Could someone who knows Jit64 better give me some advice here? Basically, I want to pass an additional argument to the quantized loadstore routines (so that the slowmem handler then can forward the argument when calling Read_*
or Write_*
), but all of RSCRATCH
, RSCRATCH2
and RSCRATCH_EXTRA
are already used for arguments to the quantized loadstore routines. How should I pass the argument?
ec3dcf7
to
82fbdd2
Compare
82fbdd2
to
bf78d50
Compare
ce0ff5a
to
4095bb4
Compare
8f6a506
to
f2fe307
Compare
009a9d5
to
bc62fca
Compare
While alignment exceptions turned out to have nothing to do with issue 12565, alignment exceptions are still something that would make sense for us to emulate (even if it doesn't affect any games). I've cleaned up the PR after the merge of the PR that fixed 12565, and it should be more or less done other than my earlier question about Jit64. |
be099c2
to
bc08553
Compare
8a8cbc4
to
952c071
Compare
952c071
to
2295ba3
Compare
62a4279
to
ff28ef5
Compare
7e94d09
to
09fa2dc
Compare
09fa2dc
to
1cf28ed
Compare
4ee50ff
to
966dd51
Compare
966dd51
to
134cbb9
Compare
7b8ae93
to
222e159
Compare
222e159
to
a15476f
Compare
a15476f
to
d547e0e
Compare
d92c173
to
a2ba3fc
Compare
0a63799
to
04ae7b7
Compare
This might be expected behavior, but this never raises as an unhandled exception for me, and instead goes to a silent PPCHalt. |
Does that differ from the behavior on console? |
Just checked, hardware throws
And verified Dolphin does too. So it is working as expected. Panic Handlers do not get invoked however, and imo maybe they should? Though that would not be related to this PR. |
Please note that this PR is not done. My review comment from July 2021 still needs to be resolved in some way. |
Cleanup, and preparation for one of the upcoming commits.
04ae7b7
to
3acf339
Compare
We will need to check for EXCEPTION_ALIGNMENT in addition to EXCEPTION_DSI. Let's also throw in EXCEPTION_FAKE_MEMCHECK_HIT while we're at it so we can skip doing fake DSI exceptions for that. Reordering the exceptions enum is done for the sake of saving one instruction on AArch64 when checking for loadstore exceptions. (Bitwise operations can encode immediates containing a run of ones of an arbitrary length, rotated by an arbitrary amount of bits. In order to make use of this, all loadstore exceptions should have adjacent bit positions.)
To avoid affecting performance, the JITs will most of the time not raise alignment exceptions unless you enable the new INI-only setting AlignmentExceptions.
3acf339
to
7e9a497
Compare
Intends to improve https://bugs.dolphin-emu.org/issues/12565.To avoid affecting the performance, the JITs will most of the time not raise alignment exceptions unless you enable the new INI-only setting
AlignmentExceptions
.