From 26eba92b8716e607ebe55e281469ee0a17ae3752 Mon Sep 17 00:00:00 2001 From: elforeign <324243036+elforeign@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:26:42 -0600 Subject: [PATCH] docs: record the VOP2 VCC-reading forms' Metal readback (#215) scripts/test-gpu.sh now runs vop2_vcc_matches_guide_on_native_metal, which passes under API and shader validation. Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com> --- CHANGELOG.md | 2 +- docs/shaders/instruction-coverage.md | 8 ++++---- docs/shaders/vector-vcc.md | 4 ++-- docs/status.toml | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c54d5..45418b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ remains unsupported. - Extended the read-only RDNA2 planning CLI (`python3 -m qa rdna2`) with family/status filters, compact summaries, Codex-ready manifests under `artifacts/`, active-claim exclusion (family claims exclude those families; path-only claims block overlapping permitted files), coverage reconcile against `semantic_coverage` without inflating counts, and inventory diffs. Covered by `tests/qa/test_rdna2_plan.py`; planning only, no GPU production edits. ### Added -- Added four Wave32 gfx1030 VOP2 select and carry forms through the semantic registry. Conditional select, add with carry and both subtract orders with borrow use a per-lane VCC bit and have a guide-derived CPU oracle. Native Metal verification and independent acceptance are pending. Part of #215. +- Added four Wave32 gfx1030 VOP2 select and carry forms through the semantic registry. Conditional select, add with carry and both subtract orders with borrow use a per-lane VCC bit and have a guide-derived oracle that passes on both CPU interpreters and on native Metal (local Apple M5, API and shader validation); independent acceptance is pending. Part of #215. - Added MOVS and STOS for 8- to 64-bit elements, with and without REP, and the direction flag with CLD and STD (#129). A REP form runs one element per step and stays on the instruction until RCX is zero, so every element counts against the step budget, a repeat can stop part-way and resume, a zero count touches nothing, and a fault keeps the elements already done with RSI, RDI and RCX at the one that faulted. An FS or GS override applies to the MOVS source only. Both engines run these on the shared semantics with no bulk-copy path, so large copies are slow. LODS, CMPS, SCAS, REPE, REPNE and the address-size override stay rejected. Fourteen SDM-derived cases already in `cpu_known_answers.rs` moved from refused to verified, and `tests/cpu_rep.rs` adds a byte-array model over every form, direction and count; not compared with x86 hardware and awaiting independent review. - Added decoding and Metal shader translation for the sixteen Wave32 VOPC 64-bit integer compares (#215). They read VGPR pairs, known even-aligned SGPR pairs or sign-extended inline integers and write the Wave32 VCC mask. The guide-derived oracle passes on native Metal (4,640 cases in 3,818 programs on a local Apple M5 under API and shader validation); acceptance is pending. - Added XADD and CMPXCHG for 8- to 64-bit register and memory destinations, and the LOCK prefix on their memory forms (#198). LOCK anywhere else, CMPXCHG8B and CMPXCHG16B stay rejected. Both engines run the new forms on the shared semantics, one instruction at a time, so a locked instruction is indivisible today and LOCK changes no result; `docs/cpu/instruction-registry.md` states the ordering, alignment, compare-failure and fault rules a guest scheduler must preserve. A failed compare still writes the destination, so it faults on memory that cannot be written. Nothing is lowered to ARM64 atomic instructions, and no multi-thread behaviour is established. Fourteen SDM-derived cases already in `cpu_known_answers.rs` moved from refused to verified, with 62 LLVM-assembled fixtures and five new tests in `x86_atomic.rs`; not compared with x86 hardware and awaiting independent review. diff --git a/docs/shaders/instruction-coverage.md b/docs/shaders/instruction-coverage.md index f59d8b8..9d15055 100644 --- a/docs/shaders/instruction-coverage.md +++ b/docs/shaders/instruction-coverage.md @@ -155,10 +155,10 @@ The wider LLVM operand matrix exercises decoding only. ABI means application bin | `v_add_nc_u32_e32` | VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = S0 + S1, no carry | `4A160F06` | yes | yes | three-way passed | per-thread typed integer template over the lane's own VGPRs; partial EXEC as a lane merge | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `v_sub_nc_u32_e32` | VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = S0 - S1, no carry | `4C181308` | yes | yes | three-way passed | per-thread typed integer template over the lane's own VGPRs; partial EXEC as a lane merge | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `v_subrev_nc_u32_e32` | VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = S1 - S0, no carry | `4E1A170A` | yes | yes | three-way passed | per-thread typed integer template over the lane's own VGPRs; partial EXEC as a lane merge | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | -| `v_cndmask_b32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; select S1 when the VCC_LO lane bit is set, otherwise S0 | `020402C1` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | acceptance pending | -| `v_add_co_ci_u32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; unsigned addition with carry input and output | `50040481` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | acceptance pending | -| `v_sub_co_ci_u32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; unsigned S0 minus S1 with borrow input and output | `52060480` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | acceptance pending | -| `v_subrev_co_ci_u32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; unsigned S1 minus S0 with borrow input and output | `540606C2` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | acceptance pending | +| `v_cndmask_b32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; select S1 when the VCC_LO lane bit is set, otherwise S0 | `020402C1` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_add_co_ci_u32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; unsigned addition with carry input and output | `50040481` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_sub_co_ci_u32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; unsigned S0 minus S1 with borrow input and output | `52060480` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_subrev_co_ci_u32_e32` | VOP2, Wave32; VCC_LO lane input; general SRC0, VGPR VSRC1 and VDST; unsigned S1 minus S0 with borrow input and output | `540606C2` | yes | yes | three-way passed | per-thread integer expression with EXEC masking | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | ## Automated three-way comparison diff --git a/docs/shaders/vector-vcc.md b/docs/shaders/vector-vcc.md index 1b9bd52..fc90319 100644 --- a/docs/shaders/vector-vcc.md +++ b/docs/shaders/vector-vcc.md @@ -38,5 +38,5 @@ are outside this subset. The Metal lowering reuses the compare mask's replay of the current wave's input lanes to form carry and borrow masks. The original `vector-vcc.s` fixture chains all four operations. LLVM checks encoding, and the guide-derived -oracle checks both CPU interpreters. Native Metal readback and independent -acceptance are pending. The expectations are derived from the public AMD specification (class B). +oracle checks both CPU interpreters. `vop2_vcc_matches_guide_on_native_metal` passes on a local +Apple M5 under API and shader validation; independent acceptance is pending. The expectations are derived from the public AMD specification (class B). diff --git a/docs/status.toml b/docs/status.toml index f3cf435..68ac57f 100644 --- a/docs/status.toml +++ b/docs/status.toml @@ -1749,7 +1749,7 @@ representation = "`020402C1`" lowering = "per-thread integer expression with EXEC masking" reference = "implemented" cpu = "local known-answer test passed" -gpu = "acceptance pending" +gpu = "local Apple M5 readback passed; acceptance pending" recognized = true decoded = true llvm = "three-way passed" @@ -1761,7 +1761,7 @@ representation = "`50040481`" lowering = "per-thread integer expression with EXEC masking" reference = "implemented" cpu = "local known-answer test passed" -gpu = "acceptance pending" +gpu = "local Apple M5 readback passed; acceptance pending" recognized = true decoded = true llvm = "three-way passed" @@ -1773,7 +1773,7 @@ representation = "`52060480`" lowering = "per-thread integer expression with EXEC masking" reference = "implemented" cpu = "local known-answer test passed" -gpu = "acceptance pending" +gpu = "local Apple M5 readback passed; acceptance pending" recognized = true decoded = true llvm = "three-way passed" @@ -1785,7 +1785,7 @@ representation = "`540606C2`" lowering = "per-thread integer expression with EXEC masking" reference = "implemented" cpu = "local known-answer test passed" -gpu = "acceptance pending" +gpu = "local Apple M5 readback passed; acceptance pending" recognized = true decoded = true llvm = "three-way passed"