shader: support the remaining wave32 SAVEEXEC variants #458

Open
github-bot wants to merge 1 commit from github-bot/gh-458 into main AGit
Owner

@⁠brandostrong on GitHub · 2026-09-02 21:49 UTC · original
brandostrong:fix/saveexec-b32 → main · +57 −7 · 6 files · 1 commits · open

Problem. Astro Bot executes s_orn2_saveexec_b32 vcc_lo, s32 (SOP1 0x40). Only the AND/OR wave32 SAVEEXEC forms were decoded, so the shader failed to translate and the emulator exited.

Change. Add OR/XOR/ANDN2/ORN2/NAND/NOR/XNOR/ORN1 _B32 (SOP1 0x3d–0x43, 0x45) through the existing S_SAVEEXEC helper, which gains a negate_result flag for the NAND/NOR/XNOR forms. Operand negation follows the RDNA2 SOP1 table (ORN2: S0 | ~EXEC, ANDN1: ~S0 & EXEC).

Effect. Astro Bot's wave32 shaders using these forms compile.

Verification. Suites pass.

References

  • AMD RDNA 2 Instruction Set Architecture Reference Guide, §15.3 "SOP1 Instructions": opcodes 0x3d–0x43 and 0x45 (S_*_SAVEEXEC_B32) and their operand negation.
**@⁠brandostrong** on GitHub · 2026-09-02 21:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/458) `brandostrong:fix/saveexec-b32` → `main` · +57 −7 · 6 files · 1 commits · open **Problem.** Astro Bot executes `s_orn2_saveexec_b32 vcc_lo, s32` (SOP1 0x40). Only the AND/OR wave32 SAVEEXEC forms were decoded, so the shader failed to translate and the emulator exited. **Change.** Add OR/XOR/ANDN2/ORN2/NAND/NOR/XNOR/ORN1 `_B32` (SOP1 0x3d–0x43, 0x45) through the existing `S_SAVEEXEC` helper, which gains a `negate_result` flag for the NAND/NOR/XNOR forms. Operand negation follows the RDNA2 SOP1 table (`ORN2`: `S0 | ~EXEC`, `ANDN1`: `~S0 & EXEC`). **Effect.** Astro Bot's wave32 shaders using these forms compile. **Verification.** Suites pass. **References** - AMD RDNA 2 Instruction Set Architecture Reference Guide, §15.3 "SOP1 Instructions": opcodes 0x3d–0x43 and 0x45 (`S_*_SAVEEXEC_B32`) and their operand negation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:21:56 +00:00
This pull request has changes conflicting with the target branch.
  • src/graphics/shader/recompiler/frontend/decode/ScalarAluOps.cpp
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.cpp
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h
  • src/graphics/shader/recompiler/frontend/translate/Control.cpp
  • src/graphics/shader/recompiler/frontend/translate/Scalar.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/458/head:github-bot/gh-458'
git switch 'github-bot/gh-458'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-458'
git switch 'github-bot/gh-458'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-458'
git switch 'github-bot/gh-458'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-458'
git switch 'main'
git merge --squash 'github-bot/gh-458'
git switch 'main'
git merge --ff-only 'github-bot/gh-458'
git switch 'main'
git merge 'github-bot/gh-458'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.