shader: lower binary16 SDWA reciprocal, square root and special functions #3586
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!3586
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3584"
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?
@lambirou on GitHub · 2026-11-30 10:59 UTC · original
lambirou:shader/f16-sdwa-unary→main· +587 −21 · 7 files · 1 commits · merged 2026-11-30 11:06 UTCPart of the f16 VOP1 slice (Refs #839).
This adds the SDWA spellings of the seven binary16 VOP1 unary opcodes:
v_rcp_f16_sdwa,v_sqrt_f16_sdwa,v_rsq_f16_sdwa,v_exp_f16_sdwa,v_log_f16_sdwa,v_sin_f16_sdwaandv_cos_f16_sdwa. The selected source half (src0_selWORD_0, WORD_1 or DWORD, with bit-15abs/neg) is widened exactly, evaluated with the same binary32 operation or RDNA 2 special-result helper as the plain opcode, narrowed to nearest even, and placed withdst_selanddst_unusedthrough the existing SDWA destination helper. A literal source, BYTE selections,sext(),UNUSED_SEXT, clamp, omod, a non-entry EXEC mask, a non-preserved denormal profile and an outstanding sample stay refused. Sources still need a static finite proof.Tests
pixel_aot_f16_sdwa_unary_warpand_hardwarepass: 15 positive draws (12 programs plus three-denorm ftzrepeats) and five mutations (rcp/sqrtswapped,rsq/expswapped,sin/cosswapped, high-half source,dst_selpadding) reportpixel_mismatchon WARP and on the AMD Radeon RX 9060 XT (driver 32.0.32029.2010, Windows 11 build 26300).check_f16_sdwa_unary_controlspins the reference rows for the seven ops and every spelling, proof, control, modifier, mode, scheduling and reader refusal, including that a 16-bit result's undefined high half is not readable.draw-sdwa-f16still passes on WARP and hardware; the neighbouring SDWA forms are untouched.form_coverage_check.pypins exactly the seven new SDWA forms;rdna2_tools_check.pypasses 161 tests (19 skipped) including the scanner/translator agreement.Limits
The high half of a
dst_sel:DWORDresult is not observed; the console's denormal and rounding state beyond the declared nearest-even entry profile is not measured; the LLVM 15 binary round-trip was not replayed locally; sources remain under the static finite-proof contract. No title is known to execute these paths.AI-assisted.