Repository navigation
fix(recompiler): apply the S_BFE_U32 width when the vertex fetch scanner folds constants - #2371
Conversation
…ner folds constants
|
Linux run: Linux 7.2 (x86_64), GCC 16.2.1, Release,
|
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
|
Hardware measurement of 405 rows: sources 0x9e000000, 0xfff00320, 0x00000320, 0xffffffff, 0x80000001 × offsets 0, 4, 31 × widths 0, 1, 8, 30, 31, 32, 33, 64, 127, each with the remaining S1 bits clear, with bit 23 set, and with 0xff00ffe0 set. Every row equals this PR's PR head f00c2f2 merged onto Not measured: gfx1013. AI-assisted: yes. |
|
@fma-rc thanks for the hardware rows. The widths 33, 64 and 127 also settle the one thing I hadn't checked on hardware: a width of 32 or more keeps every bit above the offset, rather than wrapping modulo 32. That matches the translator's AI-assisted: yes |
|
Checked on a merged tree: |
fix(recompiler): apply the S_BFE_U32 width when the vertex fetch scanner folds constants
Closes #2370
What
The embedded vertex fetch scanner folded
S_BFE_U32on constant SGPRs as a plain right shift and ignored the width field. It now callsscalarBfeU32, which matches the translator'ssBfeU32: offsetS1 & 31, width(S1 >> 16) & 0x7fclamped to 32, and 0 when the width is 0.The other ops that reach that switch are
S_AND_B32,S_LSHL_B32,S_ADD_I32andS_ADD_U32(isAttributePropagationAlu). The two adds land in thedefaultcase, which adds, so those are correct.Tested
New test
agc_embedded_vertex_fetch. It decodes a vertex program that builds an SMEM offset withs_mov_b32ands_bfe_u32, loads a buffer descriptor from the buffer table at that offset, and fetches withbuffer_load_format_xyzwon the vertex index. It checks the buffer slot the plan records.maind70b899ctest -R agc_ -j1on Linux (Nobara 44, GCC 16): 257 of 258 on an RTX 5070 Ti (NVIDIA 595.91.07) and 258 of 258 on RADV (Ryzen 5 7600X iGPU, Mesa 26.2.1). The NVIDIA failure,agc_driver_dcc_keys_first_write, fails the same way onmaind70b899.tools/check_conventions.py: passes.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository