Commit Graph

14 Commits

Author SHA1 Message Date
e0a8694bef Fold s_min/max_i32, s_bfe_i32, s_sext_i32, and s_pack_* in shader_meta and guard SGPR width 2026-11-25 21:38:59 +08:00
0e776fab62 shader_meta: bound DXBC part offsets and payloads to declared container total 2026-11-23 22:18:32 +01:00
91de0bd7cc Merge pull request #4604 from shdann
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:21 -05:00
910c647f35 Merge pull request #4572 from Lucas
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:02 -05:00
24f05e5517 Merge pull request #4546 from shdann
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:47 -05:00
2b53baf125 shader_meta: reject malformed ISG1 semantic names before publishing inputs 2026-11-22 22:11:32 -05:00
005b230686 shader_meta: fold s_ashr_i32, s_bfm_b32, s_bfe_u32, s_min_u32, s_max_u32 and s_abs_i32 of known constants
_step_state did not fold these scalar operations. Thus a literal S# that
has one dword made with one of them was not in literal_samplers.

The two-source operations fold in _fold_scalar_alu with the values that
the translator computes for immediates: the shift count of s_ashr_i32 is
modulo 32, s_bfm_b32 makes a mask of (width & 31) ones at (offset & 31),
and the field of s_bfe_u32 stops at bit 31. s_abs_i32 of a known constant
is a known constant. A source that is not a known constant gives no
constant, as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 06:05:54 +03:00
6f447e7891 test: cover incomplete DXBC input signature tables 2026-11-22 20:25:27 -06:00
14b51cc7de shader_meta: fold s_not_b32, s_nand_b32, s_nor_b32 and s_xnor_b32 of known constants
_step_state did not fold the inverted scalar logic operations. Thus a
literal S# that has one dword made with one of them (for example
0xFFFFFFFF as s_not_b32 of 0) was not in literal_samplers.

s_not_b32 of a known constant is now a known constant. s_nand_b32,
s_nor_b32 and s_xnor_b32 of two known constants fold together with the
other two-source logic operations. A source that is not a known constant
gives no constant, as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 05:19:25 +03:00
8479d6c0f2 shader_meta: fold s_brev_b32 so a literal S# built with it reaches literal_samplers (SHADER-769) 2026-11-23 01:34:33 +01:00
4c9d224573 shader_meta: classify global_atomic, scalar stores, slist operands, and s_mulk_i32 2026-11-22 14:09:32 -03:00
1a15a53bf9 shader_meta: classify scalar RMW and v_div_scale dual-dst operands 2026-11-22 12:28:37 +05:30
b7905794d0 shader_ir: preserve VOP3 FP abs/neg modifiers on constant operands
Keep VOP3 FP source modifiers (neg(...), |...|, -|...|, abs(...), and nested combinations) as abs/neg flags on imm and fimm operands instead of applying two's-complement integer negation or folding outer '-' before FAbs, matching LLVM AMDGPUInstPrinter::printOperandAndFPInputMods.

Plain signed numeric literals (-1, -1.0, 0x10) keep their existing dict layout. Also handle -0x... inside modifiers, preserve abs on sext(...), and apply abs then neg in tools/shader_meta.py::_imm_u32.

Verified on CPU with tests/test_shader_ir.py, tests/test_shader_meta.py, tests/test_cpu_ref.py, tools/f32_fuzz.py and the full tests/semantic suite (1,027 tests).
2026-11-22 01:09:48 -04:00
3e6cde78ec Tools: emit D3D12->Vulkan build metadata in spirv/index.json 2026-11-21 15:01:07 -03:00