Repository navigation
[upstream #1052] gpu/recomp: emit direct QuadReadAcross intrinsics for symmetric DPP quad swizzles - #98
Closed
ufoptg wants to merge 1 commit into
Closed
[upstream #1052] gpu/recomp: emit direct QuadReadAcross intrinsics for symmetric DPP quad swizzles#98ufoptg wants to merge 1 commit into
ufoptg wants to merge 1 commit into
Conversation
…uad swizzles Detect symmetric quad cross-lane permutations in DPP16 and ds_swizzle_b32 controls and emit direct HLSL SM 6.0 intrinsics: - Horizontal neighbor exchange (lanes 0<->1, 2<->3): QuadReadAcrossX - Vertical neighbor exchange (lanes 0<->2, 1<->3): QuadReadAcrossY - Diagonal neighbor exchange (lanes 0<->3, 1<->2): QuadReadAcrossDiagonal This avoids falling back to the 4-way QuadReadLaneAt lookup and selection ladder, allowing single-cycle execution on hardware quad swizzle units such as Intel Arc Xe-cores.
Owner
Author
|
Upstream PR xcl-dev#1052 was closed or merged. |
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.
This pull request implements direct Shader Model 6.0 quad swizzle intrinsic emission for symmetric DPP16 and ds_swizzle_b32 cross-lane permutations:
In
crates/xcl/src/gpu/recomp/emit.rs, DPP quad permute andds_swizzle_b32operations previously fell back to callingrla(orxcl_x_rla_half). In pixel shaders,rlaexecuted 4 sequentialQuadReadLaneAt(v, 0..3)lookups followed by a selection ladder, and in compute shaders,WaveReadLaneAt.We inspect DPP16 control codes and
ds_swizzle_b32offsets to detect symmetric quad cross-lane exchange patterns across each quad:QuadReadAcrossX(v)(DPP controls0xB1,0x161; swizzle offsets0x80B1,0x041F)QuadReadAcrossY(v)(DPP controls0x4E,0x162; swizzle offsets0x804E,0x081F)QuadReadAcrossDiagonal(v)(DPP controls0x1B,0x163; swizzle offsets0x801B,0x0C1F)When matched, the recompiler emits the single-cycle HLSL SM 6.0 quad intrinsic directly (
QuadReadAcrossX,QuadReadAcrossY, orQuadReadAcrossDiagonal) instead of the 4-wayQuadReadLaneAtlookup and selection ladder. On Intel Arc Xe-cores (and modern SM 6.0 hardware), this maps directly to native single-cycle execution on dedicated quad swizzle hardware.In
crates/xcl/src/gpu/recomp/tests.rs:direct_quad_swizzle_patterns: verifies that symmetric DPP controls and swizzle offsets correctly map toQuadIntrinsic, and that asymmetric patterns (shifts, mirrors, rotates, FFTs) returnNone.gpu_direct_quad_swizzles: executes DPP and ds_swizzle shaders across all 64 lanes on hardware, validating bit-exact horizontal, vertical, and diagonal quad neighbor exchanges across all 4 quad lanes.Tested
cargo test -p xcl --lib direct_quad_swizzle_patterns(passed)cargo test -p xcl --lib gpu_direct_quad_swizzles(passed, bit-exact results across all 4 quad lanes)cargo test -p xcl --test gpu_pso_e2e(7/7 passed)cargo test -p xcl --lib gpu_sdwa_dpp_and_cross_lane(passed),cargo test -p xcl --lib gpu_ds_swizzle_modes(passed),cargo test -p xcl --lib gpu_ds_swizzle_and_bpermute_zero_inactive_lanes(passed)Regression run
main(e74dda2):PR (
8de58c8):Not tested
AI use
Mirror of xcl-dev#1052 (auto-synced, do not edit).