Repository navigation
rdna2_isa_tables: add gfx1013 VOP3 0x16b v_mul_lo_i32 (BUILD-1529) - #5641
kotekompotek wants to merge 1 commit into
Conversation
|
Verified
No GPU, no game data. AI-assisted. |
|
This overlaps the earlier BUILD-1529 patch in bobcatchris/Leonida#3, claimed in #4933. I trial-merged The table entry fixes gfx1013, but the trial merge also decodes 这与先前在 #4933 认领的 BUILD-1529 补丁 bobcatchris/Leonida#3 重叠。我在 Windows 试合并了 表项修复了 gfx1013,但试合并版本在 gfx1030 和 gfx1036 上也解出 |
|
Code read of
AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
|
Tested 5cddba2 on AMD BC-250 (gfx1013, Cyan Skillfish), Linux libdrm hw_oracle with #6179, Mesa 26.2.7, kernel 7.3.3, Fedora 44: the new row matches LLVM 22 llvm-mc -mcpu=gfx1013 (VOP3 0x16b, VDST/SRC0/SRC1). rdna2_decode now prints the same text as llvm-mc for 16 test encodings (VGPR, SGPR, SGPR+SGPR, literal and inline-constant operands); without this PR they decode as invalid. tests/semantic gives the same results with and without the PR (5,930 pass; the 4 failures in test_image_atomics_guard and test_image_store_d16 are already on main). On hardware, though, v_mul_lo_i32 does not multiply. Over 5,440 (a, b) pairs (edge values incl. 0, ±1, INT32_MIN/MAX, 0xFFFFFFFF, overflowing and mixed-sign products, plus 4,608 seeded random pairs) × 8 operand forms × wave32/wave64 = 87,040 checks, it wrote 0 every time: it overwrites a pre-filled destination, so it is not a no-op. The same happens with the raw .long encoding and with s_nop padding. The control v_mul_lo_u32 (0x169) matched (a*b) & 0xFFFFFFFF on all 87,040. No GPU resets. So the decoder row is right, but on this gfx1013 silicon a translation to a plain OpIMul (#3504) would not match the hardware; whether the console's gfx1013 behaves the same is unknown. A run on an RX 5000 card (gfx1010/1011/1012) would show whether this is GFX10.1-wide; I can share the probe. AI-assisted (Claude Code). |
isfcrctfs
left a comment
There was a problem hiding this comment.
Read at the PR head (5cddba22) against current origin/main (6dda063).
- Audit (
audit.py pr 5641): clean. - Entry verified independently:
llvm-mc -triple=amdgcn -mcpu=gfx1013assemblesv_mul_lo_i32 v1, s0, s1to01 00 6b d5 ...(VOP3 opcode 0x16b, VDST/SRC0/SRC1, one dword each), and rejects it for gfx1030 ("instruction not supported on this GPU"). Decoding the hand-built word(0x35 << 26) | (0x16b << 16) | 1with the PR printsv_mul_lo_i32 v1, s0, s1; with the PR's base tables the same word is counted invalid (invalid == 2), so the change is observable and is not a duplicate key. python3 -I tests/test_rdna2_decode.py: 9 tests, 8 OK, 1 skipped.
The table entry itself is correct. Two gaps, both raised above:
- Nothing pins the row: the decode suite passes identically before and after, so a later table edit can drop 0x16b silently. A case in
tests/test_rdna2_decode.pywith this one word would fix that. - Target gate: current main already gates the other gfx1013-only VOP3 entries (
tools/rdna2_decode.py:932,if opc == 0x140 and mcpu.startswith("gfx101")).decode_bytesdefaults tomcpu="gfx1013"and has no such check for 0x16b, somcpu="gfx1030"/"gfx1036"decode it where LLVM rejects it. The same pattern, applied after the literal length is known, would keep wrong-target listings honest. A test asserting accepted on gfx1013 and rejected on gfx1030 covers both.
Decoding alone does not make the op translatable: tools/rdna2spirv.py has no v_mul_lo_i32 rule, so it still ends in Unsupported, as docs/design.md says.
AI-assisted
|
Tested 5cddba2 applied on main 867d922, Windows 11, Python 3.14.6, no GPU: pass. The encoding matches LLVM: A follow-up, not for this PR: AI-assisted review (Claude Code). |
Implements BUILD-1529 (claimed in #4933):
0x16b(v_mul_lo_i32, gfx1013) toVOP3intools/rdna2_isa_tables.py.python -m pytest tests/test_rdna2_decode.py --basetemp D:\temp\pytest_tmp -q:8 passed, 1 skipped in 0.80sgit diff --check(clean)