xshader: add the exact f16 dot helper only with the f16 dot products #631
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/631"
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?
Imported from brcly/TuxBox. Originally posted by JohnVonWells on 2026-12-01T17:52:49Z.
Fixes the compile failure reported on #615: a program that uses only the integer dot products no longer compiles.
Cause
#615 put the exact f16 dot helper,
tb_dot2_f16, inDOT_HELPERS, which is added to every program with anyv_dot*instruction.tb_dot2_f16calls the 128-bit helpers andtb_f32_norm128fromfloat64_arith::HELPERS, butoutput.rsadds those only forv_dot2_f32_f16andv_dot2c_f32_f16. A program with only the integer forms gets a function that calls undeclared names. DXC rejects that even though nothing calls the function. The tests missed it because they always translated the f16 forms next to the others.Fix
tb_dot2_f16moves to its own block,DOT_F16_HELPERS. It is added after the f64 arithmetic helpers, and only for the two f16 forms.DOT_HELPERSkeeps the integer helpers. Programs with an f16 dot product get the same text as before. Programs with only integer dot products lose the unused function.Checks
Each dot form was translated alone and compiled with DXC (
cs_6_0,-O3), then validated with dxv:bb52b9bb)v_dot2_f32_f16,v_dot2c_f32_f16v_dot2_i32_i16,v_dot2_u32_u16,v_dot4_i32_i8,v_dot4_u32_u8,v_dot8_i32_i4,v_dot8_u32_u4,v_dot4c_i32_i8use of undeclared identifier 'tb_u128_shl'integer_dot_products_leave_out_the_f16_dot_helperfails without the change.cargo test --lib: 752 passed.tools/native_rdna2/check_translated.py: PASS. The f16 dot products still match the card in every word.python tuxbox.py checkon an RX 6950 XT: 16 of 17 steps passed. "Lanes and fixtures on the GPU" failed on two gates:lanes-selftest-texture-publicationis #625. It fails the same way on main.lanes-descriptor-tailfailed once in that run. Run alone afterwards, all its gates passed twice with this change and twice on main. This change doesn't touch it.Run on AMD only. A run on an NVIDIA card is still missing.
AI-assisted.
Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T18:07:12Z.
Checked on the three ProjectScarlett programs from my #615 report (
7baa6a35…,6da9859f…,1d52e9cf…): with fb17e160's translator each fails withundeclared identifier 'tb_u128_shl'; witha5b0d3dbtb_dot2_f16is gone from all three, and each compiles with DXC 1.9.2609 (cs_6_6) and passesdxv. RX 6600 host, Linux DXC.