tombox-xshader: decode the remaining SOP1 saveexec ops and translate s_andn1/s_andn2_wrexec #242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/242"
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?
Imported from omonkeyz/xbox-emulator. Originally posted by azerioxfr on 2026-11-23T07:01:07Z.
Library / area: tombox-xshader, SOP1 exec-mask ops (
rdna2/mnem.rs,hlsl.rssaveexec / wrexec)Exports changed (exports.txt rows): none
Source of the behaviour: opcodes from
tests/isa_table/gfx1013.txt(SOP1 0x2a, 0x2b, 0x39, 0x3a, 0x41..0x47). Semantics from the RDNA2 ISA.One topic, +74 / -3: 7 lines in
rdna2/mnem.rs, 19 inhlsl.rs, the rest tests.What was missing
tests/isa_table.rslists these eleven under "sop1: gfx1013 opcodes not named by the decoder".The change
s_nor_saveexec_b64,s_xnor_saveexec_b64,s_nand/nor/xnor/andn1/orn1_saveexec_b32s_andn1_wrexec_b32/b64(EXEC = ~S0 & EXEC),s_andn2_wrexec_b32/b64(EXEC = S0 & ~EXEC)Tests
--release, DXC 1.9.2609)scalar_saveexec_lane_model(7 new names added)scalar_wrexec_lane_model--test isa_table/--test opcodesThe wrexec helper saves EXEC and SCC before restoring EXEC, so a lane disabled by a zero EXEC cannot hide a result, and it starts from the opposite SCC so a missing SCC write is caught.
isa_sweeplists the new ops in its skip list (wave-level EXEC/SCC, covered by the exec tests). Onx86_64-pc-windows-gnuthat binary also reports floating-point FMA / f64 mismatches (v_fma_f32,v_floor_f64, ...), the GNUfmafissue (#126). They are unrelated to this change.cargo test -p tombox-xshader --test exec -- scalar_saveexec_lane_model scalar_wrexec_lane_modelpassesmissingwith a noteImported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-23T14:08:01Z.
Applied locally on main with your authorship kept (cherry-picked,
0447a97); 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.Imported from omonkeyz/xbox-emulator. Originally posted by kiwe147 on 2026-11-23T19:15:05Z.
Tested head
c01af90404, applied withgit apply(whitespace ignored, the line endings of my checkout differ) onmainf89e410, together with #244, #248 (one tree; the PRs touch different files). It applied without conflicts and built.Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.
tombox-xshaderlib +opcodes,synthetic,mesh,linkage,mixed_table,ps_linkage,centroid,gcn_dims,amp,xshader_cli,isa_sweepexecsuite on WARPTOMBOX_EXEC_HW=1(RTX 3080)No new failure against
mainf89e410in any of these. This is one combined tree, not a run of this PR alone.AI-assisted: yes (Claude Code)
Imported from omonkeyz/xbox-emulator. Originally posted by SchmashinPrunes on 2026-11-24T14:34:36Z.
Review: APPROVED
I checked this on RDNA2 silicon: a gfx1036 iGPU (Ryzen 5 9600X), ROCm/HIP 5.7.1, raw wave32 kernels, so RDNA2, not gfx1013. Each kernel ran twice with identical results, and I compared against the semantics this PR implements (my own port; I didn't run the PR's code).
and,or,xor,andn2,orn2,nand,nor,xnor,andn1andorn1, each as_b32and_b64. That covers D (the old EXEC), the new EXEC and SCC.s_andn1_wrexec_b32/_b64ands_andn2_wrexec_b32/_b64match too: EXEC = ~S0 & EXEC and S0 & ~EXEC, D = the new EXEC, SCC = (EXEC != 0)._b64forms in wave32 I also set EXEC_HI to random values. The hardware applies the op to all 64 bits. With EXEC_HI = 0, as the lowering assumes, D_hi is 0, as written here.(Measured with an AI assistant, Claude.)
Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-25T13:07:49Z.
Applied on main in
0447a97(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed