x86jit: Fix spill on sc in longer block #18140
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I only added sc this year for the debugger - it was a mistake to not make sure any spill happens outside the conditional. That said, this should most of the time be in a tight loop, so usually won't be an issue. Still, there may be some game, especially on 32-bit, that triggers a spill inside the conditional and that'd be bad.
Just to make sure it's clear, this is the scenario (simplified, since actually
li
would not map a reg):In this case, i386 only has 5 mappable regs, so mapping
t1
will necessarily spill one of those first 5. However, if the spill happens inside the if (skipStore = J_CC(CC_NE);
- i.e.if (llBit == 1) {
) then that other register will silently not be updated if llBit was 0. In that case, i.e.a0
would stay0xDEADBEEF
and not be set to 0.I don't have Beats to make sure this works there.
-[Unknown]