tombox-xshader: decode the remaining SOP1 saveexec ops and translate s_andn1/s_andn2_wrexec #242
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!242
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/242/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 07:01 UTC · original
azerioxfr:xshader-sop1-saveexec-variants→main· +74 −3 · 5 files · 1 commits · closed without mergingLibrary / 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 note@omonkeyz on GitHub · 2026-11-23 14:08 UTC · original
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.@kiwe147 on GitHub · 2026-11-23 19:15 UTC · original
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)
@omonkeyz on GitHub · 2026-11-25 13:07 UTC · original
Applied on main in
0447a97(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.@SchmashinPrunes on GitHub · 2026-11-24 14:34 UTC · original · approved these changes
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.)
Pull request closed