diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-11-08 23:49:04 +0100 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-11-09 07:58:05 +0100 |
commit | 0ef5649e9b9f409cf1e133e8670043f066ba3acb (patch) | |
tree | dd71c5ac232c4ca23424a52d0c2c771eb36af623 /gcc/range-op.h | |
parent | 68b0615be2aaff3a8ce91ba7cd0f69ebbd93702c (diff) | |
download | gcc-0ef5649e9b9f409cf1e133e8670043f066ba3acb.zip gcc-0ef5649e9b9f409cf1e133e8670043f066ba3acb.tar.gz gcc-0ef5649e9b9f409cf1e133e8670043f066ba3acb.tar.bz2 |
[range-op-float] Abstract out binary operator code out of PLUS_EXPR entry.
The PLUS_EXPR was always meant to be a template for further
development, since most of the binary operators will share a similar
structure. This patch abstracts out the common bits into the default
definition for range_operator_float::fold_range() and provides an
rv_fold() to be implemented by the individual entries wishing to use
the generic folder. This is akin to what we do with fold_range() and
wi_fold() in the integer version of range-ops.
gcc/ChangeLog:
* range-op-float.cc (range_operator_float::fold_range): Abstract
out from foperator_plus.
(range_operator_float::rv_fold): New.
(foperator_plus::fold_range): Remove.
(foperator_plus::rv_fold): New.
(propagate_nans): Remove.
* range-op.h (class range_operator_float): Add rv_fold.
Diffstat (limited to 'gcc/range-op.h')
-rw-r--r-- | gcc/range-op.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/range-op.h b/gcc/range-op.h index c724989..442a6e1 100644 --- a/gcc/range-op.h +++ b/gcc/range-op.h @@ -117,6 +117,13 @@ public: const frange &lh, const frange &rh, relation_trio = TRIO_VARYING) const; + virtual void rv_fold (REAL_VALUE_TYPE &lb, REAL_VALUE_TYPE &ub, + bool &maybe_nan, + tree type, + const REAL_VALUE_TYPE &lh_lb, + const REAL_VALUE_TYPE &lh_ub, + const REAL_VALUE_TYPE &rh_lb, + const REAL_VALUE_TYPE &rh_ub) const; // Unary operations have the range of the LHS as op2. virtual bool fold_range (irange &r, tree type, const frange &lh, |