shader: implement V_CMP(X)_GT_I64 and V_CMP(X)_GE_I64 #1222
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!1222
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1222/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?
@TheCruZ on GitHub · 2026-10-08 18:46 UTC · original
pr/cmp-gt-ge-i64→main· +455 −27 · 8 files · 1 commits · closed without mergingSummary
Adds the last missing 64-bit integer compares,
V_CMP_GT_I64,V_CMP_GE_I64,V_CMPX_GT_I64andV_CMPX_GE_I64. Grand Theft Auto V (PPSA04264 v1.005) aborted entering Story Mode on unsupported 64-bit integer compares (V_CMP_NE_I64incs 0x8395e43f382309df). Upstream has since added all the other I64/U64 compares (bb98f264); this completes the family.The change was written by @At0mC3 as a PR to my GTA V fork (commit authorship kept), and adapted to upstream. Its V_FRACT_F64 clamp part is left out because #1212 covers it.
Problem
0xa4,0xa6,0xb4,0xb6and their VOP3 forms) were not decoded, so a shader using them was unsupported.SupportsVopcSdwaonly excludedV_CMP_NE_I64among the 64-bit integer compares, so the others could still be decoded as VOPC SDWA, which has no 64-bit operands.IncludeInstructionVectorRegistersdid not list theFandTvariants as 64-bit operands.Change
a > bis emitted asb < aanda >= basb <= a(EmitIntegerComparegets aswap_operandsflag).V_CMP_F_I64..V_CMPX_T_U64, kept in hardware order), and every one of them stays out of VOPC SDWA decoding.FandTincluded.Testing
shader_recompiler_compute_tests: new--cmp-i64-onlyselector withVectorCompareInteger64Family(wave32 and wave64, every relation of the I64/U64 families over INT64_MIN, -1, 0, 1, INT64_MAX and the unsigned edge values) andVectorVop3CompareNeI64CapturedScalarSource, both also in the default run.--cmp-i64-only,--integer64-compare-onlyand the default run pass.shader_cfg_tests:TestNewShaderRecompilerRejectsDppOn64BitComparesnow covers every 64-bit integer compare; passes.AI usage
The original change is by @At0mC3. AI (Claude Opus 5.5) was used to adapt it to upstream. I reviewed the code, understand it, tested it as described above, and wrote this description myself, in general fully tested the game while doing few missions and playing in-game with my GTA V fork, i will be bringing PRs here after test them enough.
@coderabbitai[bot] on GitHub · 2026-10-08 18:50 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
91a39d2f-b743-40f6-b80a-55ed7325d31c📥 Commits
Reviewing files that changed from the base of the PR and between
2f4b8a335dandb5482f741f.📒 Files selected for processing (8)
src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.hsrc/graphics/shader/recompiler/frontend/decode/VectorAluOps.cppsrc/graphics/shader/recompiler/frontend/translate/Compare.cppsrc/graphics/shader/recompiler/frontend/translate/Translate.cppsrc/graphics/shader/recompiler/frontend/translate/Translator.hsrc/graphics/shader/recompiler/frontend/translate/Vector.cpptests/ShaderRecompilerComputeTests.cpptests/shaderCfgTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough
The decoder now recognizes 64-bit vector comparison encodings and rejects unsupported DPP and SDWA forms. The translator adds signed 64-bit greater-than and greater-than-or-equal comparisons using reversed operands, and updates VGPR accounting. Tests cover the comparison families, operand forms, wave sizes, and mask behavior.
Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
b5482No actionable merge-blocking issue is established for the 64-bit comparison changes. Normal validation remains appropriate.
🚥 Pre-merge checks | ✅ 4 | ❓ 1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 6 files. (2 skipped: 2 too large.)
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.@Nmzik on GitHub · 2026-10-10 01:38 UTC · original
rebased and credited
d247d3d60cPull request closed