feat(shader): accept SDWA byte destination selectors on v_cvt_u16_f16 #17606
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17606"
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 Kikoarl on 2026-11-09T01:03:55Z.
What
Accept Sub-Dword Addressing (SDWA) byte destination selectors on
v_cvt_u16_f16(VOP1 opcode0x52).Updates
vop1SdwaRulesforVCvtU16F16incore/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cppto allowsdwaSelBytes() | sdwaSelWords()(previously restricted tosdwaSelWords()). In AMD RDNA2 ISA §13.3.7 Table 88, 16-bit destination instructions accept byte destination selectors (BYTE_0..BYTE_3) alongside word destination selectors (WORD_0,WORD_1) and destination unused modesUNUSED_PAD,UNUSED_SEXT, andUNUSED_PRESERVE.Sources:
VOP1Instructions.td(lines 392-393) andSIPeepholeSDWA.cppdestination foldingdocs/dev/debt/shader.mdunder### FunctionalTested
/tmp/anyps5_verify_build(-DBUILD_TESTING=ON), rebased cleanly ontoorigin/main(115a7036e2, PR headf0195292ee):ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir /tmp/anyps5_verify_build --output-on-failure -R "^agc_driver_sdwa_cvt_u16_f16_bytes":agc_driver_sdwa_cvt_u16_f16_bytes(Wave32): Passed (0.84 sec)agc_driver_sdwa_cvt_u16_f16_bytes_tests_wave64(Wave64): Passed (0.38 sec)BYTE_0..BYTE_3,WORD_0,WORD_1), and 3 unused modes (UNUSED_PAD,UNUSED_SEXT,UNUSED_PRESERVE), plus negative decoder refusal checks for invalid selector7and illegal destination unused mode3.python3 tools/debt_fold.py --check,python3 tools/check_conventions.py --base origin/main, andgit diff --check origin/main..HEAD: passed cleanly.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T02:43:44Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected decoder update is consistent with the neighboring 16-bit SDWA conversion rules, and the new test covers byte and word destination selectors and unused modes.
What I ran
bf679384e7c40f19e5349e73ab7e16249f565817usingrepo_read.py.description.md,commits.md,manifest.json,diff.patch,agc_driver_sdwa_cvt_u16_f16_bytes_tests.cmake,SdwaCvtU16F16Bytes.cpp,RdnaVectorOpDecoder.cpp, and the relevantCMakeLists.txtsections. All four changed files listed in the manifest were included;files.jsonwas unavailable through the reader.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test execution were not performed. The reported GPU execution and convention-check results were not independently verified. Console behavior on PS5 gfx1013 remains unverified, as the PR description notes.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T11:41:44Z.
Review: APPROVED
Reviewed — looks good
The reviewed change adds SDWA byte destination support for
v_cvt_u16_f16, and the inspected decoder rule and execution test support the stated selector behavior.What I ran
Reviewed head
f0195292ee8079683cf071ce1111d9cb1b36ad1c. I read the prepared description, commits, manifest, diff, and all four changed files. I did not run commands; the build and test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported Wave32/Wave64 tests or convention checks, and did not verify physical-console behavior. No files were excluded from the review bundle; all four changed files listed as reviewed were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T02:15:55Z.
Review: COMMENTED
Actionable comments posted: 1
6c184aff-48fa-434e-9f6c-8f96e8f53325Reviewing files that changed from the base of the PR and between
5ed18b5d5aand7008b518b6.core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sdwa_cvt_u16_f16_bytes_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/SdwaCvtU16F16Bytes.cppcore/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cppdocs/dev/debt/shader.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T02:51:01Z.
Review: APPROVED
Reviewed — looks good
The reviewed code supports the selector change; the prepared bundle reports author-run checks, but I could not run checks in this reader-only environment.
What I ran
Reviewed PR head
7008b518b673fcb4b903c3ba47cdb469a1fce02dusing the prepared review bundle and the pinned repository reader. No build or tests were run here.Results
Findings
Blocking
None.
Non-blocking
UNUSED_SEXTsign extension. The existing cases may not catch incorrect handling of those values (SdwaCvtU16F16Bytes.cpp:38).Sources
Not verified
The author reports Linux x86_64 Wave32 and Wave64 test passes and convention/debt checks; these were not independently run. Physical PS5 behavior is reported as unmeasured. I read the four changed files listed in the manifest; the diff bundle excludes files omitted by its stated rules.
files.jsonwas not available through the reader.To get this to a good state
Nothing is required. Optional: add distinct byte values and high-bit cases to strengthen selector and sign-extension coverage.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:35:57Z.
Review: COMMENTED
The trial merge onto
c1601e56d5was clean. The decode change enables all byte destinations for the conversion; keep coverage for a higher byte and the unused modes alongside the low-byte case. Its partner #18241 exercises the reverse conversion and should not substitute for this fixture. Please move the direct shader debt edit into a debt fragment. Paired execution is pending.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.