mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 00:10:43 +00:00
isa, decoder, shader: move the SOPP control forms into the semantic registry (#215)
The six supported gfx1030 SOPP compute control forms are now described in crates/isa/semantics/rdna2/sopp.toml, and the decoder and shader dispatch from the registry. A sweep over all 128 SOPP opcodes, 13 SIMM16 values and two stream positions (3,328 records) is identical before and after. Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
This commit is contained in:
1 parent
fb0544652b
commit
131c8669cf
13 files changed
+730
-133
No files matched your search
@@ -14,12 +14,12 @@ The wider LLVM operand matrix exercises decoding only. ABI means application bin
|
||||
| Form | Operands | Size or word | Recognized | Decoded | LLVM | Lowering | Reference | CPU | GPU |
|
||||
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||
| `buffer_load_dword` | MUBUF, VGPR data/index, four normal SGPRs, `idxen`, zero offsets and remaining flags | 8 B | yes | yes | three-way passed | MSL load | implemented | fixture verified | fixture verified |
|
||||
| `s_waitcnt vmcnt(0)` | SOPP, exact immediate `0x3f70`; other counters disabled by their maximum values | 4 B | yes | yes | three-way passed | verified load wait | implemented | fixture verified | fixture verified |
|
||||
| `s_waitcnt vmcnt(0)` | SOPP, exact immediate `0x3f70`; other counters disabled by their maximum values (semantic registry) | 4 B | yes | yes | three-way passed | verified load wait | implemented | fixture verified | fixture verified |
|
||||
| `v_mov_b32_e32` | VOP1, VGPR destination, VGPR, normal SGPR (wave-uniform, known during translation), vcc_lo (known or a compare mask) or inline integer or literal source, plus the inline bit pattern for +1.0f | 4 or 8 B | yes | yes | three-way passed | constant or register value | implemented | fixture verified | fixture verified |
|
||||
| `v_add_nc_u32_e64` | VOP3, VGPR destination and two VGPR inputs, modifier fields clear, third source field encoded as inline zero | 8 B | yes | yes | three-way passed | MSL unsigned add | implemented | fixture verified | fixture verified |
|
||||
| `buffer_store_dword` | MUBUF, VGPR data/index, four normal SGPRs, `idxen`, zero offsets and remaining flags | 8 B | yes | yes | three-way passed | MSL store | implemented | fixture verified | fixture verified |
|
||||
| `s_waitcnt_vscnt null, 0` | SOPK, exact null source and zero immediate | 4 B | yes | yes | three-way passed | verified store wait | implemented | fixture verified | fixture verified |
|
||||
| `s_endpgm` | SOPP, zero immediate | 4 B | yes | yes | three-way passed | verified termination | implemented | fixture verified | fixture verified |
|
||||
| `s_endpgm` | SOPP, zero immediate (semantic registry) | 4 B | yes | yes | three-way passed | verified termination | implemented | fixture verified | fixture verified |
|
||||
| `s_mov_b32` | Normal SGPR or EXEC/VCC half destination and normal SGPR, inline integer or literal source | `BE880387` | yes | yes | three-way passed | resolved scalar state | implemented | fixture verified | fixture verified |
|
||||
| `s_not_b32` | SOP1, normal SGPR destination; normal SGPR, inline integer or literal source; D = ~S0; SCC = D != 0 | `BE890708` | yes | yes | three-way passed | resolved scalar state and SCC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `s_brev_b32` | SOP1, normal SGPR destination; normal SGPR, inline integer or literal source; D = S0 bit-reversed; SCC unchanged | `BE8A0B08` | yes | yes | three-way passed | resolved scalar state and SCC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
@@ -109,8 +109,8 @@ The wider LLVM operand matrix exercises decoding only. ABI means application bin
|
||||
| `v_cmp_t_i32_e32` | VOPC, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0 (signed); VGPR VSRC1; VCC_LO[n] = EXEC_LO[n] & true, fully written | `7D0E0501` | yes | yes | three-way passed | per-thread Wave32 mask over the dispatch's own 32 lanes, reading no operand bits; runtime s_cbranch_vccz as a join select | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `v_cmp_f_u32_e32` | VOPC, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0 (unsigned); VGPR VSRC1; VCC_LO[n] = EXEC_LO[n] & false, fully written | `7D800501` | yes | yes | three-way passed | per-thread Wave32 mask over the dispatch's own 32 lanes, reading no operand bits; runtime s_cbranch_vccz as a join select | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `v_cmp_t_u32_e32` | VOPC, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0 (unsigned); VGPR VSRC1; VCC_LO[n] = EXEC_LO[n] & true, fully written | `7D8E0501` | yes | yes | three-way passed | per-thread Wave32 mask over the dispatch's own 32 lanes, reading no operand bits; runtime s_cbranch_vccz as a join select | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `s_cbranch_scc0` | Nonnegative signed dword displacement | `BF840002` | yes | yes | three-way passed | resolved conditional branch | implemented | fixture verified | fixture verified |
|
||||
| `s_branch` | Nonnegative signed dword displacement | `BF820001` | yes | yes | three-way passed | resolved branch | implemented | fixture verified | fixture verified |
|
||||
| `s_cbranch_scc0` | Nonnegative signed dword displacement (semantic registry) | `BF840002` | yes | yes | three-way passed | resolved conditional branch | implemented | fixture verified | fixture verified |
|
||||
| `s_branch` | Nonnegative signed dword displacement (semantic registry) | `BF820001` | yes | yes | three-way passed | resolved branch | implemented | fixture verified | fixture verified |
|
||||
| `v_and_b32_e32` | Two VGPR sources and one VGPR destination | `36020702` | yes | yes | three-way passed | MSL bitwise AND | implemented | fixture verified | fixture verified |
|
||||
| `v_xor_b32_e32` | Two VGPR sources and one VGPR destination | `3A020702` | yes | yes | three-way passed | MSL bitwise XOR | implemented | fixture verified | fixture verified |
|
||||
| `v_add_f32_e32` | Two VGPR sources and one VGPR destination | `06020702` | yes | yes | three-way passed | MSL FP32 add | implemented | fixture verified | fixture verified |
|
||||
@@ -119,8 +119,8 @@ The wider LLVM operand matrix exercises decoding only. ABI means application bin
|
||||
| `v_lshlrev_b32_e32` | Two VGPR sources and one VGPR destination | `34020501` | yes | yes | three-way passed | MSL logical left shift with a five-bit count | implemented | fixture verified | fixture verified on Apple M5 |
|
||||
| `v_lshrrev_b32_e32` | Two VGPR sources and one VGPR destination | `2DFFFF01` | yes | yes | three-way passed | MSL logical right shift with a five-bit count | implemented | fixture verified | fixture verified on Apple M5 |
|
||||
| `v_ashrrev_i32_e32` | Two VGPR sources and one VGPR destination | `31FFFF01` | yes | yes | three-way passed | MSL signed right shift with a five-bit count | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `s_cbranch_execz` | Nonnegative signed dword displacement | `BF880001` | yes | yes | three-way passed | resolved Wave32 EXEC_LO zero check | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `s_cbranch_vccz` | Nonnegative signed dword displacement | `BF860001` | yes | yes | three-way passed | resolved Wave32 VCC_LO zero check, or a wave-uniform join select after a vector compare | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `s_cbranch_execz` | Nonnegative signed dword displacement (semantic registry) | `BF880001` | yes | yes | three-way passed | resolved Wave32 EXEC_LO zero check | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `s_cbranch_vccz` | Nonnegative signed dword displacement (semantic registry) | `BF860001` | yes | yes | three-way passed | resolved Wave32 VCC_LO zero check, or a wave-uniform join select after a vector compare | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending |
|
||||
| `v_mul_i32_i24_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 = low 32 bits of sext(S0[23:0]) * sext(S1[23:0]) | `120402C3` | 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_mul_hi_i32_i24_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 = bits 63:32 of sext(S0[23:0]) * sext(S1[23:0]) | `14060208` | 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_mul_u32_u24_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 = low 32 bits of S0[23:0] * S1[23:0] | `160802FF 00123456` | 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 |
|
||||
|
||||
@@ -28,7 +28,7 @@ acceptance remain outside the verified count. All results concern synthetic fixt
|
||||
| SOP2 | 51 | 33 | 33 | 33 | 33 | 33 | 0 | 0 | 12 |
|
||||
| SOPC | 18 | 12 | 12 | 12 | 12 | 12 | 1 | 1 | 7 |
|
||||
| SOPK | 27 | 17 | 16 | 17 | 17 | 17 | 1 | 1 | 5 |
|
||||
| SOPP | 36 | 6 | 0 | 6 | 6 | 6 | 4 | 4 | 0 |
|
||||
| SOPP | 36 | 6 | 6 | 6 | 6 | 6 | 4 | 4 | 0 |
|
||||
| VINTRP | 3 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 |
|
||||
| VOP1 | 81 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 |
|
||||
| VOP2 | 47 | 20 | 18 | 20 | 20 | 20 | 7 | 7 | 11 |
|
||||
@@ -36,7 +36,7 @@ acceptance remain outside the verified count. All results concern synthetic fixt
|
||||
| VOP3P | 29 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||
| VOP3SDST | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||
| VOPC | 190 | 16 | 16 | 16 | 16 | 16 | 0 | 0 | 7 |
|
||||
| **Total** | 1465 | 120 | 108 | 124 | 120 | 120 | 18 | 18 | 65 |
|
||||
| **Total** | 1465 | 120 | 114 | 124 | 120 | 120 | 18 | 18 | 65 |
|
||||
|
||||
## Unsupported operand variants
|
||||
|
||||
@@ -50,6 +50,9 @@ The table counts distinct variant names per family across registry operand rules
|
||||
| SOPC | `sopc_scalar` | `src_exec`, `src_float_inline`, `src_m0`, `src_special`, `src_ttmp`, `src_vcc`, `two_literals` |
|
||||
| SOPK | `sopk_compare` | `dst_exec`, `dst_m0`, `dst_null`, `dst_ttmp`, `dst_vcc` |
|
||||
| SOPK | `sopk_sgpr` | `dst_exec`, `dst_m0`, `dst_null`, `dst_ttmp`, `dst_vcc` |
|
||||
| SOPP | `sopp_branch` | None listed |
|
||||
| SOPP | `sopp_end` | None listed |
|
||||
| SOPP | `sopp_wait` | None listed |
|
||||
| VOP2 | `vop2_vgpr` | `src_exec`, `src_float_inline`, `src_m0`, `src_null`, `src_special`, `src_ttmp`, `src_vcc_hi` |
|
||||
| VOP2 | `vop2_vgpr2` | `src_exec`, `src_float_inline`, `src_inline`, `src_literal`, `src_m0`, `src_null`, `src_sgpr`, `src_special`, `src_ttmp`, `src_vcc` |
|
||||
| VOP3 | `vop3_vgpr2` | `modifiers`, `src2`, `src_exec`, `src_float_inline`, `src_inline`, `src_literal`, `src_m0`, `src_null`, `src_sgpr`, `src_special`, `src_ttmp`, `src_vcc` |
|
||||
|
||||
@@ -210,6 +210,17 @@ The XML must give SIMM16 as 16-bit `FMT_NUM_I16` (`FMT_NUM_U16` for `unsigned`).
|
||||
The word never takes a literal dword. The details are in
|
||||
[scalar-immediate.md](scalar-immediate.md).
|
||||
|
||||
The SOPP control rules (AMD RDNA 2 ISA guide §§12.5 and 13.1.5) generate
|
||||
`SoppControlOp` for the existing Wave32 compute subset. `sopp_end` accepts
|
||||
`s_endpgm` with zero in SIMM16. `sopp_wait` accepts only `s_waitcnt vmcnt(0)`
|
||||
(`0x3f70`), completing a pending vector load. `sopp_branch` accepts
|
||||
`s_branch`, `s_cbranch_scc0`, `s_cbranch_vccz` and `s_cbranch_execz` with a
|
||||
nonnegative signed SIMM16 displacement in dwords from the next instruction.
|
||||
The decoder and compiler require a valid target boundary. The conditional
|
||||
branches read SCC, VCC_LO or EXEC_LO without writing those registers.
|
||||
Other SOPP forms, including `s_nop`, the nonzero branches, `s_sendmsg`,
|
||||
`s_trap`, `s_sethalt` and `s_setprio`, remain unsupported.
|
||||
|
||||
Behaviour is chosen only from these declared fields, never from the mnemonic.
|
||||
|
||||
## What the validator checks
|
||||
|
||||
+6
-6
@@ -53,7 +53,7 @@ llvm = "three-way passed"
|
||||
|
||||
[[instruction]]
|
||||
form = "s_waitcnt vmcnt(0)"
|
||||
encoding = "SOPP, exact immediate `0x3f70`; other counters disabled by their maximum values"
|
||||
encoding = "SOPP, exact immediate `0x3f70`; other counters disabled by their maximum values (semantic registry)"
|
||||
representation = "4 B"
|
||||
lowering = "verified load wait"
|
||||
reference = "implemented"
|
||||
@@ -113,7 +113,7 @@ llvm = "three-way passed"
|
||||
|
||||
[[instruction]]
|
||||
form = "s_endpgm"
|
||||
encoding = "SOPP, zero immediate"
|
||||
encoding = "SOPP, zero immediate (semantic registry)"
|
||||
representation = "4 B"
|
||||
lowering = "verified termination"
|
||||
reference = "implemented"
|
||||
@@ -1192,7 +1192,7 @@ llvm = "three-way passed"
|
||||
|
||||
[[instruction]]
|
||||
form = "s_cbranch_scc0"
|
||||
encoding = "Nonnegative signed dword displacement"
|
||||
encoding = "Nonnegative signed dword displacement (semantic registry)"
|
||||
representation = "`BF840002`"
|
||||
lowering = "resolved conditional branch"
|
||||
reference = "implemented"
|
||||
@@ -1204,7 +1204,7 @@ llvm = "three-way passed"
|
||||
|
||||
[[instruction]]
|
||||
form = "s_branch"
|
||||
encoding = "Nonnegative signed dword displacement"
|
||||
encoding = "Nonnegative signed dword displacement (semantic registry)"
|
||||
representation = "`BF820001`"
|
||||
lowering = "resolved branch"
|
||||
reference = "implemented"
|
||||
@@ -1312,7 +1312,7 @@ llvm = "three-way passed"
|
||||
|
||||
[[instruction]]
|
||||
form = "s_cbranch_execz"
|
||||
encoding = "Nonnegative signed dword displacement"
|
||||
encoding = "Nonnegative signed dword displacement (semantic registry)"
|
||||
representation = "`BF880001`"
|
||||
lowering = "resolved Wave32 EXEC_LO zero check"
|
||||
reference = "implemented"
|
||||
@@ -1324,7 +1324,7 @@ llvm = "three-way passed"
|
||||
|
||||
[[instruction]]
|
||||
form = "s_cbranch_vccz"
|
||||
encoding = "Nonnegative signed dword displacement"
|
||||
encoding = "Nonnegative signed dword displacement (semantic registry)"
|
||||
representation = "`BF860001`"
|
||||
lowering = "resolved Wave32 VCC_LO zero check, or a wave-uniform join select after a vector compare"
|
||||
reference = "implemented"
|
||||
|
||||
Reference in new issue
Block a user