With normal x and y and z = +-0, the exact x*y + z is x*y. The split path
scaled a tiny product by 2^96, and when it still underflowed p rounded to
-0 and th = p + z1 gave -0 + +0 = +0 where the exact result is -0. That
case now selects the single-rounded x*y (reported by sovljanskii in the
PR thread). Denormal factors keep the split path, which follows the
driver's denormal mode as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gen.fma_exact (SHADER-497) had two inputs where it was not the single-rounded
f32 FMA it claims to be:
- A product of at least 2^126 takes the 2^-64 scaling, which turned an addend
with 0 < |z| < 2^-62 into 0 (or a denormal a flushing driver drops). When
x*y lies exactly on a rounding tie, z's sign is what breaks it, so
(1 + 2^-12)^2 * 2^126 + 2^-100 gave 0x7e801000 instead of 0x7e801001.
Such a z now becomes a signed 2^-126, as v_div_fmas_f32 does for its own
pre-scaling.
- Infinite operands take the plain Fma. On a driver that splits it, a finite
x*y beyond FLT_MAX rounds to an infinity first, and with z the other
infinity the result was a NaN. Finite x and y with an infinite z now give z.
--fma glsl and --fma khr translate as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>