shader: lower the VOP3 (e64) v_cmpx region openers #1545
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1552"
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-24T13:51:44Z.
Refs #932
Summary
Every VOPC (e32)
v_cmpxform already opens a masked region. This PR adds the same 95 comparisons in the VOP3 (_e64) encoding. On gfx10, VOP3v_cmpxwrites only EXEC and has no SGPR destination; LLVM 15 rejectsv_cmpx_lt_f32_e64 s[0:1], v1, v2for gfx1013.Each
_e64opener lowers like the_e64v_cmpof the same type on the same sources:negandabs;v_cmpx_class_f32mask is a constant or a register with no modifiers.The region rules (entry-mask save, restores, skip branch, body) are unchanged.
An SGPR destination,
clamp, output modifiers, modifiers on integer sources or on a class mask, and SDWA are rejected.Fixture
pixel_aot_cmpx_e64_{warp,hardware}draws the predicate, class, 64-bit integer and binary64 groups ofpixel_aot_cmpx_regions, with each comparison in its_e64spelling._e64spelling-v18, -s44, which has the same relation ass44, v18_e32truth rowss44, s45(SGPR src1)_e32truth rows|s46|_e64shapes of thev_cmpdrawcmp64_expected(..., "e64", ...)_e64shapes, including-v[18:19]and|v[20:21]|cmpf64_expected("e64", ...)Translation controls:
_e64opener must emit the same predicate as the_e64v_cmpon the same sources, across all six integer, float and class kinds and four binary64 shapes._e64groups are part of the LLVM 15 binary round trip.Negative control on the translator itself: a mutant that strips the
_e64modifiers fails the WARP draw on the first binary32 group. Both reversed references matched, and two correct rows did not.Results
Run on
309cfedwith this change, Windows 10 build 19045, debug layer enabled on both adapters.pixel_aot_cmpx_e64pixel_aot_cmpx_regionsOther checks:
ctest -R 'pixel_aot|cmp|form_coverage|depth_mask'): 162 of 162 passed.tests/pixel_aot_check.pywith no arguments): pass.tests/pixel_aot_check.py binary): pass.form_coverage_check,docs_links_checkandbidi_controls_checkpass.No capability skips.
Coverage: the new test records all 95 VOP3
v_cmpx_*_e64forms in bothgfx1013.tsvandrdna2.tsv. Before this change,form_coverage_checkasserted that these forms were uncovered. I did not rerun every record-writing test for a whole-suite total.Not checked: the ISA intersection rule for EXEC is the same assumption as for the
_e32openers. No gfx1013 hardware run checks it.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-24T14:07:00Z.
Independent GPU validation
Measured
ca82d82emerged onto8f438025(my mergef57676c6, treefbc3889d, working tree clean). Nothing below is a code change.Environment
10.0.26100.0user-mode)AMD Radeon RX 9070 XT vendor=1002 device=7550, driver32.0.32029.2010Microsoft Basic Render Driver vendor=1414 device=008c, driver10.0.26100.9818dev(Debug),debug_layer=unavailable— see the limitation belowCommands
Observed
Two entries, three runs each: 6 passed, 0 failed, 0 skipped.
Counting the fixture statically — from its own group tables, not off the log — the 16 predicate groups define 132 cases, 48 of which are
-reversedcases whose expected outcome is a mismatch. The run is green on both backends, so each of those 48 expectations held: the drawn pixels discriminate the relation instead of passing on any answer. The class groups (f32andf16, including-0read as+0) and the 64-bit integer and binary64 groups are green too.Regression
^pixel_aot_cmpx: 4 passed, 0 failed, 0 skipped — the existing e32v_cmpxregion entries still pass with this lowering in the tree.Limits
0x887a002d, SDK component missing; the Graphics Tools optional feature is absent and its install is refused from a remote session with0x80070005), so the run says nothing about D3D12 API validation — only that the drawn pixels match.clamp, output modifiers, modifiers on integer sources or on a class mask, SDWA) are not exercised by these draws, and I did not look for a test that asserts those rejections.AI-assisted; runs executed locally on the adapter above.
Imported from R0Y00/Xbox2Windows. Originally posted by archielcqp-a11y on 2026-11-24T14:16:36Z.
Whole-suite coverage measurement
The PR body said I had not measured a whole-suite total. I have now.
I ran the full suite (
ctest -j 8 --output-junit) onca82d82, Windows 10 build 19045, with the RTX 3080 and app-local WARP 1.0.22, then rantools/form_coverage.py. To isolate this change, I compared the union of all form records with and without thev_cmpx_*_e64mnemonics. Onmainthe translator refused every one of them, so the second count matchesmain.gfx1013.tsvv_cmpx_*_e64)rdna2.tsvNo other form changed. That run had 949 passes, 17 capability skips and 12 failures, none in a test this PR touches:
gpu_alias_window_hardware;bvh_wave64_warpandwave_shuffle_warp(the WARP 1.0.22 issue #145);startup_sampler_x_hardwareandstartup_sampler_x_swapped_hardware;cpu_*archive, placed-draw and xmem tests.I have not checked whether those 12 also fail on
mainunder-j 8.@thepatrickworld, thanks for the RX 9070 XT run. The rejected
_e64forms are asserted in the translator controls, not in the draws.check_cmpx_controlscovers the SGPR destination,clamp,mul:2, modifiers on integer sources and on class masks, and literals wider than 16 bits;check_cmpf64_controlscovers the binary64 rejections. Both run inpixel_aot_check.pywith no arguments, and in thepixel_aot_{warp,hardware}entries.🤖 Generated with Claude Code