Don't sign extend 16-bit immediates to 32-bit in ppc64le dynrec, fixes #2846 #2850
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
Previous versions of the ppc32 and ppc64 dynrecs loaded 16-bit immediates without regard for sign extension (the upper 32 bits would be cleared regardless on ppc64). Most things don't care, but apparently the XGA code does, manifesting in broken fonts in Windows 3.11 emulation. This corrects the dynrec to clear the upper bits with a manual load and immediate-OR if it gets a negative
uint16_t
(positive values can still go through the old fast path, so any performance impact should be minimal).Makes no changes other than the ppc64le dynrec, no regression risk on other platforms.
Manual testing
Verified functioning on Fedora 38 ppc64le with test pack in #2846 . No regressions noted in SVGA games.
Checklist
Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.
I have: