startup: accept SGPR, hex and inline 0 sources in packed f16 add, mul and fma #2930
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!2930
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2930"
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-26 21:44 UTC · original
Leyukaka:pk-arith-sources→main· +152 −54 · 5 files · 1 commits · closed without mergingPart of #2022 (claim). Stacked on #2927: the first commit is #2927, and this PR adds the second one (
071de02e).Change (
tools/startup/gfx2hlsl.py):v_pk_add_f16,v_pk_mul_f16andv_pk_fma_f16now take the sources that #2927 accepts for min and max:S()afterreject_lane_mask_data;0.packed_halfnow validates the sources once for all five instructions.op_selandop_sel_hiselect the half of each source as before (thevop3p_f16_wordrule intools/pixel_aot.py). The arithmetic is unchanged:f16tof32of the selected halves, thenf16rnof the result. Min and max still select an encoding.Still refused, with the existing messages:
v255, now checked for add, mul and fma as well;neg_lo,neg_hi,clampand other modifiers.Tests (Windows 11, Python 3.14, DXC from the Windows SDK 10.0.26100, on main
6ee878d8plus both commits):tests/startup_gfx2hlsl_pk_minmax_check.py, extended: ok.0under default and flipped selectors.... draw <dxc> <offscreen_check> warpandhardware: ok on WARP (Microsoft Basic Render Driver) and an NVIDIA GeForce RTX 5080. For each of add, mul and fma, a literal source and an SGPR source under default and flipped selectors are read back against an independent CPU reference (structbinary16, round to nearest even). One case selects a literal's zero high half.tests/startup_gfx2hlsl_f16_alu_check.py: its controls that packed mul and add refuse a hex literal and an SGPR are removed, since this PR accepts them. Its inline-float refusal stays, and the check is ok.startup_translator_check,startup_gfx2hlsl_refusals_check,docs_links_check,bidi_controls_check.Mutation checks, run by hand; each fails the controls and the WARP draw:
op_sel/op_sel_hiroles;Measured on a local capture (counts and instruction shape only):
v_pk_max_f16andv_pk_mul_f16with both commits. It now stops at the SDWA form ofv_exp_f16.v_pk_mul_f16with an SGPR source now translates;v_pk_mul_f16literal now also stop at the SDWAv_exp_f16.AI-assisted.
@KelboLive on GitHub · 2026-11-27 05:23 UTC · original · reviewed
PR #2930 by @Leyukaka — startup: accept SGPR, hex and inline 0 sources in packed f16 add, mul, and fma
What works
Issues
Recommendations
Overall
Natural extension of #2927 and the min/max support. The source centralization into packed_half is clean, and the test coverage is solid. With the source-handling docs update, this would be merge-ready once #2927 lands.
071de02ee0to9eac81b134@Leyukaka on GitHub · 2026-11-27 05:42 UTC · original
Rebased on
mainnow that #2927 is merged: this PR is down to its own commit (9eac81b1) and no longer conflicts. After the rebase,startup_gfx2hlsl_pk_minmax_check,startup_gfx2hlsl_f16_alu_check,startup_gfx2hlsl_compute_checkandstartup_gfx2hlsl_refusals_checkpass.AI-assisted.
9eac81b134tod220d3cc43@Leyukaka on GitHub · 2026-11-29 12:24 UTC · original
Closing this draft: no update since 2026-11-27 and I am not continuing it. My claim on #2022 for this item is released.
Pull request closed