xshader: decode seven missing scalar SAVEEXEC variants #317
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!317
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/317/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?
@bambermf on GitHub · 2026-11-23 18:08 UTC · original
bambermf:port/shader-scalar-bits→main· +31 −17 · 3 files · 2 commits · closed without mergingLibrary / area — tombox-xshader scalar SOP1 decoding. No DLL exports changed.
Source of the behaviour — the checked-in gfx1013 ISA table and the existing SAVEEXEC lane-model lowering.
What was wrong
The decoder omitted SOP1 0x2a–0x2b and 0x41–0x45, so their instructions could never reach the existing HLSL for saving EXEC and updating EXEC and SCC.
Change
Decode 64-bit NOR and XNOR and 32-bit NAND, NOR, XNOR, ANDN1 and ORN1. Extend the existing executable lane-model test and list these mnemonics alongside the other SAVEEXEC variants in the ISA sweep.
Measurements and tests
On
f89e410these seven encodings have no mnemonic. On this branch the release scalar_saveexec_lane_model test verified 18 mnemonics across 144 cases with immediate inputs and the same 144 with runtime inputs, covering both initial EXEC states. Zero failures. The test checks the saved mask, resulting EXEC and SCC, including the upper destination word for wide forms. The PR gate passed. The execution results cover the emulator lane model.@omonkeyz on GitHub · 2026-11-25 13:51 UTC · original
Thanks. Main already decodes these SAVEEXEC variants and tests them in scalar_saveexec_lane_model. If you want the exec0 = 0 case covered, a small follow-up extending saveexec() in tests/exec.rs would be welcome.
@SchmashinPrunes on GitHub · 2026-11-24 14:34 UTC · original · approved these changes
Scope: semantics only, not a merge recommendation. #242, which omonkeyz has already applied locally (
0447a97), names the same seven opcodes. This PR would duplicate them and would likely conflict once that release is pushed. The only extra here is the EXEC = 0 variant insaveexec(), which could go on top of #242 if it's wanted. GitHub doesn't let a reviewer without write access withdraw an approval, so please read this one as a comment.The original check follows.
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).
The seven ops added here match the hardware on 4,096 random EXEC / S0 pairs each: D = the old EXEC, EXEC = op(S0, EXEC), SCC = (EXEC != 0). The ops are
s_nor_saveexec_b64,s_xnor_saveexec_b64,s_nand_saveexec_b32,s_nor_saveexec_b32,s_xnor_saveexec_b32,s_andn1_saveexec_b32ands_orn1_saveexec_b32. The other 13 saveexec forms in your table match as well.This overlaps with #242, which names the same opcodes.
(Measured with an AI assistant, Claude.)
Pull request closed