feat(shader): accept SDWA byte destination selectors on v_cvt_f16_u16 #18241
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18241"
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-10T23:30:49Z.
What
Accept Sub-Dword Addressing (SDWA) byte destination selectors on
v_cvt_f16_u16(VOP1 opcode0x50).Updates
vop1SdwaRulesforVCvtF16U16incore/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.tdandSIPeepholeSDWA.cppdestination foldingdocs/dev/debt/shader.mdunder### FunctionalTested
/tmp/anyps5_verify_build(-DBUILD_TESTING=ON), rebased cleanly ontoorigin/main(115a7036e2, PR headca75d82e9b):ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir /tmp/anyps5_verify_build --output-on-failure -R "^agc_driver_sdwa_cvt_f16_u16_bytes":agc_driver_sdwa_cvt_f16_u16_bytes(Wave32): Passed (0.83 sec)agc_driver_sdwa_cvt_f16_u16_bytes_wave64(Wave64): Passed (0.32 sec)uint16_tvalues across 6 sub-dword destination selections (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 selector7, illegal unused mode3, and SDWA source negate on integer source.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T20:37:47Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
173dd32c3d58ec1467edd0ae52b005e18c9fe099, basemain, merged-preview check not needed.diff.patch. The new test file is 239 lines and was read end to end.check_conventions.py) are not runs I performed.Results
check_conventions.pyFindings
Blocking
None.
Non-blocking
docs/dev/debt/shader.md:252saysv_cvt_f16_u16is verified "across all source selectors (BYTE_0..BYTE_3,WORD_0,WORD_1,DWORD)". The rule table allows those sources (RdnaVectorOpDecoder.cpp:1133), but the new execution test only uses sourceWORD_0(core/libs/prx/libSceAgcDriver/tests/execution/SdwaCvtF16U16Bytes.cpp:171,(4u << 16u)). Either narrow the debt entry to the source selector that is tested, or add source cases to the test.core/libs/prx/libSceAgcDriver/tests/execution/SdwaCvtF16U16Bytes.cpp:109usesstd::invalid_argument,:185usesstd::spanand:190usesstd::optional, and none of<stdexcept>,<span>or<optional>is included in the file. They may come in through the other headers, but the file should not depend on that.SdwaCvtF16U16Bytes.cpp:80loops over a one-element list (for (const auto opWord : {CvtF16U16Sdwa})). A plain block would read more clearly. Optional.Not verified
check_conventions.pywas not run here. The 100% compliance result is the author's report.WORD_0are not exercised by any test (see finding 1).core/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cppwas read at the changed rule table and the float-result list, not in full.docs/dev/debt/shader.mdwas read in the diff hunk and for line length. The### Functionalheading is at line 38. The section placement of the new entry was not checked against any later heading.Sources
OperandAccess.cpp#L664-L698SubwordPacking.cpp#L166-L175To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T10:11:22Z.
Review: APPROVED
Reviewed — looks good
Nothing in the reviewed change blocks merging; the implementation and its focused test are consistent with the stated selector support.
What I ran
Reviewed head
afb5ff814d427090c92102278ab335c63d578749using the pinnedrepo_read.pyreader. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all four changed files listed in the manifest:
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sdwa_cvt_f16_u16_bytes_tests.cmake,core/libs/prx/libSceAgcDriver/tests/execution/SdwaCvtF16U16Bytes.cpp,core/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp, anddocs/dev/debt/shader.md. No files were excluded. Build, test execution, and the author-reported GPU results were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T11:43:56Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: register the new execution test target so CMake can build and run the added test.
What I ran
Reviewed head
ca75d82e9b6affcda0451cf48cc407f872e4be9f; no commands or tests were run by me.Results
Findings
Blocking
agcExecutionTests, and no other target declaration foragc_driver_sdwa_cvt_f16_u16_bytes_testsappears in the AgcDriver CMake configuration. The new CTest fragment invokes this executable, butagcTestFragmentsonly includes CTest registration and does not create the executable. Add the source to the execution-test target list (or otherwise declare the target) so the test builds and the CTest entry can run. agc_driver_sdwa_cvt_f16_u16_bytes_tests.cmake:2Non-blocking
None.
Sources
Not verified
No build or runtime test was performed. The author reports passing Wave32 and Wave64 execution tests and a clean build, but those results were not independently confirmed. Read all added lines in the four changed files: the CMake test fragment, execution test source, decoder rule, and shader debt entry. No changed files were excluded.
To get this to a good state
Register
SdwaCvtF16U16Bytes.cppasagc_driver_sdwa_cvt_f16_u16_bytes_tests, then rerun the build and the focused Wave32/Wave64 CTest selection.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:33:19Z.
Review: COMMENTED
The trial merge onto
c1601e56d5was clean. The decoder accepts all four byte destinations forv_cvt_f16_u16, while the new fixture’s explicit decoded control checksBYTE_0withUNUSED_PRESERVE. Please keep coverage for a higher byte and another unused mode, particularlyUNUSED_SEXT, when validating the shared byte-write path. Move the direct shader debt edit into a 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.