Files
betterxen/docs/status.toml
T
elforeign 994efd38f9 shader: decode and execute SOP2 scalar add, subtract and bitwise forms
Adds s_add_u32, s_sub_u32, s_addc_u32, s_subb_u32, s_and_b32, s_or_b32
and s_xor_b32 across the chain: generated opcodes from the pinned AMD
XML, a typed ScalarAlu instruction, decoding, the reference interpreter,
the independent semantic-review interpreter and the translator, which
resolves scalar state and SCC as it already does for s_mov/s_cmp.
v_mov_b32_e32 may now read a normal SGPR, so results reach vector code
as constants.

SCC: the XML states carry-out for additions, carry-in for ADDC/SUBB and
nonzero results for bitwise forms. For subtraction it says carry-out
without fixing the polarity; LLVM's lowering of usubo and of 64-bit
subtraction to s_sub_u32/s_subb_u32 requires SCC to be the borrow.
s_add_i32/s_sub_i32 stay unsupported: no pinned source settles whether
their SCC is the carry or signed overflow.

Verified with an original LLVM-assembled fixture and 1,400 boundary
programs (every form, 10x10 operands, SCC clear and set) against exact
integer definitions; translator, reference (exact integers) and
independent interpreter (bit-serial ripple adder) all agree, and all
1,401 programs match on native Metal with validation. LLVM agrees on
every encoding. Breaking any one implementation fails the tests.

Fixes #185
Independent review fixes: both interpreters now require a known SGPR
for v_mov_b32 from an SGPR even in an inactive lane, as translation
does; alias, literal and inline cases also assert the translated result
and run on Metal; rejections are pinned to the SOP2 word's offset; GPU
status is recorded as local evidence with acceptance pending.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 01:38:54 -06:00

383 lines
11 KiB
TOML

