diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 10:23:25 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 10:23:25 +0000 |
| commit | 64ed15f2559497d61d6d0454baec83bc99806de1 (patch) | |
| tree | facf47a4c864e75e1949b60b2c4132e8fb1d8c52 /runtime/src/thread_stacks.cpp | |
| parent | 3faac557b1584d39004357918e60325b4d4ff0fe (diff) | |
rdna2spirv: v_ldexp_f16 follows a MODE.FP_ROUND toward-zero write
After s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 every VALU f16 result
except the transcendentals rounds toward zero (docs/design.md), but the
v_ldexp_f16 branch never read %mode_r16: an overflow still gave +-inf
(0x7c00 for 0x7bff * 2, want 0x7bff) and a denormal result still rounded
to nearest even (0x3c03 * 2^-15 gave 0x0202, want 0x0201).
When the program writes the field, overflow now gives +-65504 and the
denormal rounding increment is dropped while the mode is 3. Programs that
never write MODE emit the same code as before.
tests/semantic/test_ldexp_f16_mode_round.py: edge cases, a seeded sweep
against an exact rational reference in both modes, and a check that every
f16 case of tools/mode_round_probe.py is the translator's word. The probe
gets two ldexp cases so an RDNA2 GPU can confirm the toward-zero words,
which are not measured on hardware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions