Commit Graph

246 Commits

Author SHA1 Message Date
Dean 3c681d5199
Merge pull request #670 from NahuelGenchi/feat/global-atomic-csub
feat(shader): implement global_atomic_csub
2026-10-06 07:54:05 +13:00
Dean d5b7fbc127
Merge pull request #660 from Celegans12/feat/agc-dpp16-row-share
feat(shader): implement the DPP16 row_share controls
2026-10-06 07:53:22 +13:00
Dean 7df0923570
Merge pull request #659 from Celegans12/feat/agc-image-atomics-32bit-formats
feat(agc): implement image atomics on 32_SINT and 32_FLOAT surfaces
2026-10-06 07:52:39 +13:00
Dean bbc6f42881
Merge pull request #667 from adriadam10/test/image-atomics-bitwise
test(shader): cover the bitwise and unsigned image atomics
2026-10-06 07:51:54 +13:00
Dean a509d519a1
Merge pull request #689 from adriadam10/test/flat-global-loads-ci-time
test(shader): split the flat and global loads test to keep it within CI's time limit
2026-10-06 07:51:41 +13:00
Dean 7b1d7cc78a
Merge pull request #688 from adriadam10/test/global-atomics-ci-time
test(shader): split the global atomics test to keep it within CI's time limit
2026-10-06 07:50:59 +13:00
Dean fdd6519eac
Merge pull request #507 from adriadam10/feat/vop3-integer-clamp
fix(shader): saturate VOP3 integer mad/sad results on clamp
2026-10-06 07:27:34 +13:00
Dean 33e9a12159
Merge pull request #511 from adriadam10/feat/sdwa-vop2-float-selectors
feat(shader): accept every SDWA selector on VOP2 float ops
2026-10-06 07:13:44 +13:00
Dean b6c889d208
Merge pull request #625 from DotDebian/fix/mimg-address-instruction-dimension
fix(shader): locate image LOD, mip and sample index by the instruction's dimension
2026-10-06 07:13:30 +13:00
Adrià Franch fa996bbccb fix(shader): saturate VOP3 integer mad/sad results on clamp
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:05:34 +02:00
Celegans12 73c68c04bd feat(agc): implement image atomics on 32_SINT and 32_FLOAT surfaces
The resource materializer refused every atomic image descriptor whose
format was not 32_UINT. RDNA2 image atomics act on the raw dword and
the numeric format only affects addressing, so 32_SINT and 32_FLOAT
surfaces are now accepted with the Uint numeric class and run through
the existing integer atomics and float compare-exchange loops. Other
formats still throw, and the message now names the format.

DescriptorBinding gains imageAtomic, carried through the shader disk
cache (format version 4) and the resource content key. The driver
binds those elements through a cached R32_UINT view of R32_SINT and
R32_SFLOAT storage images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:06 +02:00
Celegans12 f7ede9cd7d feat(shader): implement the DPP16 row_share controls
EmitDppTargetLane threw "DPP control 336 is not supported" for the
DPP16 row_share controls 0x150-0x15f. row_share:sel now reads lane
sel of the reading lane's own row, (lane & ~15) | sel, as the RDNA2
ISA defines it. The source never leaves the row, so the target is
always valid and an inactive source follows the existing fi and
bound_ctrl rule, as for row_xmask.

