recomp: omod on f64 and f32/f16 conversions, integer clamp on unsigned/packed adds and dots #118
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/119"
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 ivall/xcl. Originally posted by gefydev on 2026-11-23T13:20:15Z.
#105 item 4.
Dropped before this change:
v_cvt_f32_f64andv_cvt_f16_f32;v_add_nc_u32,v_sub_nc_u32,v_subrev_nc_u32,v_add3_u32,v_pk_add/sub_u16,v_pk_add/sub_i16,v_pk_mad_u16/i16,v_dot2_{i32_i16,u32_u16},v_dot4_{i32_i8,u32_u8}andv_dot8_{i32_i4,u32_u4}. These wrapped instead.One point of the audit was wrong: f64 clamp did not narrow to float. DXIL has a double
Saturate, and the test confirms clamp keeps double precision on main. So that part is not changed.Notes:
v_cvt_f16_f32applies the modifiers in f32 before the rounding. The f16 is the same except where it is denormal.sat_u32, next tosat_i32. No-Gis(per #73).Test
gpu_clamp_and_omod_per_instruction: every changed instruction once, with values that saturate. The non-clamp forms of an add, a packed add and a dot are controls that must still wrap. Without the emit change it fails (first atv_add_f64omod). With it, it passes on a GTX 1650 under Wine (vkd3d-proton), and so do the other lib tests that run there. Not run on AMD.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T14:14:08Z.
Merged. It conflicted with
fdeacf0, which made the plainv_dot4*SM 6.4 intrinsics (dot4add_i8packed/dot4add_u8packed, for FSR4). Your clamped forms keepdot4_u8/dot4_i8(c4df2fe): written with the intrinsic,(int64_t)dot4add_i8packed(a, b, 0)gave DXC an internal compiler error. Your test passes on the RX 9070. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129:cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T14:15:06Z.
Closing by hand: your rebase (
28caa63) landed while I merged the earlier head (34efd81, merge73c7bbeonmain), so GitHub doesn't see it as merged. The content is in. One difference: the rebase writes the clamped 8-bit dots as(int64_t)dot4add_i8packed(a, b, 0)/(uint64_t)dot4add_u8packed(a, b, 0u)- that exact form gave DXC (Windows SDK 10.0.26100) an internal compiler error ingpu_clamp_and_omod_per_instruction, somainkeeps yourdot4_i8/dot4_u8helpers there (c4df2fe).Pull request closed