Repository navigation
Shaders: lower 64-bit shifts without INT64 - #726
Open
scoresby13 wants to merge 1 commit into
Open
scoresby13 wants to merge 1 commit into
scoresby13 wants to merge 1 commit into
Conversation
|
An AMD run of this PR's new tests. The setup, and the same run for eight related shader PRs, are in one table on #637: #637 (comment) |
HAL9000RELOADED
added a commit
to HAL9000RELOADED/victory-fork
that referenced
this pull request
Nov 26, 2026
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.
Summary
Lowers all six 64-bit scalar and vector shift instructions (
s_lshl_b64,s_lshr_b64,s_ashr_i64,v_lshlrev_b64,v_lshrrev_b64,v_ashrrev_i64) invictory-shaderusing pure 32-bit DXIL operations on(lo, hi)dwords (shift64+src64_dwords), removingflags::INT64(SFI0bit0x8000/Int64ShaderOps) from shaders that use 64-bit shifts.Details
sh = shift & 31,wide = (shift & 32) != 0, andinv = 31 - sh, computing cross-dword carries via(lo >> 1) >> inv(Shl) and(hi << 1) << inv(LShr/AShr) so every 32-bit DXIL shift stays in0..=31._i64literal sign-extension, and scalarSCCupdates.SFI0validation (shifts_64_bit_need_no_int64) and GPU/WARP tests (v_shift_64_matches_rdna2_without_int64,s_shift_64_matches_rdna2_without_int64) covering 126(value, shift)pairs per instruction plus inline-1and literal-100cases.Testing
cargo clippy -p victory-shader --all-targets --locked -- -D warnings(passed)cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings(passed)cargo xtask policy(asset policy: 169 files ok)cargo test -p victory-shader --locked shift -- --nocapture(3 passed, 0 failed)No game data was used. AI-assisted.