startup: v_mul_hi_u32 has no lowering (1 of the remaining loading-screen shader refusals) #1792
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1792
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@triggered02 on GitHub · 2026-11-24 18:43 UTC · original
Found in the refreshed refusal census on main (#870 thread). 1 refused shader, and the operation had no lowering at all.
Problem
v_mul_hi_u32(the high 32 bits of an unsigned 32x32 product) was refused outright, including the census form with a literal operand:tools/pixel_aot.pyalready implements this operation for the pixel AOT path with a halfword-product helper;tools/startup/gfx2hlsl.pydid not have it.Fix
The lowering calls a helper added to the shader preamble:
It is computed from halfword products because these shader stages have no 64-bit multiply, and the low half of
a * bis not the high half — so a plain*would be silently wrong.Measured
VOP3A encodings built in the test (
0b110101prefix, opcode0x16a),mainatb9f355f1:v_mul_hi_u32 v1, v1, v2v1 = mul_hi_u32(v1, v2);v_mul_hi_u32 v1, v0, 0xaaaaaaabv1 = mul_hi_u32(v0, 0xaaaaaaabu);v_mul_lo_u32 v1, v1, v2v1 = v1 * v2;Done when
docs/experiments.mdrecords the change.Not in this slice:
v_mul_hi_i32(its signed correction), the 24-bit_u24forms, and DXC/draw results.AI-assisted (Claude Code).
@winne42 on GitHub · 2026-11-25 06:45 UTC · original
I compared #1747 (
f2e319ce) and #1793 (6782e724) on top of currentmain(1949b265). This adds to the comparison on #1793 and the maintainer's merge note on #1747. The new part is what each test does once the PR is rebased onto the helpermainalready has from #2176.Translator change: both PRs add the same
VEC_Uentry,'v_mul_hi_u32': (2, 'mul_hi_u32({0}, {1})'). After a rebase, neither should add a helper of its own:main's, so itsgfx2hlsl.pyhunk reduces to theVEC_Uline.al/bl/m) merges intogfx2hlsl.pywithout a textual conflict. The result definesmul_hi_u32twice, which is the FXC/DXC redefinition noted in the review on #1747. A plain rebase that keeps both sides would not show it until the shader compiles.Each PR's own test on the resolved merge (
main+ theVEC_Uline + the PR'stests/startup_gfx2hlsl_mul_hi_check.py, default mode, Linux, Python 3):eval_emitted_helpermatches onlyuint al = …, bl = …, m = …and asserts onmain'sla/lb/middlebodySo #1747 also needs its test parser ported to
main's helper. The review on #1747 says that was done locally, but the PR head doesn't have it yet.Mutation controls on the #1793 candidate. Each mutation went into
main's helper or the lowering, and each one made the test fail:Against the "Done when" list in this issue:
0x12345678)0xaaaaaaab)main'smain's)binarymodedocs/experiments.mdrecords the changeNits: #1793's CMake comment cites
#1781, a merged DirectStorage PR, instead of #1792. #1747 also addsbinary llvm-mc-15to the Linux job inwindows.yml, and that hunk conflicts withmaintoo.Summary: #1793 is the smaller rebase, because it only drops its helper hunk. #1747 has the stronger evidence, its WARP and hardware draws, but it needs the helper removed, the test parser ported and a docs entry. A combined result could take #1747's draw modes and #1793's value-level evaluator and docs row. Which one lands is the maintainer's call.
Not run here: either draw (no Windows or D3D12 on this host) and #1747's
binarymode (this host has LLVM 21/22, not 15).AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-25 18:40 UTC · original
#1747 landed at
e06aca8b. The startup translator now lowers both register and encoded literal forms through the existing halfword helper. The source-built tests include the exact 0xaaaaaaab example, LLVM round trip, the carry and low-word controls, and FXC/DXC readback. Windows Release 5/5 passed on WARP and RTX 4060 Laptop, and the required cloud checks passed for the merged candidate. This closes the original lowering scope.