tombox-xshader: decode and lower the DS src2 read-modify-write ops #264
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!264
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/264/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@azerioxfr on GitHub · 2026-11-23 08:35 UTC · original
azerioxfr:xshader-ds-src2-ops→main· +103 −0 · 3 files · 1 commits · closed without mergingLibrary / area: tombox-xshader, compute LDS
*_src2_*ops (hlsl.rsnext to the other LDS read-modify-write ops)Exports changed (exports.txt rows): none
Source of the behaviour: opcodes from
tests/isa_table/gfx1013.txt(DS 0x80..0x8b, 0x8d). The address rule is from the AMD ISA description of the src2 ops:A = ADDR_BASE; B = A + 4 * (offset1[7] ? {A[31], A[31:17]} : {offset1[6], offset1[6:0], offset0}); MEM[A] = MEM[A] OP MEM[B].One topic, +103: 5 lines in
rdna2/mnem.rs, 57 inhlsl.rs, 41 lines of test.What was missing
tests/isa_table.rslists these 13 under "ds: gfx1013 opcodes not named by the decoder".The change
ds_add/min_u32/max_u32/and/or/xor/write_src2_*Interlocked{Add,Min,Max,And,Or,Xor,Exchange}ontb_lds[A]with the value read fromtb_lds[B]ds_sub/rsub/inc/dec_src2_u32,ds_min/max_src2_i32A is the base address without the offset, and B uses the sign-extended 15-bit field above. The src2 value is read once, before the atomic update of A.
Tests
New
exec_mem::ds::ds_lds_src2_compute: all 13 ops in both address forms (offset1[7] clear with offset0 0x40 and 0x7fc0, offset1[7] set with A[31:17] = 64 and 0x7fc0).--release, DXC 1.9.2609)ds_lds_src2_computeexec_mem::dstests (regression)ds_lds32,ds_lds_ext15,ds_lds_mskor_wrxchg24 mnemonics)--test isa_table/--test opcodesRun on
x86_64-pc-windows-gnu(no MSVC linker here). Integer only. The 64-bit and float src2 forms are left out.missingwith a note@omonkeyz on GitHub · 2026-11-23 14:08 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
6361ba0); the tombox-xshader suite passes in a sandbox (exec 155/155 on WARP). It ships in the next release; this PR will be closed when that is pushed. Thanks.@SchmashinPrunes on GitHub · 2026-11-24 13:20 UTC · original
A note in case someone plans a silicon check of this PR. The
ds_*_src2_*ops can't be verified on gfx103x (RDNA2.x) hardware.(Checked with an AI assistant, Claude.)
@omonkeyz on GitHub · 2026-11-25 13:08 UTC · original
Applied on main in
6361ba0(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed