Files
mandy/tests/semantic/fixtures/disasm/ps_ops7.s
simonbronk 48adc7b9a5 Translator: v_perm_b32 sign selectors 8-11; integer ALU tests ps_ops7/ps_ops8
v_perm_b32 returned 0x00 for selectors 8-11. Per the RDNA ISa BYTE_PERMUTE
they give 0xff when bit 7 of byte 1, 3, 5 or 7 of {src0, src1} is set. Each
byte pick also shifted both sources by up to 56 bits (undefined in SPIR-V,
the select kept the right one); the shift is now (sel & 3) * 8 on the source
chosen by sel < 4.

New test shaders, checked on the GPU (check.py, run_gpu_tests.py) and in
tests/semantic with expected words derived from the ISA:
- ps_ops7: v_perm_b32 (byte picks, 0x00/0xff, sign selectors), v_alignbit_b32
  with a shift of 36, v_med3_i32 vs v_med3_u32.
- ps_ops8: v_mul_hi_u32/i32, v_bcnt_u32_b32, v_ffbl_b32, v_ffbh_u32 (of 0),
  v_xad_u32, v_add3_u32.

The semantic interpreter gains OpUMulExtended/OpSMulExtended,
OpUGreaterThanEqual and GLSL FindILsb, FindUMsb, UMax, SMin, UClamp, SClamp,
with direct tests; the unsupported-ext example moves from FindUMsb to Ldexp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:33:25 +01:00

17 lines
523 B
ArmAsm

; ps_ops7 test fixture generated by tests/semantic/regen_fixtures.py from runtime/test/shaders/ps_ops7.asm
v_mov_b32_e32 v0, 0x80112233
v_mov_b32_e32 v1, 0x4455e677
v_mov_b32_e32 v2, 0x0c0d0700
v_perm_b32 v3, v0, v1, v2
v_mov_b32_e32 v2, 0x0b0a0908
v_perm_b32 v4, v0, v1, v2
v_mov_b32_e32 v5, 0x12345678
v_mov_b32_e32 v6, 0x9abcdef0
v_alignbit_b32 v7, v5, v6, 36
v_mov_b32_e32 v8, -5
v_med3_i32 v9, v8, 7, 3
v_med3_u32 v10, v8, 7, 3
v_lshl_add_u32 v11, v10, 16, v9
exp mrt0 v3, v4, v7, v11 done vm
s_endpgm