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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #54599|0                           |1
        is obsolete|                            |

--- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54601
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54601&action=edit
gcc13-pr109008-wip.patch

Here is an updated version of the WIP, I think this one now works (but is only
hooked up in the foperator_plus::op{1,2}_range and not for -, * and /.
Also, it returns the first smaller value (for low bound) or first larger value
(for upper bound) for which the test already isn't met, while I think we should
set it to nextafter of that towards inf for the former and nextafter of that
towards -inf for the latter.
I can try to get statistics from it and also whether the loop over significand
bits is needed and helps something.  I've added another thing to the heuristics
to narrow down the range for the binary search on exponents, in particular the
maximum exponent from the lhs and op2 bounds (all 4 of them) next to the l + p
and l + 8 * p tests.  Bet detailed statistics can help to point what helps and
what doesn't.

If we get some smart math (or even the patch you've provided), I guess we can
try to compare the two implementations for the precision of the ranges as well
as compile time cost.

Reply via email to