shader: support V_CMPX_EQ_U16 #816
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!816
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/816/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?
@theantipopau on GitHub · 2026-09-24 22:05 UTC · original
theantipopau:fix-vcmpx-eq-u16-clean→main· +80 −1 · 4 files · 2 commits · merged 2026-09-24 22:27 UTCSummary
0xbaasV_CMPX_EQ_U16in compact, VOP3, and SDWA formsRelated to #281 and its VOPC
0xbareport.Validation
shader_cfg: passed on a branch based directly on upstreammainshader_recompiler_compute_tests: builds successfully--cmpx-eq-u16-onlygit diff --check: passed@coderabbitai[bot] on GitHub · 2026-09-24 22:21 UTC · original
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
📝 Walkthrough
Walkthrough
The decoder adds V_CMPX_EQ_U16 for VOPC encoding 0xba and classifies it as an EXEC-destination comparison. The translator emits an unsigned 16-bit equality comparison with execute-mask updates. Tests cover compact, SDWA, and VOP3 encodings, including EXEC and VCC results; DPP remains unsupported. A compute test covers 12 equality cases and can run on its own.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Feature
Merge Risk: 🟡 Moderate · up to
aa4b0The new compute regression test is expected to fail when run on supported hardware. Correct its test case before merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 too large.)
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-09-24 22:21 UTC · original · edited 2026-09-24 22:27 UTC
On
tests/ShaderRecompilerComputeTests.cppline 22511 (outdated):🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Fix the wrong expected value for the V_CMPX_EQ_U16 "sign bit" case.
This case uses the default SDWA encoding (encoding=0). Case 1 in the same array documents the rule for this encoding: the comparison uses only the low 16 bits and ignores the high 16 bits. Seven other cases in this test confirm the rule.
Apply the rule to this case:
0x7fff8000u & 0xffffequals0x8000.0x00018000u & 0xffffalso equals0x8000. The two low halves are identical, so V_CMPX_EQ_U16 must report equality here. The test hardcodesexpected_exec = 0, which contradicts the rule that the other seven cases establish.Equality does not depend on sign interpretation. If the compared 16 bits are bit-identical, the values are equal regardless of the "sign bit" framing in the comment. As written, this case will fail at runtime: the GPU produces
EXEC = 1,CompareWordsreceives0as the expected value, and the test process aborts.Change one operand so the low 16 bits differ while both keep bit 15 set, to preserve the apparent intent of testing two negative-looking values that are not equal.
🐛 Proposed fix for the test data
📝 Committable suggestion
✅ Addressed in commit
1addc17@coderabbitai[bot] on GitHub · 2026-09-24 22:21 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
0a123846-872b-4183-8c00-7ec38092340d📥 Commits
Reviewing files that changed from the base of the PR and between
a20fb7f9f8andaa4b03d168.📒 Files selected for processing (5)
src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.hsrc/graphics/shader/recompiler/frontend/decode/VectorAluOps.cppsrc/graphics/shader/recompiler/frontend/translate/Vector.cpptests/ShaderRecompilerComputeTests.cpptests/shaderCfgTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.