shader: refuse e32 compares with an SGPR destination in pixel_aot #800
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/806"
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 JB2WIN on 2026-11-23T06:16:09Z.
Change
VOPC e32 writes VCC only. LLVM 15.0.7 on
gfx1013rejectsv_cmp_lt_i32_e32 s52, v1, v2,v_cmp_lt_f32_e32 s52, v1, v2andv_cmp_lt_u16_e32 s52, v1, v2with "invalid operand for instruction". It assembles the suffix-lessv_cmp_lt_f32 s52, v1, v2asv_cmp_lt_f32_e64.pixel_aotand the scanner still accepted the e32 spelling with an SGPR destination.With this change, an explicit
_e32with a destination other thanvcc/vcc_loraisesVOPC e32 destination must be vcc. This applies to the f32, f16, i32/u32, i16/u16,class_f32andclass_f16compare branches, through one helper,check_vopc_e32_dst. The scanner marks those spellings unsupported.These keep their current behaviour:
_e64, as LLVM assembles it;_e64;vcc/vcc_lo, including the wave64vccspelling.No existing fixture used the refused form. The 64-bit compares (#803) already apply the same rule and are not touched here. I noticed this gap while working on #803.
AI-assisted (Claude Code).
Verification
Windows 11 10.0.26200.9974, NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP, at
186711d.ltandeq, plusclass_f32andclass_f16) is tested withs52ands[52:53]:_e32gives the exact message._e64._e32withvcc/vcc_lois still accepted.ctest --preset dev --no-tests=error -j4. 369 of 370 pass. The one failure iscompute_store_aot_hardware, which hits its 45 s timeout on this adapter on plainmainas well (#448). Skipped:bvh_wave64_hardware,bvh_wave64_warpandwave_shuffle_warp.form_coverage_check.py,rdna2_tools_check.py,pso_readiness_check.pyanddocs_links_check.pypass.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by MatyEjsr on 2026-11-23T06:36:12Z.
Verdict: Approve (reviewed head
1e268ab782c70bc6094ca34148ca00a33ad46101, compared againstmainab5d3a5).Verification
Environment: Windows 11 x64, Python 3.12.10, and WSL Arch
llvm-mc23.1.5 (-triple=amdgcn--amdpal -mcpu=gfx1013) for ISA checks. Zero-GPU review (no WARP or hardware draw executed).Commands and results on
1e268ab:python -B tests/pixel_aot_check.py: passed (exit 0).python -B tests/rdna2_tools_check.py: 65 passed, 1 skipped (test_llvm_comparison, skipped becauseLLVM_LIBis not set on Windows).python -B tests/docs_links_check.py(13 files, 154 links) andpython -B tests/bidi_controls_check.py(654 files): both passed.git merge-tree --write-tree main 1e268ab: clean againstab5d3a5(exit 0).Before vs. after against
main(ab5d3a5):main,scan_unsupported_shaders.is_instruction_supported()returnedTrueforv_cmp_lt_{f32,f16,i32,u16}_e32 s52, v18, v19,v_cmp_lt_f32_e32 s[52:53], v18, v19, andv_cmp_class_{f32,f16}_e32 s52, v18, 0x3, andpixel_aotaccepted them.1e268ab, all 6 non-SDWAv_cmp_*branches intools/pixel_aot.py(class_f32,class_f16,f32,f16,i32/u32,i16/u16) enforcecheck_vopc_e32_dst, and the correspondingtools/scan_unsupported_shaders.pyrules reject_e32with an SGPR destination while preserving suffix-less,_e64, and_e32 vcc/vcc_lo.Independent ISA and parity checks:
llvm-mc(-triple=amdgcn--amdpal -mcpu=gfx1013 -show-encoding): Across all 14 families ({f32,f16,i32,u32,i16,u16}×{lt,eq}+class_{f32,f16}):_e32withs52/s[52:53]rejected 28/28,_e32withvcc_loaccepted 14/14, suffix-less withs52accepted 14/14, and_e64withs52accepted 14/14.llvm-mcacceptsv_cmp_lt_f32_sdwawith bothvcc/vcc_loands52/s[52:53], confirming leaving thev_cmp_*_f32_sdwabranch unchanged is ISA-accurate.{_e32, suffix-less, _e64}×{vcc_lo, vcc, s52, s[52:53], exec, v12}) plus 5 modifier/SDWA cases (v_cmp_lt_f16with-s44andv_cmp_lt_f32_sdwa): 0 parity diffs.vcc/vcc_lo, suffix-less,_e64) and negative controls (_e32withs52/s[52:53]).AI-assisted review (local Python and
llvm-mcchecks executed locally).