diff options
| author | Shadman PC <iamanthonytony@gmail.com> | 2026-11-22 18:18:06 +0600 |
|---|---|---|
| committer | Shadman PC <iamanthonytony@gmail.com> | 2026-11-22 19:37:29 +0600 |
| commit | 175781ea35c73c2dc8a5394e3e1f1b2c35d523f9 (patch) | |
| tree | c0c6a3d301dd40d641cc266cec118004eefbe304 /scripts/run_gpu_tests.py | |
| parent | 89b047cd8fab50675a43d76722a6a8a881f55dc2 (diff) | |
perf(translator): track s_mov_b64, s_movk_i32 and SGPR copies in sgpr_imm
buffer_bounds evaluates mode = None if lit3 is None else lit3 >> 28 & 3 to fold the OOB_SELECT mode into a single static bounds-check branch at translate time. When lit3 is unknown, it falls back to run-time extraction (OpBitFieldUExtract), 3x OpIEqual comparisons, and 6x cascading OpSelect instructions.
Previously, self.sgpr_imm only recorded literals from s_mov_b32. Shaders routinely load 64-bit descriptor pairs using s_mov_b64, or 16-bit sign-extended mode words using s_movk_i32, or copy preloaded constants via SGPR moves.
- In mov64, track immediate constants for both low and high SGPRs when desc_cache_ok(), and propagate copies from known SGPR pairs.
- In s_mov_b32, propagate known scalar immediates on SGPR-to-SGPR moves.
- In s_movk_i32, record the sign-extended 16-bit immediate in sgpr_imm.
Added tests in tests/semantic/test_buffer_oob_select.py verifying that s_mov_b64, s_movk_i32, and SGPR copy moves eliminate run-time OOB mode extraction and fold into static mode paths.
Diffstat (limited to 'scripts/run_gpu_tests.py')
0 files changed, 0 insertions, 0 deletions