Shaders: lower v_cvt_norm_i16_f16 and v_cvt_norm_u16_f16 #376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/376"
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 Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T02:43:58Z.
v_cvt_norm_i16_f16andv_cvt_norm_u16_f16(VOP1 0x63/0x64) were not lowered, so any program using them failed to translate.write_half).flt16_to_snorm16/flt16_to_unorm16, the same rule as the f32pknormconversions. I haven't measured these two ops on console hardware.Test:
v_cvt_norm_i16_and_u16_f16_round_the_exact_productinvalu_tests.rsruns both ops on the host GPU and WARP. It covers 287 f16 patterns: every 251st pattern, plus ±0, subnormals, ±0.5 (the tie), the values next to 1, ±1, ±inf and NaNs. Each result is checked against an f64 reference.dxil.dll10.0.26100 passes.lower.rschange it fails withUnsupported { what: "v_cvt_norm_i16_f16" }.cargo test --workspace, clippy andcargo xtask policyare clean.No game files.
AI-assisted (Claude Code): I reviewed the change and ran the tests above.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:10:57Z.
Thanks @LouisRiverstone for the exact-product conversion work. I tested head
ded334bb9172865a9be7acdb8a2047358a30e4dbwith:Result: 1 passed, 0 failed (69 filtered out). This exercises both signed and unsigned normalized f16 conversions against the test’s f64 reference over the synthetic edge-pattern set. It does not measure behavior on console hardware.
Imported from Marvisak/VIctory. Originally posted by Lyrnc on 2026-11-24T06:02:23Z.
RDNA2 hardware measurement over all 65,536 f16 patterns: the exact-product, round-to-nearest-even rule matches every one, in the FP16 mode that keeps input denormals.
AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. A HIP kernel (assembled by the AMD driver's amd_comgr) runs
v_cvt_norm_i16_f16andv_cvt_norm_u16_f16on every half (junk in the source's high half,0xdead0000preset in the destination), under FP16 denormals kept and flushed. RDNA2 desktop silicon, not the console's. No game data.v_cvt_norm_i16_f16v_cvt_norm_u16_f16denorm16= 3)denorm16= 0)0x0101for i16 and0x0081for u16 up), which flush to 0 before scaling. Your lowering matches the denormals-kept mode, the same choice as thepknormforms in #596.0xdeadon all patterns, consistent withwrite_half.AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run.