https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128686

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, there are 2 reverse operations involved, one is [-0.,+0.] = VARYING - t
where for t we IMHO correctly figure out that t is [-__FLT_MAX__,__FLT_MAX__].
And the second is [-__FLT_MAX__,__FLT_MAX__] = 2.0 * y.  Now, to compute that
the latter reverse the code extends that range by 1ulp in each direction in
hypothetical wider exponent but same precision type (for -fno-rounding-math by
0.5ulp) and then divide (or whatever the inverse operation is) and do some
fixups for some corner cases.
But perhaps this extend by 1ulp above max or below min is something that is not
viable for flag_rounding_math.
The options are give up (so just extend to +-inf in that case and don't try to
do something fancy), or extend to something significantly farther away.  For
reverse of +- guess it would be enough if it would be twice as big as the
maximum (so add one to exponent, keep mantissa), but for the reverse
multiplication/division cases we'd need twice as big exponent.  E.g. IEEE quad
has 15-bit exponents while GCC internally has 26-bit exponents, so perhaps that
should be ok and we can always widen to twice as big exponent.

Reply via email to