Repository navigation
rdna2spirv: implement v_cmp_*_f64 and v_cmpx_*_f64 - #2571
Conversation
|
Independent GPU verification at All 32,768 predicate results per wave configuration matched. That covers all 16 predicates in both CMP and CMPX, for E32 into VCC and E64 with sign modifiers on both sources (CMP into SGPR masks). I checked native wave32 and explicitly verified wave64 emulation. Pre-disabled lanes stayed off in CMPX, and all 1,024 VCC-preservation checks per configuration matched. Both modules passed |
|
Checked
One note for the GPU side: this card has |
|
Tested translator commit |
Implements all 32 RDNA2 binary64 vector compare instructions (
v_cmp_*_f64andv_cmpx_*_f64) intools/rdna2spirv.py(claimed in #2300 (comment)). Separate from #2245 (constantu64/i64compares) and #2535 (v_cmp_class_f64).What & Why
Gen.compare_f64_condand handlesty == "f64"inGen.comparefor all 16 float compare predicates (f,lt,eq,le,gt,lg,ge,o,u,nge,nlg,ngt,nle,neq,nlt,tru) across bothv_cmp_*_f64(e32/e64, writing VCC or an SGPR lane mask) andv_cmpx_*_f64(e32/e64, narrowing EXEC).%uintinteger arithmetic (exact NaN detection,-0.0canonicalized to+0.0, sign-magnitude mapped to a monotonic unsigned 64-bit key) — noFloat64capability required, denormal-safe on all drivers, and directly executable inspirv_mini_interp.fimm), sign-extended inline integers (-16..64), 32-bit upper-half literals (per RDNA2 ISA), and VOP3abs/negsign-bit modifiers on both sources.0forv_cmp_*_f64and stay inactive forv_cmpx_*_f64; malformed operands/destinations/modifiers and non-float predicates raiseUnsupported.Changes
tools/rdna2spirv.py: addedGen.compare_f64_condand dispatchedty == "f64"inGen.compare.tests/semantic/test_cmp_f64.py: added CPU semantic tests covering all 16 predicates across IEEE-754 edge pairs (±inf,±max_normal, 1-ULP neighbors,±subnormal,±0.0, low-wordsNaN,qNaN), SGPR pairs,fimm/inline/upper-word literal constants,abs/negmodifiers,v_cmpx_*_f64EXEC narrowing, inactive lanes, absence ofOpCapability Float64, and rejected forms.docs/design.md: added the translator contract table row (marked Not GPU-verified).Verification
python -I), CPU-only (not GPU-verified), synthetic fixtures only (no game files).python -m compileall -q make_game.py tools tests— passpython -I tests/semantic/test_cmp_f64.py -v— 5/5 passpython -m unittest discover -s tests/semantic -p "test_*cmp*.py" -q— 50/50 passpython -I tests/test_shader_meta.py— 15/15 passpython -I tests/test_docs_links.py— 5/5 passpython -I tests/test_docs_repo_paths.py— 2/2 passpython -I tests/test_text_write_line_endings.py— 2/2 passpython -I tests/test_isa_coverage.py— 10 pass, 3 skipped (no local ISA XML)AI-assisted (Gemini).
Independent verification on cba4626
On Windows with an RTX 5070, all 32,768 predicate results per configuration matched the reference in native wave32 and emulated wave64. On Linux with an RTX 5070 Ti, all 51 draws matched at every pixel. Both reviewers validated their modules for Vulkan 1.2. A separate Linux run passed all 2,572 semantic tests. Windows GPU report · Linux GPU report · Linux CPU suite