Repository navigation
fix(recompiler): widen constants of 64-bit operands instead of repeating them - #39
Merged
boykopovar merged 1 commit intoSep 28, 2026
Merged
Conversation
…ing them readU32Pair read a literal or inline constant into both halves of a 64-bit source. A literal is now zero-extended, an integer inline constant sign-extended and a float inline constant becomes the matching double. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
adam25136
pushed a commit
to adam25136/AnyPS5
that referenced
this pull request
Nov 18, 2026
fix(kyty): port 14 compatibility fixes from upstream KytyPS5
Kikoarl
pushed a commit
to Kikoarl/AnyPS5
that referenced
this pull request
Nov 18, 2026
fix(kyty): port 14 compatibility fixes from upstream KytyPS5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
TranslationContext::readU32Pairbuilds a 64-bit source from two 32-bit reads, taking the high half fromoffsetOperand(operand, 1). For registers that is the next register. For a literal or an inline constant,offsetOperandreturns the same operand, so the constant ended up in both halves: the literalLwas read asL:Linstead of0:L.Found in The Smurfs Dreams (UE). A compute shader writes the args of an indirect draw and rounds a count up to a multiple of 21:
With the addend read as
0xc30c30c3c30c30c3, the draw got0x0c30c30dinstances instead of 0. On RDNA2 that kept the gfx ring busy past the amdgpu lockup timeout, and a MODE1 GPU reset followed.Fix
The fix only applies when the operand is a constant:
-1becomes all onesRegister operands behave as before.
The same function backs
readMask, so a 64-bit mask constant also changes. For example,s_and_saveexec_b64 s[14:15], 1in a wave64 shader enabled lanes 0 and 32. Now it enables only lane 0.Testing
libson Linux;ctestpasses 36/36.{63, 0, 0, 0}, the draw is skipped as intended, and there has been no reset or GPU fault in a 240 s run.🤖 Generated with Claude Code