The new agc_driver_dpp16_row_share_xmask execution test covers
v_mov_b32, v_add_nc_u32, v_sub_nc_u32 and v_max_f32 with row_share
and row_xmask under a partial exec mask, with fi, bound_ctrl and
row/bank masks, as wave32 and wave64; row_xmask had no test before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:00 +02:00
Adrià Franch 93d14fa5f4 test(shader): split the flat and global loads test to keep it within CI's time limit
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 17:32:46 +02:00
Adrià Franch 14a00e6963 test(shader): split the global atomics test to keep it within CI's time limit
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 17:19:12 +02:00
Adrià Franch 4066e6dd29 test(shader): keep the flat cache bits test within CI's time limit
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 16:54:53 +02:00
Nahuel Genchi a93faff19f feat(shader): implement global_atomic_csub
GLOBAL opcode 0x34 subtracts the data register from a global dword and
clamps the result to zero, returning the previous value. It only exists
in the global segment, so the flat form throws in the decoder, and the
form without glc throws like buffer_atomic_csub does. The clamped
subtract is now a shared helper used by both opcodes.
2026-10-05 10:32:48 -03:00
Dean 4c57426b51
Merge pull request #501 from adriadam10/fix/vop3-legacy-mods
fix(shader): v_mullit_f32 legacy rules, v_cvt_pk_u8_f32 rounding and VOP3 neg/abs
2026-10-06 02:32:06 +13:00
Dean a2b0e24e9e
Merge pull request #508 from adriadam10/feat/vop3-cube-clamp
feat(shader): accept clamp on v_cube*_f32 and match their zero and subnormal results
2026-10-06 02:31:22 +13:00
Adrià Franch 62ad3a6802 test(shader): cover the bitwise and unsigned image atomics
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 15:05:14 +02:00
Adrià Franch 7e90590146 feat(shader): accept every SDWA selector on VOP2 float ops
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 14:49:14 +02:00
Dean 53dc19cf61
Merge pull request #617 from Erige005/test/discard-refused-recompile-results
test(agc): discard the results of recompiles expected to be refused
2026-10-05 22:16:17 +13:00
Adrià Franch f457d87bbd feat(shader): accept clamp on v_cube*_f32 and match their zero and subnormal results
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 10:57:27 +02:00
Adrià Franch 7bb6c59e83 fix(shader): v_mullit_f32 legacy rules, v_cvt_pk_u8_f32 rounding and VOP3 neg/abs
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 10:53:50 +02:00
Dean 698c23d81e
Merge pull request #528 from adriadam10/test/vop1-vop2-integer
fix(shader): v_cvt_rpi/flr_i32_f32 NaN and exact round-half-up, VOP1/VOP2 integer test
2026-10-05 21:35:53 +13:00
Dean e3e1dfae16
Merge pull request #526 from adriadam10/test/scalar-sop1
fix(shader): s_wqm SCC and s_andn{1,2}_wrexec destination, SOP1/SOPC/SOPK execution test
2026-10-05 21:35:11 +13:00
Dean 5ad0c99f98
Merge pull request #525 from adriadam10/test/scalar-alu
fix(shader): s_lshlN_add SCC and s_bfe_[iu]32 fields past bit 31
2026-10-05 21:34:30 +13:00
Dean 1e37ed456a
Merge pull request #514 from adriadam10/fix/dpp16-movrels-pk-fmac
fix(shader): DPP16 operands of v_pk_fmac_f16 and the relative moves
2026-10-05 21:33:48 +13:00
Dean 6fd9739d9d
Merge pull request #510 from adriadam10/feat/sdwa-vop2-integer-clamp
feat(shader): saturate VOP2 integer SDWA results on clamp
2026-10-05 21:33:38 +13:00
Dean 070ed19249
Merge pull request #509 from adriadam10/feat/sdwa-vop2-integer
feat(shader): accept every SDWA selector on VOP2 integer ops
2026-10-05 21:32:55 +13:00
Dean 17ef50b681
Merge pull request #504 from adriadam10/feat/vop3-opsel-16
fix(shader): VOP3 op_sel on v_alignbit/alignbyte_b32 and 16-bit max3/min3/med3
2026-10-05 21:32:13 +13:00
Dean bbedad3b00
Merge pull request #500 from adriadam10/fix/f32-clamp-bits
fix(shader): clamp f32 results to +0 for NaN and -0
2026-10-05 21:31:31 +13:00
DotDebian 84974a9b2a fix(shader): locate image LOD, mip and sample index by the instruction's dimension
The address operands of a MIMG instruction are laid out by its own DIM
field: the decoder counts them that way. The SPIR-V emitter located the
gradients, the LOD, the LOD clamp, the mip level and the sample index
after the coordinate count of the bound T# instead, so an array
instruction on a non-array texture took the slice as its LOD.

