shader: decode V_CMPX_NGE_F16 (VOPC 0xf9) #2532
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!2532
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2532/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?
@Nawid3333 on GitHub · 2026-11-24 02:09 UTC · original
Nawid3333:fix/vopc-cmpx-nge-f16→main· +124 −23 · 11 files · 2 commits · merged 2026-11-24 14:33 UTCRefs #2331
Avatar: Frontiers of Pandora stops in the CFG builder on a compare the decoder does not know:
0x7df2d4f9 0x86060004isv_cmpx_nge_f16_sdwa v4, vcc_lo src0_sel:DWORD src1_sel:DWORD(llvm-mc-mcpu=gfx1013encodes exactly these words).V_CMP_NGE_F16(0xe9) is in the VOPC table, but its CMPX form 0xf9 is not, so the opcode decodes as UNSUPPORTED andSupportsVopcSdwarejects it; the SDWA wording is a side effect of the missing entry.Change
V_CMPX_NGE_F16in the opcode enum, the VOPC table entry 0xf9, and the two lists that mark float compares and EXEC-writing compares (IsVopcFloatCompareOpcode,IsVopcCompareExec).V_CMP_NGE_F16already uses (unordered less-than on F16), with the result written to EXEC like the other CMPX compares.Hardware rows
I ran the game's two words, the SDWA DWORD and WORD_1 forms, the e32 form and the VOP3 form with a negated
v4on an RDNA2 GPU (Ryzen 7600X iGPU, gfx1036) through HIP, FLOAT_MODE with denorm16 = 3, IEEE mode off. All 16 rows match nge = !(a >= b): quiet and signaling NaN compare unordered (1), -0 against +0 gives 0, the DWORD select reads the low half and ignores the high half, WORD_1 reads the high halves, VOP3 neg flips the first source, and f16 denormals are kept (0 against 0x0001 gives 1). VCC keeps its value; only EXEC is written.Tests
VectorVopcCmpxNgeF16SgprSdwaExecMask: the game's two instruction words and the VOP3 form with-v4, againstvcc_lo = 0xbc003c00, 14 cases (NaN, infinity, -0, values around 1.0, data in the unused upper half, one case that starts with EXEC = 0). The expected EXEC bits follow the comparison rule the RDNA2 rows show; the test also checks that VCC is unchanged.Vop2SdwaMinU32PreservesWordDestination,VectorAddcWritesPerLaneCarryOut,VectorCompareF64Edges), and on both the test process crashes at the same point afterVectorFractF64CapturedAndEdges(a host problem on this GPU that main has too). The new test comes after that point, so I ran it and the other F16 CMPX tests as their own case list.shader_cfg_testsgives the same output as on main.Game
A tester build with this change (plus my unrelated, not yet submitted material-key work) got Avatar past this stop on the tester's RX 9070 XT; the next stop is an image allocation (
failed to create image: extent=3840x2160x1 format=122, image.cpp:720), which this change does not touch (#2331 comment 7117344329).Not covered: the PS5's own GPU (gfx1013) was not measured, only the RDNA2 iGPU. Other F16 compares are still missing from the table (
v_cmp_f/o/nlg/nle/tru_f16,v_cmpx_f/lg/o/u/nlg/tru_f16); I left them out because no game log shows them yet.If you'd like this done differently, tell me and I'll change it.
Written with Claude Code (AI): it decoded the words, measured the instruction on the GPU, wrote the change and the test, and ran them on my PC (Windows 11, RX 9070 XT and Ryzen 7600X iGPU).
@coderabbitai[bot] on GitHub · 2026-11-24 02:12 UTC · original
No actionable comments were generated in the recent review.
Walkthrough
The decoder recognizes
V_CMPX_NGE_F16with encoding0xf9and classifies it as a floating-point compare that writes the execution mask. The translator routes it through the existing F16 unordered less-than comparison path. A compute test covers 14 inputs across SDWA and VOP3 forms, execution-mask settings, and comparison results. The test also checks that the SGPR pair retains its initial values.Suggested reviewers:
nmzikChange: Bug fix
Merge Risk:
Minimal · up to
4a302This adds decoder and translator support for V_CMPX_NGE_F16, which a game's shader was missing and which stopped the decode. The new opcode reuses the existing compare path and has a dedicated test, so merge risk is minimal.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the change: adding decoder support for V_CMPX_NGE_F16 (VOPC opcode 0xf9). The changeset adds the enum value, the VOPC table entry, the float-compare and EXEC-writing classifications, the translation routing, and a test. The title is specific and concise, and it matches the primary change.
Full details: Description check
Explanation
The description ties the change to a concrete failure (Avatar: Frontiers of Pandora CFG build stop on VOPC opcode 0xf9). It explains the missing table entry, the translation reused from V_CMP_NGE_F16, the new test, and the validation performed. This relates directly to the changeset.
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
34455f65-1c97-4558-b4f5-a30c1d2ae135Reviewing files that changed from the base of the PR and between
4e90654506and4a3023c03b.src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.hsrc/graphics/shader/recompiler/frontend/decode/VectorAluOps.cppsrc/graphics/shader/recompiler/frontend/translate/Vector.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.