compute: accept SGPR and inline-constant sources in binary16 SDWA #3242
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3242
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3240"
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?
@Leyukaka on GitHub · 2026-11-28 01:20 UTC · original
Leyukaka:sdwa-f16-scalar-src→main· +140 −12 · 6 files · 1 commits · merged 2026-11-28 01:42 UTCPart of #2935, claimed in #3226 (item 1 of my comment there). Target branch
main.Change (
src/gfx1013_compute_native.cpp,src/gfx1013_direct_compute.inl,docs/experiments/native-sdwa-f16.md): the binary16 SDWA VOP2 arithmetic (v_add_f16,v_sub_f16,v_subrev_f16,v_mul_f16) accepts an SGPR or an inline constant as src0 or src1. GFX10 SDWA allows this through extension bits 23 and 31, whichtools/disasm_rdna2.pydecodes the same way.packed_f16_inline_constant(#3232).v_min_f16/v_max_f16SDWA are untouched. They wait for #3127.tests/native_sdwa_f16_check.pydrops its two controls that expected these legal encodings to be refused.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
main7364e6a9plus this commit.New
native_sdwa_f16_scalar_irand_hardwarecompare exact words againsttests/f16_packed_model.pyfor five cases:Every register source (SGPR and VGPR) has distinct halves, and the destination checks both UNUSED_PRESERVE (sentinel kept) and UNUSED_PAD (zero).
Refusal controls: a literal, an SGPR selection with a modifier, a WORD_1 inline constant, and two SDWA min/max forms (0x39, 0x3a), still refused as "unimplemented direct SDWA operand profile".
With
main'snative_compute_ir_dump, the new test fails on "SDWA binary16 source must be a VGPR".33 tests pass with
-R "native_sdwa|native_f16|native_fma_f16|native_packed|native_cvt_f16|native_direct_container".Mutation check by hand: ignoring the inline-constant conversion fails both new tests.
Measured with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requestsonmain7364e6a9, before and with this commit.v_rcp_f16, which #3222 lowers.AI-assisted.
github-bot referenced this pull request2026-11-28 01:43:31 +00:00
@R0Y00 on GitHub · 2026-11-28 01:42 UTC · original · approved these changes
Reviewed
ae208bb98bon main8007a539. The integrated source tree is6fa0888f63. Checked the direct compute path for SGPR DWORD/WORD_0/WORD_1 and inline DWORD/WORD_0 as well as the inline high-half, literal, sign extension and opcode refusal controls.Debug 8/8 and Release /O2 8/8, no skips, using:
RTX 4060 Laptop GPU, driver 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. Hosted Windows (required), Linux Python, and gfx1013 assembly jobs passed. The hosted /O2 job was skipped.
github-bot referenced this pull request2026-11-28 02:28:22 +00:00