Repository navigation
shader, docs: fill GFX10 decoder gaps - #68
Conversation
|
Other open pull requests change the same files. Check that they do not do the same work, and agree with their authors on which lands first: the other one will then need a rebase.
This comment is kept up to date automatically and removed when the overlap ends. |
simnJS
left a comment
There was a problem hiding this comment.
Thanks, this is clean and well tested. Every new opcode matches LLVM 19.1.7 and AMD's RDNA2 spec, and nothing that decodes today changes. A few small points:
- README.md is touched too, so the title should be
shader, docs: fill GFX10 decoder gaps. - The header of
gfx10/opcodes.rssays the tables are generated from Mesa. Please note that the new rows come from LLVM (Apache-2.0 WITH LLVM-exception). - In
emit/lower/image.rs:378-381,_cd_g16is refused because the coarse form picks one level per quad. Main already lowersimage_sample_cdthrough SampleGrad and accepts that difference, so please lower_cd_g16the same way, or explain why it should differ. - Optional: 0x0ec–0x0ef (
*_cd*_o_g16) are valid GFX10 opcodes too.
Heads-up: #52 adds a stale-pin check (gfx10_conformance.rs:217). Whichever of this PR and #52 lands second will need to remove the pins it covers.
The nine |
|
Thanks, all four points are addressed, and comparing the output with Two non-blocking nits:
|
With the conformance corpus on main, the nine names this change decodes would fail its stale-pin check. Also keep the shortcut: prefix on the coarse-form comment and cite LLVM's MIMG table for 0x0ec..=0x0ef.
|
Thanks. Merged main (with #52) and removed the nine |
simnJS
left a comment
There was a problem hiding this comment.
Thanks, everything is in:
- all nine pins are gone and both legacy pins stay;
shortcut:is back;- 0x0ec–0x0ef cite MIMGInstructions.td.
The only red check, gpu-debug-layer, fails in an xtp-gpu test this PR doesn't touch (a_placed_slot_follows_its_memory_when_unmapped, green on main). I'm rerunning it and will merge once it's green.
What and why
Fill the nine GFX10 decoder gaps found by the LLVM MC corpus and add the four packed coarse-gradient offset opcodes identified in review. The e64 f32 interpolations share the VINTRP names and retain their VOP3 operands and modifiers. The image and signed packed dot instructions use their existing MIMG and VOP3P layouts.
The four non-comparison packed coarse-gradient samples use the existing
SampleGradpath, including the clamp and offset variants. The host chooses a mip level per lane. This agrees with GFX10's per-quad selection when the gradients agree across the quad. Comparison forms with explicit gradients keep the SM 6.6 diagnostic. The new interpolation, gather and signed dot forms still need DXIL lowering.Fixes: none. This covers the decoder gaps in #64. The legacy MAD/MAC question stays open.
Depends on: none. #52 has landed; this PR removes the nine
KNOWN_DECODER_GAPSpins it fixes (tests/gfx10_conformance.rs), so the conformance test now passes with none. The two legacy-name pins still apply.Area
xtp-shaderGFX10 decoding, disassembly and DXIL image lowering. The README documents the decoder and translation coverage.Tests
cargo xtask pr-checkpasses on my machine with--skip testcargo xtask pr-check --base upstream/main --title "shader, docs: fill GFX10 decoder gaps" --skip testpassed formatting, both Clippy configurations, asset policy, and commit and title conventions.cargo test -p xtp-shader --libpassed 479 tests with 41 ignored, andcargo test -p xtp-shader --test gfx10_conformancepasses with no decoder gap pins. Translation tests compare the emitted DXIL of each non-comparison coarse form to its fine-gradient equivalent with both address widths. Decoder tests cover the offset encodings and operand counts. All four comparison forms retain the explicit-gradient diagnostic.Provenance
llvmorg-19.1.7(Apache-2.0 WITH LLVM-exception),llvm/test/MC/AMDGPU/{gfx10_asm_vop3.s,gfx10_asm_mimg.s,gfx1011_dlops.s}. The opcode numbers and mnemonics supply VOP3P0x018and MIMG0x061and0x0e8..=0x0ebingfx10/opcodes.rs. Numeric fixtures are ingfx10/mod.rs,emit/input_tests.rsandemit/lower/tests.rs, all undercrates/xtp-shader/src/. I cross-checked the images against shader, xtask, docs: add a reduced GFX10 conformance corpus #52's LLVM corpus shard.0x0ec..=0x0ef(image_sample_*cd*_o_g16) are the GFX10 opcodes in LLVM'sllvm/lib/Target/AMDGPU/MIMGInstructions.tdat the same tag. Thegfx10/mod.rsfixtures for these entries combine the packed samples and coarse offset layouts from the same LLVM MC source. The translation tests use synthetic shader programs.mesa-22.3.0,src/amd/compiler/aco_opcodes.py(MIT), supplies the rest of the pre-existinggfx10/opcodes.rstables and retains its notice there.AI assistance: AI coding tools wrote this change and its tests, mainly OpenAI Codex.
Checklist
<area>: <summary>; one topic; under 400 changed lines, or the reason is above