diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-09 13:41:28 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-09 20:33:03 -0400 |
commit | 29dbd7ef69fe1375055ada081af88e3a8919fff0 (patch) | |
tree | c7dc22136fd6a0fc3ae6849e2d4fe07262d66f47 /gcc/range-op-mixed.h | |
parent | 6a4ac393e199a63f39063daa28827f39dab49a07 (diff) | |
download | gcc-29dbd7ef69fe1375055ada081af88e3a8919fff0.zip gcc-29dbd7ef69fe1375055ada081af88e3a8919fff0.tar.gz gcc-29dbd7ef69fe1375055ada081af88e3a8919fff0.tar.bz2 |
Unify PLUS_EXPR range operator
Move the declaration of the class to the range-op-mixed header, add the
floating point prototypes as well, and use it in the new unified table.
* range-op-float.cc (foperator_plus): Remove. Move prototypes
to range-op-mixed.h
(operator_plus::fold_range): Rename from foperator_plus.
(operator_plus::op1_range): Ditto.
(operator_plus::op2_range): Ditto.
(operator_plus::rv_fold): Ditto.
(float_table::float_table): Remove PLUS_EXPR.
* range-op-mixed.h (class operator_plus): Combined from integer
and float files.
* range-op.cc (op_plus): New object.
(unified_table::unified_table): Add PLUS_EXPR.
(class operator_plus): Move to range-op-mixed.h.
(integral_table::integral_table): Remove PLUS_EXPR.
(pointer_table::pointer_table): Remove PLUS_EXPR.
Diffstat (limited to 'gcc/range-op-mixed.h')
-rw-r--r-- | gcc/range-op-mixed.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 9de8479..fbfe3f8 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -328,4 +328,43 @@ private: const irange &outer) const; }; +class operator_plus : public range_operator +{ +public: + using range_operator::op1_range; + using range_operator::op2_range; + using range_operator::lhs_op1_relation; + using range_operator::lhs_op2_relation; + bool op1_range (irange &r, tree type, + const irange &lhs, const irange &op2, + relation_trio) const final override; + bool op1_range (frange &r, tree type, + const frange &lhs, const frange &op2, + relation_trio = TRIO_VARYING) const final override; + + bool op2_range (irange &r, tree type, + const irange &lhs, const irange &op1, + relation_trio) const final override; + bool op2_range (frange &r, tree type, + const frange &lhs, const frange &op1, + relation_trio = TRIO_VARYING) const final override; + + relation_kind lhs_op1_relation (const irange &lhs, const irange &op1, + const irange &op2, + relation_kind rel) const final override; + relation_kind lhs_op2_relation (const irange &lhs, const irange &op1, + const irange &op2, + relation_kind rel) const final override; + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override; +private: + void wi_fold (irange &r, tree type, const wide_int &lh_lb, + const wide_int &lh_ub, const wide_int &rh_lb, + const wide_int &rh_ub) const final override; + 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, + relation_kind) const final override; +}; #endif // GCC_RANGE_OP_MIXED_H |