feat(shader): decode DPP8 on VOP1 and VOP2 #513
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/513"
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:15:52Z.
What
The decoder threw on DPP8 (
src0= 233dpp8, 234dpp8 fi:1) for every VOP1/VOP2 opcode. Now it decodes them.dppCtrl, plus a newdpp8operand flag.fi:1setsdppFetchInactive. DPP8 has no row/bank mask, bound_ctrl or neg/abs, so those keep their defaults.DppMoveFlags::controlwidens to 32 bits.Lanes8marks a DPP8 selector, so the existingDppMoveU32/DppUpdateU32ops and theirLaneSourceentries cover it unchanged.EmitDppGroupPermTargetLane): 2 bits per lane for quad_perm, 3 bits for DPP8 (8-lane groups).llvm-mc -mcpu=gfx1013(f64 VOP1, readfirstlane, swap/swaprel, madmk/madak/fmamk/fmaak, mac_legacy) throwDPP8 modifier is not supported for opcode.main, and I'll fix those in separate PRs:v_movrels_b32,v_movrelsd_b32,v_movrelsd_2_b32:readRelativeVectorreads the registers directly and drops the source permute. On HW the permute applies to the relatively indexed value.v_pk_fmac_f16: the DPP16 form already disagrees with the same op on a pre-permuted source.Behaviour measured on HW (RDNA2 gfx1035, wave32 and wave64)
lreads lane(l & ~7) | sel[l & 7]. The groups never cross 8 lanes, including across the wave64 halves.fi:0: a lane whose source lane is inactive reads 0.fi:1: it reads the source lane's value anyway. Inactive lanes are not written.Tested
Arch Linux, RADV (RDNA2) and lavapipe; no title.
agc_driver_dpp8_tests: v_mov (plain,fi:1), v_add_nc_u32, v_add_f32, v_fmac_f32, v_cndmask_b32, v_cvt_f32_i32 and v_add_co_ci_u32 with DPP8. A partial-exec block (exec=0x5a5af0f3, wave64 hi0xc3a5960f) checksfi:0/fi:1and the zeroing of inactive sources. The source ofmov_uniform_inactiveis wave-uniform, which pins the two-half wave64 path. Expected values come from HW. It runs as wave32, as wave64 on one 64-lane subgroup, and as wave64 split into two 32-lane halves (ComputeTarget(32)). lavapipe skips the test (subgroup 8), as DsPermute does.fiignored, DPP8 neg/abs read like DPP16, lanes taken as quad_perm, destination losingdpp8, translator droppingLanes8. RemovingDppMoveU32/DppUpdateU32fromLaneSourcealso fails it on the split path. ForcinglaneHalfto 0 fails it on lane 32.v_mov_b32_dpp. It is not committed. All passed except the four refused above and the*_co_ciforms, where the reference reads a vcc that the first op had already overwritten.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 oneandonlydean on 2026-10-04T21:08:09Z.
Thanks, this checks out. The encoding matches LLVM (
DPP8_FI_0 = 0xE9,DPP8_FI_1 = 0xEA, eight 3-bit selectors in bits 31:8), and the decoder correctly leaves the row/bank masks,bound_ctrland neg/abs at their defaults.(l & ~7) | sel[l & 7]never crosses a 32-lane half, so wave64 on a 32-wide host subgroup is safe, and withfi:0an inactive source reads 0 while the write condition is just EXEC. I swept every VOP1/VOP2 opcode through llvm-mc with a DPP8 word: every op the decoder knows without a DPP8 form is either in your refuse list or isn't a gfx1013 opcode at all. The new test fails on main and passes on NVIDIA in my run. Ready to merge from my side. It reshapes the quad_perm lane helper every DPP16 quad_perm goes through, so I'll run it through my PPSA21564 check before merging.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T01:32:37Z.
Rebased on current main (after #587). Conflict in
SpirvSubgroup.{hpp,cpp}: kept #587'sEmitHostSubgroupLane/EmitWaveBallotnext toEmitDppGroupPermTargetLane, and updated #587'sWave32WideSubgroup.cppcall fromEmitDppQuadPermTargetLane(state, id, 0x1b)toEmitDppGroupPermTargetLane(state, id, 0x1b, 2)(same lane math).agc_driver_dpp8_tests,wave32_wide_subgroup_testsand the rest of ctest pass on RADV (only the knownagc_driver_pixel_helper_lanes, red on main locally since #305).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T02:47:09Z.
Thanks, the conflict resolution is right.
EmitDppGroupPermTargetLane(state, id, 0x1b, 2)emits the same instructions as #587'sEmitDppQuadPermTargetLane(state, id, 0x1b), sowave32_wide_subgroupchecks the same lane math as before, and #587'sEmitHostSubgroupLane/EmitWaveBallotare kept.agc_driver_dpp8andwave32_wide_subgrouppass here on the merged branch.PPSA21564 has no DPP8, and with 2 lane bits the quad_perm path generates the same SPIR-V as main, so this doesn't need my PPSA21564 check. Ready to merge from my side.