Repository navigation
shader: lower quad-local DPP16 and DPP8 32-bit integer/bitwise/shift ops in pixel_aot - #414
Merged
Merged
Conversation
This was referenced Nov 22, 2026
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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