diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-12-08 10:41:49 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-12-08 10:43:27 +0100 |
commit | 716c2d08893110f186f0fb94849524b1acf9dd02 (patch) | |
tree | 07bfae80ed36e34ca0a10c9ca782fde6b7c65824 /gcc/gimple-range.cc | |
parent | 8d4f007398bc3f8fea812fb8cff4d7d0556d12f1 (diff) | |
download | gcc-716c2d08893110f186f0fb94849524b1acf9dd02.zip gcc-716c2d08893110f186f0fb94849524b1acf9dd02.tar.gz gcc-716c2d08893110f186f0fb94849524b1acf9dd02.tar.bz2 |
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.
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions