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

Closed
opened 2026-11-21 17:27:04 +00:00 by SchmashinPrunes · 1 comment
SchmashinPrunes commented 2026-11-21 17:27:04 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by SchmashinPrunes on 2026-11-21T17:27:04Z.


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.

<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:6532089621 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/issues/17). Originally posted by [SchmashinPrunes](https://github.com/SchmashinPrunes) on 2026-11-21T17:27:04Z. --- 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 commented 2026-11-21 18:58:25 +00:00 (Migrated from github.com)
Author

Imported from omonkeyz/xbox-emulator. Originally posted by SchmashinPrunes on 2026-11-21T18:58:25Z.


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).

<!-- greyfinch-sync:omonkeyz/xbox-emulator:comment:7067659024 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/issues/17#issuecomment-7067659024). Originally posted by [SchmashinPrunes](https://github.com/SchmashinPrunes) on 2026-11-21T18:58:25Z. --- 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).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
omonkeyz/xbox-emulator#17
No description provided.