upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/host_cpu.cpp
diff options
context:
space:
mode:
authorBora Sevim <sevimbora@gmail.com>2026-11-22 18:35:49 +0300
committerBora Sevim <sevimbora@gmail.com>2026-11-22 18:35:49 +0300
commitc20586fc58b16c8f58a97ad637ba2e8625b3e9e1 (patch)
tree884271c83eab2764ee3a67e5d13bf39a8f80e90c /runtime/src/host_cpu.cpp
parent4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff)
pknorm_probe: v_cvt_pknorm_* give 0 for NaN on RDNA2, but round the exact product once (SHADER-339)
tools/pknorm_probe.py runs v_cvt_pknorm_i16_f32 / v_cvt_pknorm_u16_f32 through the translator on the CPU interpreter and, with --oracle hw, natively through tools/hw_oracle in wave32 and wave64 under five MODEs. On an RDNA2 iGPU (gfx1036) every NaN half (74 of 74: quiet, signalling, both signs, payloads, in S0 and S1) gives 0, as the translator assumes, whatever IEEE, DX10_CLAMP and the f32 denormal mode are. The rounding does not match: the hardware rounds the exact product x * 32767 (or 65535) once, while the translator rounds the f32 OpFMul product and then RoundEven, one off on 28 of 28 near-tie inputs in both directions. Recorded in docs/design.md and docs/shader_validation.md; the translator is not changed here. tests/test_pknorm_probe.py checks four near-tie words against a hand derivation and the translator side's double rounding and NaN zero.
Diffstat (limited to 'runtime/src/host_cpu.cpp')
0 files changed, 0 insertions, 0 deletions