fix(shader): refuse DPP16 on opcodes with no DPP form #522
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/522"
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:38:01Z.
What
The VOP1/VOP2 DPP16 decoder (
src0 = 0xfa) accepted every opcode, including the ones that have no DPP form, and then applied a lane permute that the hardware doesn't define for them (64-bit operands, scalar destination, literal operand, register swaps). They now throwDPP modifier is not supported for opcode, the same way VOPC already refuses DPP for opcodes withoutsupportsDpp.The opcodes come from a sweep of every VOP1 (0x00-0x7f) and VOP2 (0x00-0x3d) opcode with a DPP16 word, decoded with
llvm-mc --disassemble -mcpu=gfx1013(same result on gfx1011, gfx1012, gfx1030): the decoder accepted 23 encodings that LLVM rejects as DPP:v_readfirstlane_b32,v_cvt_{i32,u32,f32}_f64,v_cvt_f64_{i32,u32,f32},v_trunc/ceil/rndne/floor/fract_f64,v_frexp_exp_i32_f64,v_frexp_mant_f64,v_swap_b32,v_swaprel_b32.v_mac_legacy_f32,v_madmk_f32,v_madak_f32,v_fmamk_f32,v_fmaak_f32(both decode toVMadmkF32/VMadakF32),v_fmamk_f16,v_fmaak_f16.This is the same set #513 refuses for DPP8, so the list is now one predicate (
hasDppForm) shared by both;acceptsDpp8keeps on top of it the four opcodes that have a DPP16 form but no DPP8 path yet (v_pk_fmac_f16,v_movrels*).Left out:
v_nop/v_pipeflush/v_clrexcp(no operands, nothing to permute).Tested
Linux, RADV and lavapipe. New
agc_driver_dpp_no_form_tests(tests/execution/DppNoForm.cpp, compile only, so it also runs on lavapipe): each of the 23 encodings is refused with DPP16, DPP8 and DPP8fi:1, andv_mov_b32/v_add_nc_u32with DPP16 still compile.Fails without the fix, each piece reverted separately: VOP1 DPP16 ignoring the list (
v_readfirstlane_b32 with DPP16), VOP2 DPP16 ignoring it (v_mac_legacy_f32 with DPP16), DPP8 no longer using the shared list (v_readfirstlane_b32 with DPP8), and refusing every opcode fails the accepted cases.Full Release build + ctest: everything passes except
agc_driver_pixel_helper_lanes, which also fails onmainwith local RADV.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:12Z.
Thanks. I swept every VOP1 and VOP2 opcode with a DPP16 word through
llvm-mc --disassemble -mcpu=gfx1013and got the same 23 encodings, plusv_rcp_f64,v_rsq_f64andv_sqrt_f64, which main doesn't decode yet, so they already throw.One thing to keep in mind: #447 (and #474) add those three to the VOP1 decoder, and since
hasDppFormdefaults to true they would accept DPP16 again once both are in, permuting only the low dword of the 64-bit source. Whichever of the two lands second should addVRcpF64,VRsqF64andVSqrtF64to the list.It goes in after #513, and I'll run it through my PPSA21564 check with the rest of the shader batch. Ready to merge from my side.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T01:33:27Z.
Rebased on current main, carrying #513's rebased head (after #587). This commit applied unchanged;
agc_driver_dpp_no_form_testsand the full ctest pass on RADV and lavapipe (only the knownagc_driver_pixel_helper_laneson RADV).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T02:47:11Z.
Thanks, this carries #513's rebased head and your commit applied unchanged (same patch as the one I reviewed).
agc_driver_dpp_no_formpasses here on the merged branch. Every DPP16 instruction PPSA21564 uses (v_mov_b32,v_sub_f32,v_or_b32,v_max_f32,v_min_f32,v_add_f32,v_subrev_f32,v_add_nc_u32) has a DPP form, so nothing it runs is refused. Ready to merge from my side after #513.