shader: lower quad-local DPP16 and DPP8 32-bit integer/bitwise/shift ops in pixel_aot #408
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/414"
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 KomaGuy on 2026-11-22T00:51:28Z.
Change
Lower quad-local
DPP16(quad_perm) andDPP8(dpp8) forms for 23 32-bit integer, 24-bit multiply, bitwise, shift, and bit-scanVOP1/VOP2operations intools/pixel_aot.py, covering 23 additionalDPP16and 23 additionalDPP8forms (+46 forms on bothgfx1013andgfx1030):v_*_dppinstructions (23):v_add_nc_u32_dpp,v_sub_nc_u32_dpp,v_subrev_nc_u32_dpp,v_min_i32_dpp,v_max_i32_dpp,v_min_u32_dpp,v_max_u32_dpp.v_mul_i32_i24_dpp,v_mul_hi_i32_i24_dpp,v_mul_u32_u24_dpp,v_mul_hi_u32_u24_dpp.v_and_b32_dpp,v_or_b32_dpp,v_xor_b32_dpp,v_xnor_b32_dpp,v_not_b32_dpp.v_lshlrev_b32_dpp,v_lshrrev_b32_dpp,v_ashrrev_i32_dpp,v_bfrev_b32_dpp,v_ffbl_b32_dpp,v_ffbh_u32_dpp,v_ffbh_i32_dpp.src0asuintbits viaQuadReadAcrossX,QuadReadAcrossY,QuadReadAcrossDiagonal, or uniformQuadReadLaneAt(selected viaWaveGetLaneIndex() & 3u), staying valid across wave sizes 4 (WARP) through 64. Optional helpers (dpp_mul_hi_u24,dpp_mul_hi_i24using 12-bit limb splits without 64-bit integer shader requirements, and MSB-indexeddpp_ffbh_u32/dpp_ffbh_i32) are emitted only when used; existing shaders emit none of them.DPP8,row_*/wave_*controls, partial masks (row_mask/bank_mask != 0xf), FP source modifiers (-/|.|), non-VGPR operands, WQM, andvmcnthazards.DPP_INT32_BODYderives integer quad lane ID{0, 1, 2, 3}fromuv.x/uv.y, exercises all 23 forms across 3 constant sets (including negative/extremei24products, zero/all-ones bit scans, and shift counts>= 32), exports all 4 bytes of the 32-bit accumulator as exact[0, 255]integers, and checks 5 negative mutations.Verification
Tested on Linux x86_64 (Python 3.13.5, LLVM 19.1.7, Clang 19.1.7) on top of
6549244:python3 -B tests/pixel_aot_check.py binary llvm-mc-19 llvm-objcopy-19 libLLVM-19.so— passed (controls, negative controls, andllvm-mc -mcpu=gfx1013assembly→DXBC/XDAT/XBCH/FSSM→disassembly→lowering parity forDPP_INT32_BODYand all existing fixtures).python3 -B tests/ffx_dispatch_aot_check.py llvm-mc-19 llvm-objcopy-19 libLLVM-19.so— passed.python3 -B tests/script_state_check.py,tests/bcpack_check.py,tests/resource_ranges_check.py,tests/layout_chunks_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py— all passed.tools/form_coverage.pyrecords 23DPP16and 23DPP8forms against bothdocs/coverage/gfx1013.tsvanddocs/coverage/rdna2.tsv.dpp_mul_hi_{u,i}24anddpp_ffbh_{u,i}32helpers) forDPP_INT32_BODYand all 5 negative mutations on a 4-lane SIMT 2×2 pixel quad C++20 harness withclang++-19 -std=c++20 -O2 -Wall -Wextra -Wpedantic -Werror -fsanitize=undefined,address— bit-exact match across all 4 quad lanes on all 3 constant sets and all 5 mutations caught; 0 sanitizer errors.dxc -Gis -T ps_6_0), WARP (pixel_aot_warp), and hardware (pixel_aot_hardware) checks were not run locally on Linux; relying on thebuild-and-testWindows CI job to verify DXC compilation and D3D12 WARP quad readback.Evidence and follow-up
tests/pixel_aot_check.pyare original MIT-licensedgfx1013assembly sequences built from source at test time.f32/move/selectDPP16/DPP8forms) with zero opcode overlap; remainingf16and conversionv_*_dppforms stay rejected here for separate focused PRs.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-22T11:56:43Z.
Refreshed #414 onto current
main(96e836d, reusing #408's shareddpp_vgpr/parse_dpp/emit_quad_swizzle_u32helpers andcompile_shader); all 4 CI checks pass. Holding off on refreshing #419, #421, #423, and #428 until this lands.