fix(shader): DPP16 operands of v_pk_fmac_f16 and the relative moves #514
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/514"
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 adriadam10 on 2026-10-04T14:25:27Z.
What
Four VOP1/VOP2 opcodes gave wrong results with a DPP16 modifier on
main. #513 found them with its differential sweep and refuses them for DPP8.v_pk_fmac_f16: the accumulator was read through the destination, whichdestinationOperandgives the source DPP, so the accumulator was permuted too. The result was then written throughplainOperand, which dropped the DPP write mask (row/bank mask, out-of-range lanes). It now reads the accumulator withaccumulatorOperandlikev_fmac_f32does and writes with the destination's DPP.v_movrels_b32,v_movrelsd_b32,v_movrelsd_2_b32:readRelativeVectorread the registers directly and ignored the source DPP. It now applies the source modifiers to the relatively indexed value. The decoder already refuses SDWA on these opcodes, so in practice this only adds the permute.v_movrelsd_b32,v_movrelsd_2_b32,v_movreld_b32:writeRelativeVectorwrote throughplainOperand, which dropped the DPP write mask. Now it keeps it.Behaviour measured on HW (RDNA2 gfx1035, wave32)
v_pk_fmac_f16_dpp: the DPP permutes only src0. The accumulator is the lane's ownvdst.v_movrels*_dpp: lanelgets the relatively indexed register of the DPP source lane, i.e.v[base + m0]permuted.v_mov_b32_dpp: row_mask, bank_mask, exec, and no write for an out-of-range source withoutbound_ctrl. The relative destination isvdst + m0(orm0[25:16]for_2).Tested
Arch Linux, RADV (RDNA2) and lavapipe; no title.
agc_driver_dpp16_operands_tests: the five opcodes under three DPP16 controls. quad_perm with full exec;row_shr:1withoutbound_ctrl, so the first lane of each row is not written; quad_perm withrow_mask:0x5 bank_mask:0xaand partial exec. Expected values come from HW. One extra row checks that the relative base registers stay untouched. lavapipe skips it (subgroup size 8 can't hold a 16-lane row), the same way DsPermute does.agc_driver_pixel_helper_lanes, which also fails onmainon local RADV since #305.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 adriadam10 on 2026-10-04T20:36:23Z.
Rebased on current main: the only Windows failure was
guest_audio_in_no_device, fixed by #532. No other changes.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:30:39Z.
Thanks, good catch. I re-checked the rebased head: the commit is unchanged from the one I first looked at, and it still merges cleanly onto current main.
On main the source DPP is copied into
inst.destination, sov_pk_fmac_f16read a permuted accumulator. I ran your test against main's code on NVIDIA and it fails with a value ("lane 0 quad_perm_pk_fmac_f16 is 0x3f013c00, expected 0x4a3d4000"), so this fixes a silent wrong result.accumulatorOperandpluswriteRawU32(inst.destination)is right, and for the non-DPP VOP2 and VOP3P forms the write is the same as before. For the relative moves, M0 is uniform, so permuting after the M0 select equals permutingv[base + m0]. The full ctest passes with it on my machine, and CI is green now.Ready to merge from my side.
packedFloat16is the path for every packed f16 op, so I'll run it through my PPSA21564 check before merging.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T08:31:22Z.
Gated on PPSA21564: no visual or FPS change.