An instruction that addresses fewer coordinates than its image has is
refused instead of reading the next address component as a coordinate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 10:29:48 +02:00
Dean d18fa1367c
Merge pull request #612 from oneandonlydean/perf/recompiler-lds-constant-slots
perf(recompiler): index lane-strided per-invocation LDS by constant slots
2026-10-05 21:24:42 +13:00
Dean ef88b5be00
Merge pull request #490 from oneandonlydean/fix/agc-views-past-max-mip
fix(agc): address texture views that start past the surface's last mip
2026-10-05 21:22:36 +13:00
Dean e7bf72d503
Merge pull request #616 from adriadam10/feat/mimg-tfe-lwe
feat(shader): accept tfe and lwe on MIMG loads, stores and samples
2026-10-05 20:29:00 +13:00
Dean 56acdef2f5
Merge pull request #569 from adriadam10/feat/global-store-addtid
feat(shader): implement global_store_dword_addtid
2026-10-05 20:27:36 +13:00
Dean 033ac78439
Merge pull request #563 from adriadam10/feat/vop3-mad64-clamp
feat(shader): implement clamp on v_mad_u64_u32 and v_mad_i64_i32
2026-10-05 20:26:55 +13:00
Erige005 fb16cb3b19 test(agc): discard the results of recompiles expected to be refused 2026-10-05 07:12:32 +00:00
Adrià Franch d044384a89 feat(shader): implement global_store_dword_addtid
Decode FLAT opcode 0x17 in the global segment and store the data VGPR of
each active lane at the SGPR pair base plus the signed offset plus four
times the lane id, sharing the address path of global_load_dword_addtid.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 08:41:19 +02:00
Adrià Franch 1cc11cee57 feat(shader): accept tfe and lwe on MIMG loads, stores and samples
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 08:25:57 +02:00
Dean Galvin 31af5a9d22 perf(recompiler): index lane-strided per-invocation LDS by constant slots
Stages without workgroup memory keep LDS in a per-invocation Function
array. With the array sized to the addresses it reaches (#586),
PPSA21564's intro pixel shader still takes 864 bytes of local memory
per thread on NVIDIA: its accesses are lane * 4 + {0, 256, 512}, so
the index stays dynamic and the 192-dword array lives in local memory.

When every LDS access's address is lane * stride + constant (lane id,
constants, adds, multiplies and left shifts), with one stride, a whole
number of dwords, for all of them and no wrap (the bound analysis
already proves that), the emitter now addresses each access by its
constant plus its instruction offset. The lane id is the same for
every access of an invocation, so taking lane * stride out maps the
addresses one to one, keeps which accesses alias and keeps every
access in bounds; the array sees only constant indices and the driver
keeps it in registers. Shaders with any other address form are
emitted as before.
2026-10-05 18:18:29 +13:00
Dean 3655c2ae34
Merge pull request #506 from adriadam10/feat/global-atomics-float
feat(shader): implement the float and 64-bit inc/dec flat and global atomics
2026-10-05 18:15:22 +13:00
Dean 2afc403a04
Merge pull request #495 from adriadam10/feat/flat-cache-bits
feat(shader): accept the glc, slc and dlc cache bits on flat, global and scratch
2026-10-05 18:14:41 +13:00
Dean 12cf58256f
Merge pull request #491 from adriadam10/feat/global-atomics
feat(shader): implement the integer flat and global atomics
2026-10-05 18:13:59 +13:00
Dean 50e7712002
Merge pull request #608 from adriadam10/test/scalar-program-flow
fix(shader): wave-wide exec and vcc branch conditions
2026-10-05 18:13:07 +13:00
Dean f809199b0a
Merge pull request #606 from adriadam10/fix/permlane16-inactive-source
fix(shader): keep v_permlane16 lanes whose source lane is inactive
2026-10-05 18:12:26 +13:00
Dean e074483ab7
Merge pull request #604 from adriadam10/fix/smem-buffer-offset-overflow
fix(shader): return zero when an s_buffer_load offset passes 2^32
2026-10-05 18:11:43 +13:00
Dean e90d2edf54
Merge pull request #596 from adriadam10/fix/vop3-pack-ldexp-bits
fix(shader): compute v_cvt_pknorm_*_f32, v_ldexp_f32 and v_pack_b32_f16 on the bits
2026-10-05 18:11:01 +13:00
Dean bdd10f1929
Merge pull request #475 from adriadam10/feat/mimg-coarse-g16
feat(shader): implement image_sample_cd/_g16 variants and fix a16 gradient layout
2026-10-05 18:10:20 +13:00
Dean 71f248ad54
Merge pull request #568 from adriadam10/fix/f32-minmax-nan
fix(shader): return src0 when both f32 min/max sources are NaN
2026-10-05 18:09:38 +13:00