]> gcc.gnu.org Git - gcc.git/commit
range-op-float: frange_arithmetic tweaks for MODE_COMPOSITE_P
authorJakub Jelinek <jakub@redhat.com>
Thu, 8 Dec 2022 09:41:49 +0000 (10:41 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 8 Dec 2022 09:43:27 +0000 (10:43 +0100)
commit716c2d08893110f186f0fb94849524b1acf9dd02
tree07bfae80ed36e34ca0a10c9ca782fde6b7c65824
parent8d4f007398bc3f8fea812fb8cff4d7d0556d12f1
range-op-float: frange_arithmetic tweaks for MODE_COMPOSITE_P

As mentioned in PR107967, ibm-ldouble-format documents that
+- has 1ulp accuracy, * 2ulps and / 3ulps.
So, even if the result is exact, we need to widen the range a little bit.

The following patch does that.  I just wonder what it means for reverse
division (the op1_range case), which we implement through multiplication,
when division has 3ulps error and multiplication just 2ulps.  In any case,
this format is a mess and for non-default rounding modes can't be trusted
at all, instead of +inf or something close to it it happily computes -inf.

2022-12-08  Jakub Jelinek  <jakub@redhat.com>

* range-op-float.cc (frange_nextafter): For MODE_COMPOSITE_P from
denormal or zero, use real_nextafter on DFmode with conversions
around it.
(frange_arithmetic): For mode_composite, on top of rounding in the
right direction accept extra 1ulp error for PLUS/MINUS_EXPR, extra
2ulps error for MULT_EXPR and extra 3ulps error for RDIV_EXPR.
gcc/range-op-float.cc
This page took 0.064134 seconds and 5 git commands to generate.