diff options
| author | RussianSanta12 <127607192+RussianSanta12@users.noreply.github.com> | 2026-12-02 13:31:13 -0500 |
|---|---|---|
| committer | RussianSanta12 <127607192+RussianSanta12@users.noreply.github.com> | 2026-12-02 13:31:13 -0500 |
| commit | 83cb6c532ce3fa7c21377af549ec02ee7c40d2e9 (patch) | |
| tree | 44a08c06972e321d7a63577d574a383bee5aaa3b /runtime/test/code_hooks_test.cpp | |
| parent | 0497b4fc0460dd663fc8454d709bb968394070be (diff) | |
rdna2spirv: check operand counts only for lowered instructions, by encoding and modifiers (D3D12-TRANSLATOR-MISSING-OPERAND)
Review of the previous commit. The check ran on every parsed line, before reachable_code and before Gen skips
unreached blocks, so constant tables after s_endpgm that decode into short lines (v_madak_f32_dpp with three
operands, a junk v_add_f32_e32 v0, v1) made shaders that translate on main fail. Gen.insn now calls
check_operand_count for each instruction it lowers instead.
Not every operand is printed: LLVM prints a MUBUF load into LDS without vdata (buffer_load_dword v0, s[4:7], 0
offen lds), so with lds a buffer or FLAT-family load needs one operand fewer, and a FLAT/GLOBAL/SCRATCH atomic has
no destination without glc or with lds (as rdna2_decode prints it). Only those ops have an optional destination now;
global_load_dword v[0:1], off is refused instead of failing with IndexError. A v_cmpx has no destination in VOPC
either (OPR_EXEC there). The rules are keyed by the printed encoding (_e64 is VOP3/VOP3B, _e32/_sdwa/_dpp are
VOP1/VOP2/VOPC, a bare mnemonic takes the fewest of every encoding), so v_cndmask_b32_e64 v0, v1, v2 is refused while
the VOP2 short form keeps its implicit VCC. Each implicit VCC operand stays optional on its own:
v_add_co_ci_u32_e32 v6, vcc, 0, v6 (carry-out printed, carry-in implicit) is a form test_wave64_halves_soundness
translates.
The test adds global_load_dword and v_cndmask_b32_e64 short lines, the LLVM lds load (still its own
"buffer_load_dword form" rejection) and short junk after s_endpgm that must still translate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/code_hooks_test.cpp')
0 files changed, 0 insertions, 0 deletions