Shaders: lower 64-bit shifts without INT64 #45
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/45"
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 Zettrox/ztrx. Originally posted by scoresby13 on 2026-11-25T05:48:01Z.
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 --workspace --all-targets --locked -- -D warnings(passed)cargo clippy --workspace --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.
Imported from Zettrox/ztrx. Originally posted by futurepro62 on 2026-11-25T06:38:31Z.
Full-suite run on Windows, since this PR has no test report yet. Tested exact head
b5dbeb6(on its base90b529f).Tested
rust-toolchain.toml), DXC + dxil.dll 1.9.2602.17, debug.cargo test --workspace --locked: 499 passed, 0 failed, 7 ignored (main90b529fon this machine: 496 passed, 0 failed, 7 ignored).cargo clippy --workspace --all-targets --locked -- -D warnings(the CI lint step): passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(the CI lint step): passed.shifts_64_bit_need_no_int64,v_shift_64_matches_rdna2_without_int64,s_shift_64_matches_rdna2_without_int64.Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.