tombox-xshader: LDS atomics + MTBUF d16 (claiming) #17

Closed
opened 2026-11-26 06:07:20 +00:00 by github-bot · 1 comment
Owner

@⁠SchmashinPrunes on GitHub · 2026-11-21 17:27 UTC · original

Claiming two groups of unverified RDNA2 instructions in tombox-xshader so work isn't duplicated:

1. LDS atomics (DS). The LDS path in src/hlsl.rs translates add / min_u32 / max_u32 / and / or / xor; the GDS path covers more. Adding LDS translation plus exec tests for:
ds_sub_u32, ds_rsub_u32, ds_inc_u32, ds_dec_u32, ds_min_i32, ds_max_i32, ds_cmpst_b32, and their _rtn forms plus ds_wrxchg_rtn_b32.
(ds_inc/ds_dec wrap against data, so they need a compare-exchange loop; ds_cmpst takes DATA as the compare value and DATA2 as the new value.)

2. MTBUF d16. tbuffer_load_format_d16_{x,xy,xyz,xyzw} and tbuffer_store_format_d16_{x,xy,xyz,xyzw}, which are in the decoder but not translated.

Source: the public AMD RDNA2 ISA reference only. Tests will follow the existing tests/exec_mem pattern (WARP, known inputs, compared against the ISA model). Not touching the VOPC (#15), FLAT, GWS, ds_append/ds_consume/ds_ordered_count or s_sendmsghalt rows.

**@⁠SchmashinPrunes** on GitHub · 2026-11-21 17:27 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/17) Claiming two groups of unverified RDNA2 instructions in `tombox-xshader` so work isn't duplicated: **1. LDS atomics (DS).** The LDS path in `src/hlsl.rs` translates add / min_u32 / max_u32 / and / or / xor; the GDS path covers more. Adding LDS translation plus exec tests for: `ds_sub_u32`, `ds_rsub_u32`, `ds_inc_u32`, `ds_dec_u32`, `ds_min_i32`, `ds_max_i32`, `ds_cmpst_b32`, and their `_rtn` forms plus `ds_wrxchg_rtn_b32`. (`ds_inc`/`ds_dec` wrap against data, so they need a compare-exchange loop; `ds_cmpst` takes DATA as the compare value and DATA2 as the new value.) **2. MTBUF d16.** `tbuffer_load_format_d16_{x,xy,xyz,xyzw}` and `tbuffer_store_format_d16_{x,xy,xyz,xyzw}`, which are in the decoder but not translated. Source: the public AMD RDNA2 ISA reference only. Tests will follow the existing `tests/exec_mem` pattern (WARP, known inputs, compared against the ISA model). Not touching the VOPC (#15), FLAT, GWS, `ds_append`/`ds_consume`/`ds_ordered_count` or `s_sendmsghalt` rows.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:07:21 +00:00
Author
Owner

@⁠SchmashinPrunes on GitHub · 2026-11-21 18:58 UTC · original

Both halves of this claim are up: LDS atomics in #23, MTBUF d16 in #41 (semantics measured on RDNA2 hardware, see tools/rdna2-hwprobe there).

**@⁠SchmashinPrunes** on GitHub · 2026-11-21 18:58 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/17#issuecomment-7067659024) Both halves of this claim are up: LDS atomics in #23, MTBUF d16 in #41 (semantics measured on RDNA2 hardware, see `tools/rdna2-hwprobe` there).
This discussion has been locked. Commenting is limited to contributors.
No description provided.