fix(recompiler): accept SDWA destination selects on v_not_b32 #2200
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2200"
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?
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-09T11:29:41Z.
What
Uncharted: Legacy of Thieves Collection (PPSA05684) stops on
mainwith:that is
v_not_b32_sdwa ... dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE.v_not_b32_sdwatakesdst_selanddst_unusedlike the other 32-bit VOP1 SDWA forms (RDNA2 ISA section 6.3.1 "SDWA"; LLVMVOP1Instructions.tdgivesV_NOT_B32aVOP1_SDWAencoding with both operands). The rule now allows byte and word destinations with every unused mode, which the existing SDWA writeback implements.SdwaDestinationchecks WORD_0 with UNUSED_PRESERVE and fails without the fix.Not checked on hardware.
Tested
Arch Linux, GCC 16.2.1, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.71.09).
main(d70b8998):tools/check_conventions.pypasses; of the 513 ctest tests all pass exceptagc_driver_dcc_keys_first_write, which fails the same way onmain(an unchanged pending image was uploaded again).agc_driver_storage_cache_budgetpasses run alone; underctest -j8a local 3 GB RSS limit stopped it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T13:07:51Z.
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
-DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build pluslibs.09582357cherry-picked onto currentmaind70b8998(applies cleanly).agc_driver_dcc_keys_first_writepasses onmainand with this change, so the failure noted in the description (an unchanged pending image was uploaded again) doesn't reproduce on Windows/NVIDIA.agc_driver_storage_cache_budgetalso passes underctest -j8here (14 s).AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T01:50:44Z.
Hardware measurement, and a run of the PR.
Radeon 610M (gfx1036),
tools/hw-oracle, Linux 7.2.9, hsa-rocr 7.2.4, clang 23.1.1. Controls: ieee 0, dx10_clamp 1, denorm32 0, denorm16 3, round32 0, round16 0, fp16_overflow 0.v_not_b32_sdwawith dst_sel BYTE_0–3, WORD_0, WORD_1 × dst_unused PAD, SEXT, PRESERVE × src0_sel BYTE_0–3, WORD_0, WORD_1, DWORD, each with and withoutsext: 252 forms. 24 rows each (8 sources × 3 previous destination values), wave32 and wave64: 12,096 results.Every result equals: take the selected source field (sign-extended with
sext), invert it, write its low bits into the destination field. PAD zeroes the other bits; SEXT fills the bits above the field with the field's top bit and zeroes those below; PRESERVE keeps the previous destination bits.PR head
09582357merged ontomainee501326, Release, GCC 16.2.1, on an RTX 5080 (615.71.09) and on RADV (Mesa 26.1.4, same Radeon 610M):SdwaDestinationtest passes on both.RdnaVectorOpDecoder.cppreverted tomain, the test stops withVOP1 SDWA destination selector 4 (unused 2, source selector 6) of opcode 0x37 at pc 0xc0 is not supported.Not measured: gfx1013.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:14:11Z.
Checked on the HW oracle (gfx1035):
v_not_b32_sdwaover every dst_sel × dst_unused × src0_sel × sext (294 forms, 64 rows each, previous destination varied) matches the existing SDWA writeback bit for bit;agc_driver_sdwa_destinationfails without the decoder change; scoped build + ctest green; no conflicts with #2376/#1898. Matches @fma-rc's gfx1036 measurement and @rmz-24's Windows run. Merging.