shader: lower integer v_cmpx region openers #1328
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1335"
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 archielcqp-a11y on 2026-11-24T08:27:37Z.
Change
The
v_cmpxregion opener (issue #932) accepted the VOPC e32 forms on binary32 and on 32-bit integers. It now also accepts the e32 forms on 16-bit integers (eq,ne,lt,le,gt,gefori16andu16; gfx10 has no 16-bitfort) and on 64-bit integers (all eight predicates fori64andu64). That is 28 more forms. The region rules are unchanged: the save must come directly before the compare, the close is ans_mov_b64ors_or_b64restore, and the optional skip is allowed. Only the compare is new.int16_operand, which compares the low 16 bits with sign extension or masking. These are the same semantics as the 16-bitv_cmpdraws.int64_comparisonhelper, factored out of the 64-bitv_cmpbranch and now shared by both. The operand rules are the same as for the 64-bitv_cmp, and VSRC1 must be a VGPR pair.v_cmpxforms stay refused.Refs #932.
Verification
Commit
9d0e43eon upstream0f09ca9, Windows 10 build 19045.6466. NVIDIA GeForce RTX 3080 (10de:2216), driver 32.0.15.9174, and WARP 1.0.22 (Agility SDK 1.620.2), with the debug layer enabled.ctest --test-dir out/build/w10 --no-tests=error -R '^pixel_aot_(cmpx_regions|cmp64|comparisons)_': 6/6 passed on WARP and hardware, with no skips.python -B tests/pixel_aot_check.py binary <llvm-mc 15> <llvm-objcopy 15> <LLVM-C.dll 15>: exit 0. This runs the translator controls and the LLVM 15 gfx1013 round trip, which now includes the four 64-bitv_cmpxprograms.form_coverage_check,rdna2_tools_checkanddocs_links_check.tools/form_coverage.pywas run on a JUnit run of the 153 record-writing tests, all of which passed. gfx1013 coverage went from 960 to 988 of 1968 forms (+28), and nov_cmpx_*_{i16,u16,i64,u64}VOPC gap remains. gfx1030 coverage is 978 of 1863.Fixtures and negative controls
pixel_aot_cmpx_regions_{warp,hardware}):v_cmpdraws, against the samecmp64reference.v_cmpxlowers to the same predicate as the matchingv_cmp.v_cmpx_t_i16, a float literal on a 16-bit operand, an SGPR pair or 32-bit VGPR as the 64-bit VSRC1, and the e64 spelling.check_cmp64_controls,form_coverage_check) now expect the region rule instead.v_cmpx_lt_i64_e32without an exec save must fail withUnsupported v_cmpx execution mask save. The binary16, class and binary64 neighbours stay asserted as uncovered.What remains a hypothesis: the EXEC intersection rule comes from the ISA text, as it did for the existing opener forms. No gfx1013 hardware run checks it.
Checklist
This change was AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:45:43Z.
Review: COMMENTED
Reviewed at commit
9d0e43ee5bc80be1c96db933fa42bcde2ca8f12b.Linux Checks
git diff --check origin/main...HEAD: passed (no whitespace/conflict-marker issues)./root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (Checked 16 Markdown files and 294 links.)./root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (Checked 1108 tracked source, script and build/CI files: no bidirectional controls.)./root/.local/share/x2w-rev-venv/bin/python -B tests/rdna2_tools_check.py: passed (Ran 138 tests ... OK (skipped=18))./root/.local/share/x2w-rev-venv/bin/python -B tests/form_coverage_check.py: passed (form coverage checks passed)./root/.local/share/x2w-rev-venv/bin/python -B tests/pixel_aot_check.py(pure-Python mode): passed (exit 0)./root/.local/share/x2w-rev-venv/bin/python -B tests/pixel_aot_check.py binary /usr/bin/llvm-mc-19 /usr/bin/llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: failed in unrelated existingcheck_f16_cvt_int16_binary(v_cvt_f16_i16_e32 v1, 0xfff0, LLVM-19 vs LLVM-15 encoding/spelling expectation).Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)
tests/form_coverage_check.pypassed (39.26s).--preset dev):offscreen_check):36.02s(configure1.53s)ctest --preset dev -R '^(pixel_aot_cmpx_regions_warp|pixel_aot_comparisons_warp|pixel_aot_cmp64_warp)$' --parallel 4 --no-tests=error --output-on-failure: 3/3 passed (pixel_aot_cmp64_warp3.34s,pixel_aot_cmpx_regions_warp3.64s,pixel_aot_comparisons_warp7.49s)/O2(--preset release):offscreen_check):52.12s(configure1.58s)ctest --preset release -R '^(pixel_aot_cmpx_regions_warp|pixel_aot_comparisons_warp|pixel_aot_cmp64_warp)$' --parallel 4 --no-tests=error --output-on-failure: 3/3 passed (pixel_aot_cmp64_warp3.08s,pixel_aot_cmpx_regions_warp3.47s,pixel_aot_comparisons_warp7.30s)Code Review Notes
tools/pixel_aot.py: cleanly extends VOPC_e32v_cmpxregion openers to 16-bit (eq/ne/lt/le/gt/geoni16/u16viaint16_operand) and 64-bit (i64/u64via sharedint64_comparisonhelper factored out ofv_cmp_*_{i64,u64}), enforcing VGPR-pairvsrc1for 64-bit and keeping_e64, SDWA,f16,f64, andclassrejected.tests/pixel_aot_check.py&tests/form_coverage_check.py: adds 16-bit/64-bitv_cmpxdraw/mismatch controls, equivalence and rejection controls, and updates VOPCv_cmpxform coverage from 32 to 60 forms (+28).docs/experiments.mddocuments the expanded scope and remaining ISA-text hypothesis cleanly.