mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 18:28:38 +00:00
run_workgroup now steps every invocation one instruction per round, so a load after a store sees all lanes' stores as in a SIMD wave (cs_w64x_load_ ballot_load read a later store before), allows a partial last subgroup, and answers OpGroupNonUniformAny, All and BitwiseOr Reduce; BallotFindLSB, IAddCarry and UGreaterThan are per lane. A shuffle from a lane that is not running is an undefined value. test_wave64_subgroup_ops runs cs_w64x_ballot, _readfirstlane, _load_ballot_load, _partial, cs_wave64_ballot, cs_wm_bfm64, cs_wm_half_cmp and cs_wavemask without --wave64-emulate: - one 64-wide subgroup: every word equals check.py (cs_wavemask: all 64 lanes); - two 32-wide subgroups: the pinned words equal what an RTX 4070 SUPER (driver 610.88) wrote, three runs each; cs_wavemask 64 mismatches with lane 0 = 0x00081021 on both; - removing 21cef25's ballot guard makes cs_w64x_partial use an undefined value. 403 semantic tests pass (397 before). AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.4 KiB
ArmAsm
55 lines
1.4 KiB
ArmAsm
; cs_wavemask test fixture generated by tests/semantic/regen_fixtures.py from runtime/test/shaders/cs_wavemask.asm
|
|
v_mbcnt_lo_u32_b32 v1, -1, 0
|
|
v_mbcnt_hi_u32_b32 v1, -1, v1
|
|
v_lshlrev_b32_e32 v3, 2, v1
|
|
v_mov_b32_e32 v4, 0
|
|
s_mov_b32 exec_lo, 0xffff0000
|
|
s_mov_b32 exec_hi, 0xffff
|
|
s_mov_b64 s[6:7], exec
|
|
s_bcnt1_i32_b64 s8, exec
|
|
s_bcnt1_i32_b64 s10, s[6:7]
|
|
s_add_i32 s8, s8, s10
|
|
s_cmp_lg_u32 s6, 0
|
|
s_cselect_b32 s14, 1, 0
|
|
s_add_i32 s8, s8, s14
|
|
s_cmp_eq_u64 s[6:7], 0
|
|
s_cselect_b32 s14, 2, 0
|
|
s_add_i32 s8, s8, s14
|
|
s_ff1_i32_b64 s9, exec
|
|
v_cmp_gt_u32_e32 vcc_lo, 24, v1
|
|
s_bcnt1_i32_b64 s11, vcc
|
|
v_mbcnt_lo_u32_b32 v4, s6, 0
|
|
v_mbcnt_hi_u32_b32 v4, s7, v4
|
|
v_mov_b32_e32 v6, s6
|
|
v_or3_b32 v6, s6, s6, v6
|
|
v_readfirstlane_b32 s12, v6
|
|
v_mov_b32_e32 v6, s7
|
|
v_readfirstlane_b32 s13, v6
|
|
v_writelane_b32 v10, s6, 0
|
|
v_writelane_b32 v10, s7, 1
|
|
s_mov_b32 exec_lo, -1
|
|
s_mov_b32 exec_hi, -1
|
|
s_mov_b32 s6, 0
|
|
s_mov_b32 s7, 0
|
|
v_mov_b32_e32 v5, 0
|
|
v_readlane_b32 s6, v10, 0
|
|
v_readlane_b32 s7, v10, 1
|
|
s_mov_b64 exec, s[6:7]
|
|
v_mov_b32_e32 v5, 0x80
|
|
s_mov_b32 exec_lo, -1
|
|
s_mov_b32 exec_hi, -1
|
|
v_mov_b32_e32 v7, 0
|
|
s_mov_b64 exec, s[12:13]
|
|
v_mov_b32_e32 v7, 0x40
|
|
s_mov_b32 exec_lo, -1
|
|
s_mov_b32 exec_hi, -1
|
|
s_lshl_b32 s9, s9, 8
|
|
s_lshl_b32 s11, s11, 16
|
|
s_or_b32 s8, s8, s9
|
|
s_or_b32 s8, s8, s11
|
|
v_or3_b32 v4, v4, v5, v7
|
|
v_lshlrev_b32_e32 v4, 24, v4
|
|
v_or_b32_e32 v2, s8, v4
|
|
buffer_store_dword v2, v3, s[0:3], 0 offen
|
|
s_endpgm
|