shader: support S_MUL_HI_I32 (SOP2 0x36) #576

Manually merged
github merged 1 commit from gh-pr/576/head into gh-pr/576/base 2026-11-26 09:26:06 +00:00
Owner

@⁠francoisatt on GitHub · 2026-09-11 22:44 UTC · original
francoisatt:feat/sop2-mul-hi-i32 → main · +9 −0 · 4 files · 1 commits · merged 2026-09-12 10:56 UTC

Dakar Desert Rally (PPSA04477) fails shader recompilation on SOP2 opcode 0x36
— see #281, raw=[0x9b0cff6b], still current on 2e315a3.

Change. Decode and translate only. The signed high-multiply IR opcode already
exists and is fully wired: SMulHi (ValueOpcodes.inc), lowered through
EmitMulHigh(..., signed=true) in spirvEmitterAlu.cpp, already used by VOP1
V_MUL_HI_I32 and folded by ConstantPropagation. So this adds the table entry,
the enum value next to S_MUL_HI_U32, and the translate case — nothing
downstream.

Tests. shaderCfgTests gains a paired case: S_MUL_HI_U32 must lower to
UMulHighU32 and S_MUL_HI_I32 to SMulHighI32, so the signedness is asserted
rather than assumed.

Verification. Clean build on Windows, clang-cl 19.1.5, Ninja. 36/37 tests pass
— the only failure is kernel_file_system, which fails on clean main as well
(see #505; PR #565 is not merged here).

Not verified at runtime — I don't have the title.

References

  • AMD RDNA 2 ISA Reference Guide, SOP2: opcode 0x36 S_MUL_HI_I32
  • Captured instruction word: 0x9b0cff6b

AI assistance. Written with AI assistance; every change reviewed, built and
tested locally by me.

**@⁠francoisatt** on GitHub · 2026-09-11 22:44 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/576) `francoisatt:feat/sop2-mul-hi-i32` → `main` · +9 −0 · 4 files · 1 commits · merged 2026-09-12 10:56 UTC Dakar Desert Rally (PPSA04477) fails shader recompilation on SOP2 opcode 0x36 — see #281, raw=[0x9b0cff6b], still current on 2e315a3. Change. Decode and translate only. The signed high-multiply IR opcode already exists and is fully wired: SMulHi (ValueOpcodes.inc), lowered through EmitMulHigh(..., signed=true) in spirvEmitterAlu.cpp, already used by VOP1 V_MUL_HI_I32 and folded by ConstantPropagation. So this adds the table entry, the enum value next to S_MUL_HI_U32, and the translate case — nothing downstream. Tests. shaderCfgTests gains a paired case: S_MUL_HI_U32 must lower to UMulHighU32 and S_MUL_HI_I32 to SMulHighI32, so the signedness is asserted rather than assumed. Verification. Clean build on Windows, clang-cl 19.1.5, Ninja. 36/37 tests pass — the only failure is kernel_file_system, which fails on clean main as well (see #505; PR #565 is not merged here). Not verified at runtime — I don't have the title. References - AMD RDNA 2 ISA Reference Guide, SOP2: opcode 0x36 S_MUL_HI_I32 - Captured instruction word: 0x9b0cff6b AI assistance. Written with AI assistance; every change reviewed, built and tested locally by me.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:26:06 +00:00
github manually merged commit 5c82333ab9 into gh-pr/576/base 2026-11-26 09:26:06 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.