xshader: lower fourteen ordinary VOP3 integer forms #95
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!95
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/95/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@JohnVonWells on GitHub · 2026-11-24 22:01 UTC · original
xshader/ordinary-integer-vop3→main· +2250 −5 · 6 files · 1 commits · merged 2026-11-24 22:05 UTCA synthetic sweep over the decoder's ALU opcode table (one instruction with ordinary register operands per opcode, no shader inputs) showed about 95 decodable instructions the translator refuses as
unsupported vector op. This PR takes the group with exact integer semantics, which is the easiest to verify:v_add_nc_i16,v_sub_nc_i16,v_mad_u16,v_mad_i16,v_min3_u16,v_max3_u16,v_med3_u16,v_min3_i16,v_max3_i16,v_med3_i16v_add_nc_i32,v_sub_nc_i32,v_mad_u32_u16,v_mad_i32_i16Lowering
int16half-select path: op_sel picks the source halves, and op_sel bit 3 picks the destination half. The other half is preserved, as for the existing newer 16-bit forms.min3/max3/med3compare sign-extended halves for_i16.int32module.v_mad_u32_u16/v_mad_i32_i16accept op_sel on the two multiplicands only.Verification
tools/check_ordinary_integer_gpu.pyassembles every legal op_sel combination withllvm-mc -mcpu=gfx1030. The result register aliases one source, so destination-half preservation is tested too. The script runs the translated shaders through DXC/DXV and stock Proton, then compares all 384 readback words per dispatch, including the inputs and guard words, with a Python model. Hand-computed values for that model are intests/test_ordinary_integer_gpu.py.1002:73a5, RADV): 154 selector combinations, 2,464 results, 8,448 GPU words, zero mismatches. The receipt isevidence/ordinary-integer-vop3-control.json.5cee10frefuses all 22 test shaders (--baseline). For each instruction, the clamp form and an SGPR-source form are refused.min3/max3/med3comparing unsigned. The check then failed at the firstv_min3_i16case, exactly on the inputs with bit 15 set.Not included:
v_cvt_pk_u16_u32andv_cvt_pk_i16_i32were refused in the same sweep. I could not independently confirm their saturation behaviour (LLVM does not constant-foldllvm.amdgcn.cvt.pk.*), so they remain refused.AI-assisted.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NhDbTJdTcjebsL5u7pwFoY