feat(shader): accept SDWA byte destination selectors on v_cvt_norm_i16_f16 #28007
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28007"
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 cmsierrave-coder on 2026-11-28T03:40:17Z.
What
Enable SDWA byte destination selectors (
BYTE_0..BYTE_3) alongsideWORD_0/WORD_1forRdnaOpcode::VCvtNormI16F16(v_cvt_norm_i16_f16, VOP1 opcode0x63) incore/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp.The translation path (
vCvtNormF16->write16Bits->writeRawU32) already implements byte and word SDWA destination placement (BYTE_0..BYTE_3,WORD_0,WORD_1) withUNUSED_PAD,UNUSED_SEXT, andUNUSED_PRESERVE, matchingv_cvt_norm_u16_f16. AddedSdwaCvtNormI16F16Bytes.cpp(decoder acceptance/rejection checks + Wave32/Wave64 GPU execution tests across all byte/word destination selectors, unused modes, andWORD_1neg), its Wave64 CMake test registration fragment, and a technical debt fragment indocs/dev/debt/changes/feat-shader-sdwa-cvt-norm-i16-f16-bytes.md.Tested
Paired Vulkan validation on Windows 11 (non-elevated
VK_LAYER_PATHwithVK_LAYER_KHRONOS_validation1.4.363,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer) comparingorigin/main(a4ebd9084cc) vs this branch:origin/mainbaseline (ctest -R "^agc_driver_sdwa_cvt_norm_(f16|u16_f16_bytes)(_wave64)?$" -V): 4/4 passed (agc_driver_sdwa_cvt_norm_f16,agc_driver_sdwa_cvt_norm_f16_wave64,agc_driver_sdwa_cvt_norm_u16_f16_bytes,agc_driver_sdwa_cvt_norm_u16_f16_bytes_wave64), 7.24 s, 0 skipped, 4/4Insert instance layer "VK_LAYER_KHRONOS_validation", 0VUID-/SYNC-HAZARD-/UNASSIGNED-errors.ctest -R "^agc_driver_sdwa_cvt_norm_(f16|u16_f16_bytes)(_wave64)?$" -V): 4/4 passed, 7.28 s, 0 skipped, 4/4 layer insertions, 0VUID-/SYNC-HAZARD-/UNASSIGNED-errors.ctest -R "^agc_driver_sdwa_cvt_norm_i16_f16_bytes(_wave64)?$" -V): 2/2 passed (agc_driver_sdwa_cvt_norm_i16_f16_bytes,agc_driver_sdwa_cvt_norm_i16_f16_bytes_wave64), 4.26 s, 0 skipped, 2/2 layer insertions, 0VUID-/SYNC-HAZARD-/UNASSIGNED-errors.debt_fold.py --check: exit 0;check_conventions.py --base origin/main:All conventions checks passed.(0 findings, 0 errors);pr_overlap.py --branch feat/shader-sdwa-cvt-norm-i16-f16-bytes: 4/6 shared PRs compared cleanly with 0 overlap, and PRs 17606 (v_cvt_u16_f16) and 25964 (v_lshl_add_u32/v_add_lshl_u32) were manually verified not to touchVCvtNormI16F16.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 Plyxen on 2026-11-28T07:01:43Z.
Review: APPROVED
Checked head
05751a7ae1. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomain4c7578e0a4together with #28006, #27985, #28002, #28001, #27991, #27987, #27994.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded. In the full CPU suite (5,135 tests) the only failure iswindows_read_trap_unknown, which fails onmaintoo (fixed in #28028). The full GPU suite (2,249 tests) on both GPUs, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerand the 1.4.363 layer inserted, matchesmainon the same machine. The GPUs were an NVIDIA RTX 5080 (621.24) and an AMD Radeon gfx1036 iGPU (26.11.2). Onlyagc_driver_linear_target_import_creationfails, as onmain(fixed in #28029), and neither log has aVUID-orSYNC-HAZARDline.agc_driver_sdwa_cvt_norm_i16_f16_bytes_wave64passes. The GPU suite list above predates the new tests, so I applied this PR again with #28001 and #27987 and ran the new tests 3 times on each GPU with the same environment: all pass, with the layer inserted and noVUID-orSYNC-HAZARDline.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T07:25:26Z.
Review: COMMENTED
Reviewed — no blocking findings
Independent execution checks were not run in this review, so a formal approval is not justified; the author reports passing Vulkan tests and convention checks.
What I ran
Read the prepared diff and all four changed files at head
05751a7ae11b728554d85b8841ea41086e303d42throughrepo_read.py; inspected the related translation path and neighboring test registration. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results were not independently verified. The reported Wave32/Wave64 Vulkan runs, convention checks, and PR overlap checks are author supplied. No repository files were excluded; all four changed files listed in the manifest were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:46:02Z.
Review: COMMENTED
The execution fixture checks low-word inputs and negated high-word inputs across the new destination bytes. The decoder also accepts the DWORD source selector with those destinations. Could one execution row use that selector with different low and high halves and verify which half contributes to the byte?
Source review at
05751a7ae1. The head trial-merges onto700fae9438. Paired Vulkan execution is queued.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.