recompiler: add S_SWAPPC_B64 decoding and CFG support #1280
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1280
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1280/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@notBehzad on GitHub · 2026-10-09 04:48 UTC · original
notBehzad:main→main· +14 −10 · 3 files · 1 commits · closed without mergingReferences #281
Summary
Adds decoding and Control Flow Graph (CFG) support for the RDNA 2 SOP1 opcode
0x21(S_SWAPPC_B64).Changes
S_SWAPPC_B64toOpcodeenum andSOP1_OPCODE_LIST. UpdatedDecodeSop1()to parse scalar destination and source registers whensdst != 125u.S_SWAPPC_B64into target resolution and block terminator processing inShaderCFG.cpp, reporting structured dynamic branch failures where indirect targets are unsupported.Testing
shader_cfg_teststarget without regressions.Reference comment: #281
@coderabbitai[bot] on GitHub · 2026-10-09 04:51 UTC · original · edited 2026-10-09 04:59 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
ba2c3344-7fdb-43a4-9804-e52204b14454📥 Commits
Reviewing files that changed from the base of the PR and between
7b9997baeaand2326210b87.📒 Files selected for processing (3)
src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cppsrc/graphics/shader/recompiler/frontend/decode/ScalarAluOps.cppsrc/graphics/shader/recompiler/frontend/decode/ShaderDecoder.hIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
The decoder now recognizes opcode 0x21 as
S_SWAPPC_B64. When its destination register is 125, it maps the instruction toS_SETPC_B64. The control-flow graph builder resolves targets forS_SWAPPC_B64and handles its terminators using the existingS_SETPC_B64logic.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Feature
Merge Risk: ⚪ Minimal · up to
23262The change adds S_SWAPPC_B64 decoding and CFG handling, with structured failures for unsupported targets. No actionable merge-blocking risk is established.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.Pull request closed