feat(shader): implement the 32-bit DS src2 operations #938
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/938"
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 CnRJay on 2026-10-06T18:47:11Z.
What
The decoder threw on the GFX10.1 DS src2 opcodes 0x80-0x8b, 0x8d, 0x92, 0x93 and 0x95. Each one reads
DS[B], whereBis the address plus four times the 15-bit signed offset inoffset1[6:0]:offset0, and applies the matching operation toDS[A]:ds_write_src2_b32.These forms still throw, and are recorded in TechnicalDebt:
offset1[7]);Tested
Windows 11, MinGW GCC Release build, ctest
agc_driver_lds_src2passes (new, on the GPU). Each lane runs every src2 operation on its own LDS words, and each result is compared with the value computed from the ISA pseudocode. A shader that uses the address-offset form must be rejected at compile time.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T05:50:56Z.
Heads-up: this PR is on hold, not rejected. It may depend on how
ds_{add,min,max}_src2_f32behaves under the shader float mode (IEEE_MODE, DX10_CLAMP, the denormal bits of FLOAT_MODE in RSRC1). Real titles set that mode per shader, and the recompiler currently assumes a single one; see #981. Until that is settled, no float-mode dependent shader PR gets reviewed or merged. Nothing to do on your side for now. Once #981 lands, this will probably need tests for each mode value it relies on.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T20:45:58Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/TechnicalDebt.mdL270Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T21:15:22Z.
Unblocking this from #981. I rebased it on
mainand pushed one commit on top (your commit is unchanged):ds_min_f32,ds_max_f32andds_add_f32ignoreIEEE_MODE, but depend on whether f32 denormals are flushed. 28, 28 and 12 of 196 special rows (±0, ±1, ±inf, denormals, quiet and signaling NaNs) differ between flushed and kept. The src2 variants can't be measured: gfx1035 has no src2 opcodes, which exist only on GFX10.1 like the PS5's gfx1013, and AMD's RDNA1/RDNA2 ISA XML doesn't list them. Sods_{min,max,add}_src2_f32now throw until LDS float denormals are modelled (the FLOAT_MODE step of #981). The 13 integer/bitwise src2 ops don't depend on the mode and stay as you wrote them.OOB_SELECT3,0x31016fac), as #639 did for the existing execution tests. Without it the stores were dropped (0xdeadbeef).Tested on the merge with
main:agc_driver_lds_src2on RADV and CI's lavapipe, full ctest 491/491. Negative check: lowering the f32 ops again fails atf32 opcode 0x00000092 was not refused.