mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 15:08:38 +00:00
18 lines
2.0 KiB
JSON
18 lines
2.0 KiB
JSON
{
|
|
"piece": "SDWA",
|
|
"status": "gpu_verified",
|
|
"rank": 129,
|
|
"sentences": [
|
|
"`_sdwa` forms: each source is narrowed to `src0_sel`/`src1_sel` (BYTE_n/WORD_n, zero-extended, or sign-extended under `sext()`) **before** neg/abs and the op.",
|
|
"A VGPR result goes to `dst_sel`, with `dst_unused` setting the other bits: PAD = 0, SEXT = sign copies above the field, PRESERVE = old bits kept.",
|
|
"A byte or word destination with PRESERVE reads its incoming VGPR on first use.",
|
|
"The synthetic `sdwa_bary_input.asm` checks this with two raw fragment weights, following the [LLVM SDWA destination rules](https://llvm.org/docs/AMDGPUModifierSyntax.html#dst-unused).",
|
|
"VOPC has no `dst_sel`, and GFX10 `v_cmpx` has no written destination.",
|
|
"**Until 2026-11-20 the selects were silently ignored.** That affected 3,826 of the 13,926 translated shaders: they passed `spirv-val` but computed wrong values.",
|
|
"GPU-checked with `runtime/test/shaders/ps_sdwa.asm` and `ps_ops.asm` (also `v_pk_fma_f16`, `v_min3_u32`, `v_max3_i32`, `v_bfe_i32`): byte/word source selects, `sext()`, `UNUSED_PRESERVE` into WORD_1 and `UNUSED_SEXT` at BYTE_2 all match on every pixel.",
|
|
"**Measured natively on RDNA2** (gfx1036 iGPU, `tools/hw_oracle`, the game's MODE): all 172 distinct SDWA forms of the 26,503 listings (79,307 instructions: opcode, operand kinds, sels, `sext`, neg/abs, `dst_unused`, omod), 12 operand words per source, 21,204 cases. 18,885 give the translator's word.",
|
|
"The rest are: a 16-bit result with `dst_sel:DWORD`, where the hardware zeroes the high half and the translator keeps it (1,888, #2187); a NaN result, where the hardware keeps the input's sign and payload (826 counting those also in the first group, as in the f16 transcendentals row); `div:2` on -0, which gives +0 (1, as in the output-modifier rows); and 160 cases whose translation is undefined in SPIR-V (`FClamp`/`FDiv`/`Sqrt` on NaN, zero or negative operands).",
|
|
"`tests/semantic/test_alu_sdwa_hw.py` replays 624 of the matching words, up to four per form."
|
|
]
|
|
}
|