Repository navigation
shader: lower s_bitcmp{0,1}_b{32,64} and s_sext_i32_i{8,16} - #142
n-romanovich wants to merge 3 commits into
Conversation
|
This overlaps two open PRs by tedin7: #117 adds A possible split: Static review, not built or run. |
|
Tested
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent). |
…8,16} Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
RDNA2 hardware check of the six instructions: all match. Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. Hand-written instructions in a HIP kernel (assembled by the AMD driver's amd_comgr). RDNA2 desktop silicon, not the console's. No game data. 130 cases: sources from edge values (
AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run. |
…p redundant sext from no-scc list
|
Thanks for the review! Addressed the feedback and resolved the compilation issue in the latest commit. All tests pass cleanly. |
|
Tested head Merged onto current There's no text conflict, so GitHub still shows the PR as mergeable, but merging it as it is would break With
AI-assisted (Claude Code). |
|
Merged onto Checked with CI's steps (both clippy runs with |
… to resource::track per 6638098
|
Thanks for the catch, @alexdeliu! Merged latest main, dropped the duplicate s_bitcmp matching arm (now present via #117), and updated resource::track in the test to pass Some(&st) per 6638098. Verified with Clippy (-D warnings) and tests on hardware — all pass cleanly. |
|
@n-romanovich rechecked |
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #120. s_bitcmp0/1_b32/_b64 are already lowered in main (lower.rs sop(), strip_prefix("s_bitcmp")); the only new lowering, s_sext_i32_i8/i16, is identical to #120's, which covers more. Its GPU test builds HostShader with the old field set and does not compile on main. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Implements DXIL lowering for six scalar ALU instructions in
victory-shader:s_bitcmp0_b32,s_bitcmp1_b32: extracts bitsrc1 & 31fromsrc0and writesSCC(== 0/!= 0).s_bitcmp0_b64,s_bitcmp1_b64: selects the low or high 32-bit dword viasrc1 & 32(without requiring DXILINT64), extracts bitsrc1 & 31, and writesSCC.s_sext_i32_i8,s_sext_i32_i16: sign-extends the low 8 or 16 bits ofsrc0toi32viashl+ashr(24/16) without modifyingSCC.Testing
emit::tests::scalar_bitcmp_and_sext_execute_on_gpuincrates/victory-shader/src/emit/mod.rs, covering all six opcodes (bit index masking, high-dwordb64bits, inline-1sign extension, positive/negativesext, andSCCpreservation).dxil.dlland executed the compute shader on D3D12 (NVIDIA GeForce RTX 5060 Ti).cargo test -p victory-shader: 58 passed, 0 failed.cargo clippy -p victory-shader --all-targets -- -D warnings: passed with 0 warnings.cargo xtask policy: passed (asset policy: 150 files ok).cargo test --workspace: all active tests passed (3 tests invictory-formatsignored without external reference files).