Core: Const Reg flushing fix + COP2/Int CLIP fix #12371
Merged
+12
−4
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.
Description of Changes
Delete Const registers when flushing them completely for drop to interpreter
Propagate the CLIP_FLAG value if it gets written via CTC2 on the EE interpreters, as if the CLIP instruction is run directly after, it will have the wrong clip value. VU JIT doesn't suffer from this as COP2 is direct for both.
Rationale behind Changes
With constants, if you dropped to interpreter and the reg that was constant got written it didn't clear the constant status, causing everything to explode. No idea if this affects anything outside of development where we may force dropping to interpreter, I noticed it when forcing FPU RECOMPILE down to interpreter while trying Soft Float on Twin Caliber. I don't expect any real performance impact as we don't drop out of the EE JIT very often at all.
the CLIP_FLAG issue is because the VU Int (used by EE Interpreter for COP2 instructions) only uses its internal VU0.clipflag value, which it then overwrites the real CLIP_FLAG after the CLIP operation has run, however if the CLIP_FLAG was updated via CTC2, it didn't update VU0.clipflag, so the CLIP operation was running on the incorrect value. Noticed with Simple 2000 Series Vol. 109 - The Taxi 2.
Suggested Testing Steps
Test some random stuff on EE interpreter and JIT, just make sure everything is okay.