startup: lower v_cvt_pknorm_u16_f32 in gfx2hlsl #1815
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!1815
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1815/head"
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?
@tedin7 on GitHub · 2026-11-24 19:07 UTC · original
tedin7:x2w-frontier-gfx-pknorm16→main· +190 −0 · 4 files · 1 commits · closed without mergingPart of #870 (no
Fixes). Draft.What
Lowers
v_cvt_pknorm_u16_f32intools/startup/gfx2hlsl.py. It was refused as unsupported, which stops the pair behind #1710.The instruction is VOP3 only (opcode 0x369, no e32 form). Per the public RDNA ISA description:
Lowering:
uint(round(saturate(a) * 65535.0)) | (uint(round(saturate(b) * 65535.0)) << 16).Source neg and abs reach the operands. Any output modifier (clamp, mul, div) or op_sel is refused, because it would change the packed words. This matches the refusal style of #1755 and #1778 without depending on them. No other open PR implements this instruction.
Change
op_v_cvt_pknorm_u16_f32method (the dispatch finds it by name, so no table row). Placed away from the hunks of #1755.tests/startup_gfx2hlsl_pknorm_u16_check.pyon the shared lane runner, registered inCMakeLists.txtand.github/workflows/windows.yml.Test
llvm-mc, words recorded (checked with llvm-mc-19 for gfx1010 and gfx1030, same 0x369 VOP3 word; CI uses llvm-mc-15 in binary mode).The reference rounds the binary32 product. For 1.5/65535 that product is exactly 1.5 and ties to 2, while the exact value of the nearest binary32 input is just under 1.5. No hardware run of this instruction was available, so the draw mode is what confirms it.
Commands executed locally
python3 -B tests/startup_gfx2hlsl_pknorm_u16_check.pyand... binary llvm-mc-19: okllvm-mc-19 -mcpu=gfx1010andgfx1030encodings of the instruction, plain, with neg/abs and with clampgit diff --check,tests/docs_links_check.py,tests/bidi_controls_check.py: passgit merge-treeagainstorigin/main, #1796, #1798, #1778, #1755, #1750: no conflicts. #1783 and #1747 conflict with main already (same counts as without this branch).AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-24 19:14 UTC · original
Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.
Pull request closed