shader: accept v_cmpx_class_f32 as a pixel_aot region opener #1404
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1411"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Maxim-Root on 2026-11-24T10:56:09Z.
Change
The
v_cmpxregion opener (#932, extended in #1335) accepted the VOPC_e32forms on binary32 and on 16-, 32- and 64-bit integers. When #932 was closed, class forms were listed as separate follow-up work. This PR adds the binary32 one:v_cmpx_class_f32_e32, one VOPC form.v_cmp_class_f32does:(class32(src0) & asuint(vsrc1)) != 0uon the raw binary32 encoding of src0. A new control asserts that the two lowerings are identical for an SGPR and a literal src0.s_mov_b64ors_or_b64restore on the saved pair, VCC and SCC keep their tracked values, and the body rules apply. Only the compare is new._e64and SDWA spellings;negandabson src0;v_cmpx_class_f16andv_cmpx_class_f64.tests/form_coverage_check.pynow counts 61v_cmpxforms, addingv_cmpx_class_f32in VOPC only. The class neighbours that must stay uncovered are nowv_cmpx_class_f16andv_cmpx_class_f64.docs/experiments.md: thev_cmpxparagraph and the fixture paragraph are updated.Refs #932.
Verification
At
429a8b92(main) plus this change, Windows 11 Pro 26300.9818, MSVC 14.44.35207, DXC 10.0.26100, Python 3.12.10. NVIDIA GeForce RTX 3070 Ti (10de:2482), driver 32.0.16.2114, and WARP 10.0.26100. D3D12 debug layer enabled.New draws in
pixel_aot_cmpx_regions_{warp,hardware}:v_cmpx_class_f32_e32 v20, v21, wherev20 = s44 - sample.xandv21holds the +normal mask0x100.v20is a positive normal value exactly wheres44 > sample.x: the ramp never equals a threshold and no difference is subnormal. So through both restores, the region must give the existingmasked_pixelsreference on the mixed (0.5), full (10) and empty (-1) masks: 6 pass cases. The -normal mask0x8(the reversed region) and a mask-free body must mismatch on the mixed mask.v_cmp_class_f32draw's inputs, alternating the restores: +inf against its own bit, a quiet NaN against both NaN bits, -0 against the +0 bit and a positive denormal against its bit. The expected result is[1, 1, 0, 1], so neither a lost zero sign nor a flushed denormal can pass. Four wrong references, each flipping one channel, must mismatch.2/2 passed (WARP 2.2 s, hardware 10.3 s), no skips.
== 0u),pixel_aot_cmpx_regions_warpfails at the first new case withExpected ['pass', 'pass', 'pass'], got ['mismatch', 'mismatch', 'mismatch'](cmpx-class-mov-*).python -B tests/pixel_aot_check.py binary <llvm-mc> <llvm-objcopy> <LLVM-C.dll>exits 0. The tools are LLVM 15.0.7:LLVM-C.dllandllvm-objcopyfrom the official Windows installer, andllvm-mcbuilt from the GPG-verified 15.0.7 sources (AMDGPU only). The three new programs are assembled for gfx1013, disassembled and must lower identically.ctest --preset dev --no-tests=error -R '^(pixel_aot_|compute_store_aot_).*_warp$' -j 16: 96/96.AGENTS.mdpass, includingform_coverage_check,rdna2_tools_checkanddocs_links_check.tools/form_coverage.py ... --gaps gfx1013on that WARP run:VOPC v_cmpx_class_f32is no longer listed. ItsVOP3 _e64andSDWArows stay listed, because both are refused.Checklist
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:09:57Z.
Review: COMMENTED
Reviewed at commit
7b6e5896(4 files, +100/-12):tools/pixel_aot.pyextends the VOPC_e32v_cmpxregion opener tov_cmpx_class_f32_e32, lowering via(class32(src0) & asuint(src1)) != 0uidentically tov_cmp_class_f32_e32(preserving VCC/SCC through the region, closing vias_mov_b64ors_or_b64). Negative controls intests/pixel_aot_check.pycover_e64,_sdwa,_f16/_f64class forms, non-VGPR VSRC1, and source modifiers;tests/form_coverage_check.pyupdatescmpx_formsto 61 forms.git diff --checkclean;tests/docs_links_check.pypassed (16 Markdown files, 322 links);tests/bidi_controls_check.pypassed (1181 files);tests/pixel_aot_check.pypassed;tests/form_coverage_check.pypassed;cmpx_classbinary roundtrip (3/3 fixtures viallvm-mc-19/llvm-objcopy-19/libLLVM-19.so) passed. (Note: fullpixel_aot_check.py binarywithllvm-mc-19hits a pre-existingv_cvt_f16_i16_e32 v1, 0xfff0encoding difference incheck_f16_cvt_int16_binary.)--preset dev):offscreen_checkbuilt;ctest -R '^pixel_aot_exec_regions_warp$'1/1 passed (3.38s)./O2(--preset release):offscreen_checkbuilt;ctest -R '^pixel_aot_exec_regions_warp$'1/1 passed (3.21s).tests/form_coverage_check.pypassed (44.5s).Imported from R0Y00/Xbox2Windows. Originally posted by Maxim-Root on 2026-11-24T11:26:26Z.
@tedin7 thanks for the review. One pointer: the draws for this change are in
pixel_aot_cmpx_regions_{warp,hardware}, notpixel_aot_exec_regions_*. Theexec_regionstests cover thes_and_saveexec_b64opener, which this PR does not touch. So a run of these tests would exercise the new path:Its new cases are
cmpx-class-mov-*,cmpx-class-or-*,cmpx-class-negative-normal,cmpx-class-unmaskedandcmpx-class-group*. Here, at7b6e5896, they pass on WARP and on an RTX 3070 Ti (32.0.16.2114) with the debug layer on. With the class predicate inverted, the WARP test fails atcmpx-class-mov-0.On the LLVM 19 note: agreed, it is unrelated. The full
pixel_aot_check.py binarypasses here with LLVM 15.0.7, the version CI uses, and thev_cvt_f16_i16_e32fixture is not part of this change.AI-assisted (Claude Code).