Repository navigation
Conversation
Sync upstream main
Add test for gfx1013 vop3 0x140 decoding as mad_legacy.
kacper-serewis
left a comment
There was a problem hiding this comment.
At a3b000e the synthetic fixture decodes to v_mad_legacy_f32 for both gfx1013 and gfx1030. AMDGPU LLVM 21 gives MAD on gfx1013 and FMA on gfx1030. Operands agree and both Python runs report zero invalid words, so the clean corpus count misses this error. The PR description also reverses the two architecture labels. #2786 and #4928 already match LLVM on these exact bytes for both targets. I recommend using the target-aware change and closing this shared-table edit as superseded. AI-assisted CPU review.
|
Windows test result for head a3b000e. Windows 11 Home (10.0.26300), CPython 3.14.10, CPU only, no game files.
AI-assisted (Claude Code) |
|
Tested
|
Kam471
left a comment
There was a problem hiding this comment.
Diff: VOP3 opcode 0x140 renamed v_fma_legacy_f32 → v_mad_legacy_f32 in tools/rdna2_isa_tables.py, plus a hand-encoded regression test covering decode, format and the Python shader_disasm backend.
Tested:
python -I -m pytest tests/test_rdna2_decode.py tests/test_isa_coverage.py -q→ 25 passed, 5 skipped, 4 subtests passed.git diff --check→ clean.
Verdict: PASS for the console target; this matches docs/design.md (0x140 is v_mad_legacy_f32 on gfx1013).
Note: the table is shared and the module docstring still advertises GFX10.1/GFX10.3, where 0x140 is v_fma_legacy_f32. No current caller decodes gfx103x with the Python backend, so this is not a blocker, but the docstring/claim is now stale.
|
Agreed with the requested-changes review. The shared-table edit also changes gfx1030, where this encoding must remain #4928 already provides target-aware handling for this opcode and the related legacy MAC/MAD forms, with independent validation. I am closing this PR as superseded by #4928 rather than duplicating that implementation. Thanks to the reviewers and testers for catching this and checking the change. |
|
Tested a3b000e on Linux, Python 3.13 (CPU only, no GPU, no game files): pass with notes Ran
Read
AI-assisted (Claude Code). Generated by Claude Code |
|
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Verified the hand-encoded VOP3 instruction 0xD5400008 0x040E0501 (enc=0x35, op=0x140, vdst=v8, src0=v1, src1=v2, src2=v3) against GFX10.1 (gfx1013), where VOP3 0x140 is v_mad_legacy_f32 alongside 0x141 (v_mad_f32), consistent with tools/rdna2_isa_tables.py's gfx1013 target. Tested locally: tests/test_rdna2_decode.py 10 passed (1 skipped), git diff --check clean. No game files. AI-assisted review (Gemini).
Summary
SHADER-873: decode GFX10.3/RDNA2 VOP3 opcode0x140asv_mad_legacy_f32, rather than the GFX10.1v_fma_legacy_f32mnemonic.0xD5400008 0x040E0501) covering operand decoding, formatting, and the Pythonshader_disasmbackend.Validation
python -m unittest tests.test_rdna2_decode: 10 passed, 1 skipped.python -m unittest tests.test_isa_coverage: 20 passed, 4 skipped.v_mad_legacy_f32.AI-assisted: Yes.