Repository navigation
Conversation
VOP3 only. Each half is clamp(S, 0, 1) * 65535 rounded to nearest even, a NaN reads 0. Output modifiers and op_sel are refused. Refs R0Y00#870.
Collaborator
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 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 startup: refuse an op_sel the float lowering does not model #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, startup: translate v_swap_b32 in gfx2hlsl #1796, startup: lower the binary32 class comparison #1798, startup: refuse a modifier for handlers that do not model one #1778, startup: refuse an op_sel the float lowering does not model #1755, startup: write shader requests from the shader archive before a run #1750: no conflicts. startup: guard and verify 64-bit VOP3 shifts in gfx2hlsl #1783 and startup: lower v_mul_hi_u32 in gfx2hlsl #1747 conflict with main already (same counts as without this branch).AI-assisted; commands listed were executed locally.