schema_version = 1
phase = 1
release_ready = false
[[feature]]
id = "native-compute"
implementation = "implemented"
correctness = "initial-native-suite-passed"
hardware_verification = "verified"
hardware_target = "Apple M5"
claims = ["CLAIM-METAL-M5-NATIVE-SUITE"]
architecture = "arm64 macOS"
semantics = "Native Metal work submissions with bounded resources"
metal_mapping = "Native compute kernels and an original offscreen render test"
limitations = "Trusted MSL with bounded word buffers and an original native offscreen rendering test on Apple M5."
test = "scripts/test-gpu.sh"
[[feature]]
id = "synthetic-gfx1030"
implementation = "three-fixture-demo-implemented"
correctness = "three-way-output-passed"
hardware_verification = "verified"
hardware_target = "Apple M5"
claims = ["CLAIM-METAL-M5-RDNA-DEMO", "CLAIM-RDNA2-ADD-NO-CARRY", "CLAIM-RDNA2-SOPP-BRANCH-DISPLACEMENT"]
architecture = "gfx1030 Wave32"
semantics = "Original gfx1030 compute code under the synthetic fixture ABI"
metal_mapping = "One lane-indexed MSL compute invocation per word"
limitations = "Synthetic memory contract, statically resolved forward control flow, exact positive normal FP32 only."
test = "scripts/demo.sh"
[[feature]]
id = "xbox-execution"
implementation = "unsupported"
correctness = "untested"
hardware_verification = "unverified"
claims = ["CLAIM-XBOX-ISA-ABI"]
architecture = "Xbox Series X|S"
semantics = "Console-specific GPU and guest execution contracts remain unknown"
metal_mapping = "Unresolved"
limitations = "Game execution, proprietary guest containers and full guest execution-mask divergence are unsupported. The console launch ABI is unknown."
[[instruction]]
form = "buffer_load_dword"
encoding = "MUBUF, VGPR data/index, four normal SGPRs, `idxen`, zero offsets and remaining flags"
representation = "8 B"
lowering = "MSL load"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_waitcnt vmcnt(0)"
encoding = "SOPP, exact immediate `0x3f70`; other counters disabled by their maximum values"
representation = "4 B"
lowering = "verified load wait"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_mov_b32_e32"
encoding = "VOP1, VGPR destination, VGPR, normal SGPR (wave-uniform, known during translation) or inline integer or literal source, plus the inline bit pattern for +1.0f"
representation = "4 or 8 B"
lowering = "constant or register value"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_add_nc_u32_e64"
encoding = "VOP3, VGPR destination and two VGPR inputs, modifier fields clear, third source field encoded as inline zero"
representation = "8 B"
lowering = "MSL unsigned add"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "buffer_store_dword"
encoding = "MUBUF, VGPR data/index, four normal SGPRs, `idxen`, zero offsets and remaining flags"
representation = "8 B"
lowering = "MSL store"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_waitcnt_vscnt null, 0"
encoding = "SOPK, exact null source and zero immediate"
representation = "4 B"
lowering = "verified store wait"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_endpgm"
encoding = "SOPP, zero immediate"
representation = "4 B"
lowering = "verified termination"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_mov_b32"
encoding = "Normal SGPR or EXEC/VCC half destination and normal SGPR, inline integer or literal source"
representation = "`BE880387`"
lowering = "resolved scalar state"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_cmp_eq_u32"
encoding = "Normal SGPR or integer operands, with at most one source selecting a literal"
representation = "`BF068708`"
lowering = "resolved SCC"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_add_u32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; SCC = carry-out"
representation = "`80088308`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_sub_u32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; SCC = borrow"
representation = "`808A8180`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_addc_u32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; adds SCC; SCC = carry-out"
representation = "`820980FF 7FFFFFFF`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_subb_u32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; subtracts SCC; SCC = borrow"
representation = "`828B0809`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_and_b32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; SCC = result != 0"
representation = "`870D090C`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_or_b32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; SCC = result != 0"
representation = "`880ED00D`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_xor_b32"
encoding = "SOP2, normal SGPR destination; normal SGPR, inline integer or literal sources with at most one literal; SCC = result != 0"
representation = "`890C0A0B`"
lowering = "resolved scalar state and SCC"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_cbranch_scc0"
encoding = "Nonnegative signed dword displacement"
representation = "`BF840002`"
lowering = "resolved conditional branch"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_branch"
encoding = "Nonnegative signed dword displacement"
representation = "`BF820001`"
lowering = "resolved branch"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_and_b32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`36020702`"
lowering = "MSL bitwise AND"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_xor_b32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`3A020702`"
lowering = "MSL bitwise XOR"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_add_f32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`06020702`"
lowering = "MSL FP32 add"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_mul_f32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`10020702`"
lowering = "MSL FP32 multiply"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_or_b32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`3803FF01`"
lowering = "MSL bitwise OR"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified on Apple M5"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_lshlrev_b32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`34020501`"
lowering = "MSL logical left shift with a five-bit count"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified on Apple M5"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_lshrrev_b32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`2DFFFF01`"
lowering = "MSL logical right shift with a five-bit count"
reference = "implemented"
cpu = "fixture verified"
gpu = "fixture verified on Apple M5"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "v_ashrrev_i32_e32"
encoding = "Two VGPR sources and one VGPR destination"
representation = "`31FFFF01`"
lowering = "MSL signed right shift with a five-bit count"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_cbranch_execz"
encoding = "Nonnegative signed dword displacement"
representation = "`BF880001`"
lowering = "resolved Wave32 EXEC_LO zero check"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[[instruction]]
form = "s_cbranch_vccz"
encoding = "Nonnegative signed dword displacement"
representation = "`BF860001`"
lowering = "resolved Wave32 VCC_LO zero check"
reference = "implemented"
cpu = "local known-answer test passed"
gpu = "local Apple M5 readback passed; acceptance pending"
recognized = true
decoded = true
llvm = "three-way passed"
[guest_milestones]
X1 = "accepted"
X2 = "accepted"
X3 = "accepted"
X4 = "accepted"