docs(shader): record VOP3 16-bit integer clamp on gfx1036 #21997
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21997"
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?
Imported from boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-17T01:08:24Z.
What
Measures one clause of the [VOP3 16-bit integer binary clamp] entry of
docs/dev/debt/shader.md(added by #19337): "the behaviour is not measured on hardware (min, max and shifts cannot saturate, v_mul_lo_u16 remains open)". No code changes.Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle, wave32. The bodies are the
Codewords ofVop3Integer16Clamp.cppwith only the destination register moved, so each of the eight opcodes runs with and without the clamp bit (bit 15 of the first VOP3 dword) on the same inputs: the test's 32Rowsplus 32 rows whosev_mul_lo_u16product exceeds 0xffff (64 input rows per opcode).v_mov_b32 v10, 0x2aprobe 32 of 32;v_add_nc_u16with clamp saturates to 0xffff on 16 of 16 overflow rows where the form without clamp wraps (32 of 32 match the low 16 bits of the sum), so the clamp bit reaches the 16-bit integer ALU on this part.v_mul_lo_u16in both bodies).v_mul_lo_u16with clamp keeps(a*b) & 0xffffon all 76 overflowing lanes (38 rows, two bodies) and never saturates to 0xffff; bits 31:16 of the destination are 0 in both forms. The test's lavapipeExpectedtable matches the hardware 288 of 288.verify_clamp16.py, reads the dumps only, decodes opcode, vdst and clamp from the raw words itself and cross-checks all 40 instruction words againstllvm-mc-21 -mcpu=gfx1036, expected values from its own integer model): PASS, model 1,280 of 1,280 words; 18 mutation controls each fire from that passing baseline.The hardware agrees with the decoder's "without effect"; the implementation sentence is not edited.
Evidence (runners, every dump, claims worksheets, checker, verifier, overlap sweeps, SHA-256 ledger): https://gist.github.com/brumskysb/71b0044d4089fa162d183af656623026
Tested
gfx1036, driver 31.0.22044.1, Windows 11. Harness:tools/hw-oraclevia the campaign'srigio.py(in the gist).c50f19c4b8, themainfetched before the edit; it changes only line 269 ofdocs/dev/debt/shader.md.Only that clause changes.
Before:
After:
CHANGE SUMMARY (from the gate):
Removed phrases declared to the gate:
behaviour,measured on hardware (min, max and shifts cannot saturate, v_mul_lo_u16 remains open),. "measured" is re-added; "RDNA2 ISA Table 88 is cited only as an encoding reference pointer" and "console comparison on gfx1013 remains unmeasured" are unchanged.Notes
debt-length: the entry grows from 714 to 917 characters, under the 1,000 guideline.overlap_sweep.pyonc50f19c4b8(1,593 open PRs, 91 candidates, 91 evaluated, 0 hits; controls A/B fire, C silent). No open PR edits this entry.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attached to this PR)