feat(shader): accept SDWA byte destination selectors on v_cvt_f16_f32 #17605
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17605"
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:00:45Z.
What
Accept Sub-Dword Addressing (SDWA) byte destination selectors on
v_cvt_f16_f32(VOP1 opcode 0x0a).Updates
vop1SdwaRulesforVCvtF16F32to 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 294-295) andSIPeepholeSDWA.cppdestination foldingdocs/dev/debt/shader.mdunder### Functionalstrictly < 1000 characters (Lesson L60)Tested
tests/agc_driver_sdwa_cvt_f16_f32_bytes_testsexecuted on hostIntel(R) Graphics (RPL-S)(Vulkan 1.4):BYTE_0..BYTE_3,WORD_0,WORD_1), and 3 unused modes (UNUSED_PAD,UNUSED_SEXT,UNUSED_PRESERVE).std::invalid_argumenton invalid selector 7 and illegal destination unused mode 3.python3 tools/check_conventions.py --base origin/mainwith 100% compliance.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 milescoviello on 2026-11-09T10:53:25Z.
Review: APPROVED
NVIDIA result to go with DonRyuzaki's AMD run, this time with validation on.
Setup: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release, head
13e7063eb6. Run withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(layer 1.4.341,VK_LOADER_DEBUG=layer),ctest -R '^agc_driver_sdwa_cvt_f16_f32_bytes' -V, 3 runs.agc_driver_sdwa_cvt_f16_f32_bytes(Wave32) and_tests_wave64pass 3 of 3 runs each, none skipped.VUID-lines. The loader inserted the layer in both tests and a physical device was selected in each, so the layer checked both.From reading: the only decoder change is the destination mask of the
VCvtF16F32row invop1SdwaRules(RdnaVectorOpDecoder.cpp:1131), widened tosdwaSelBytes() | sdwaSelWords(). That matches the row above it forVCvtF32F16. Source selects and the clamp flag are unchanged, so no other SDWA form of this opcode changes behaviour.Edited 11-09: the validation numbers above come from a re-run with layer 1.4.341, where
VK_LOADER_DEBUG=layershows the loader inserting it in every test. The 1.4.363 layer my first run pointed at wasn't installed, and these test programs don't print the loader's "not found" error, so that run validated nothing (#17896).AI-assisted: yes (Claude Code)