fix(recompiler): accept byte source selects on v_cvt_f16_u16 SDWA #2695

Closed
tv7 wants to merge 1 commit from upstream-pr/2695 into main
tv7 commented 2026-10-10 11:08:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-10T11:08:50Z.


What

Silent Hill: Townfall (PPSA33286) stops on main with:

VOP1 SDWA destination selector 4 (unused 2, source selector 3) of opcode 0x50

that is v_cvt_f16_u16_sdwa ... dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:BYTE_3: the title converts the top byte of a register into the low half of another and keeps its high half. The v_cvt_f16_u16 SDWA rule only accepted word and dword source selects. The generic SDWA source path already zero-extends a byte select, which is the u16 value the conversion expects, so the rule now accepts every source select, with whole and partial destinations. Same kind of change as #2200 (v_not_b32).

Tested

Windows 11 Pro (10.0.26200), MinGW GCC 15.2.0 (WinLibs UCRT), Release, NVIDIA RTX 3070.

  • New GPU test agc_driver_sdwa_cvt_f16_u16 (tests/execution/SdwaCvtF16U16.cpp): runs the four byte source selects on the GPU (BYTE_3 into WORD_0 and BYTE_1 into WORD_1 with UNUSED_PRESERVE, BYTE_0 and BYTE_2 into DWORD) and checks the converted halves and the preserved bits. It fails on main with the error quoted above and passes with the fix.
  • Full build and ctest on current main (b5f5362d): 707/707 pass.
  • python tools/check_conventions.py --base origin/main passes.
  • Silent Hill: Townfall: with this change the title's shaders recompile and it moves on to later, unrelated stops (it now ends at the layered render target of #2102). Other open PRs were merged locally for that run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4810744501 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2695). Originally posted by [tv7](https://github.com/tv7) on 2026-10-10T11:08:50Z. --- ### What Silent Hill: Townfall (PPSA33286) stops on `main` with: ``` VOP1 SDWA destination selector 4 (unused 2, source selector 3) of opcode 0x50 ``` that is `v_cvt_f16_u16_sdwa ... dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:BYTE_3`: the title converts the top byte of a register into the low half of another and keeps its high half. The `v_cvt_f16_u16` SDWA rule only accepted word and dword source selects. The generic SDWA source path already zero-extends a byte select, which is the u16 value the conversion expects, so the rule now accepts every source select, with whole and partial destinations. Same kind of change as #2200 (`v_not_b32`). ### Tested Windows 11 Pro (10.0.26200), MinGW GCC 15.2.0 (WinLibs UCRT), Release, NVIDIA RTX 3070. - New GPU test `agc_driver_sdwa_cvt_f16_u16` (`tests/execution/SdwaCvtF16U16.cpp`): runs the four byte source selects on the GPU (BYTE_3 into WORD_0 and BYTE_1 into WORD_1 with UNUSED_PRESERVE, BYTE_0 and BYTE_2 into DWORD) and checks the converted halves and the preserved bits. It fails on `main` with the error quoted above and passes with the fix. - Full build and `ctest` on current `main` (b5f5362d): 707/707 pass. - `python tools/check_conventions.py --base origin/main` passes. - Silent Hill: Townfall: with this change the title's shaders recompile and it moves on to later, unrelated stops (it now ends at the layered render target of #2102). Other open PRs were merged locally for that run. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-10 11:09:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T11:09:41Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096871008 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2695#issuecomment-6096871008). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T11:09:41Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2695
No description provided.