aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op-mixed.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2023-06-09 13:42:39 -0400
committerAndrew MacLeod <amacleod@redhat.com>2023-06-09 20:33:03 -0400
commitd5818a361779e19b9c17295c6a014c4145c73937 (patch)
tree7ea95c6d6af4ad6d4d44ceb3729c586fa1dd70ae /gcc/range-op-mixed.h
parenta1aaaff33a79d1b7613fbf8a17b51321a135f19c (diff)
downloadgcc-d5818a361779e19b9c17295c6a014c4145c73937.zip
gcc-d5818a361779e19b9c17295c6a014c4145c73937.tar.gz
gcc-d5818a361779e19b9c17295c6a014c4145c73937.tar.bz2
Unify MINUS_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_minus): Remove. Move prototypes to range-op-mixed.h (operator_minus::fold_range): Rename from foperator_minus. (operator_minus::op1_range): Ditto. (operator_minus::op2_range): Ditto. (operator_minus::rv_fold): Ditto. (float_table::float_table): Remove MINUS_EXPR. * range-op-mixed.h (class operator_minus): Combined from integer and float files. * range-op.cc (op_minus): New object. (unified_table::unified_table): Add MINUS_EXPR. (class operator_minus): Move to range-op-mixed.h. (integral_table::integral_table): Remove MINUS_EXPR. (pointer_table::pointer_table): Remove MINUS_EXPR.
Diffstat (limited to 'gcc/range-op-mixed.h')
-rw-r--r--gcc/range-op-mixed.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h
index a942808..520ec19 100644
--- a/gcc/range-op-mixed.h
+++ b/gcc/range-op-mixed.h
@@ -388,4 +388,46 @@ private:
const wide_int &rh_ub) const final override;
};
+
+class operator_minus : public range_operator
+{
+public:
+ using range_operator::fold_range;
+ using range_operator::op1_range;
+ using range_operator::op2_range;
+ using range_operator::lhs_op1_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;
+ bool op1_op2_relation_effect (irange &lhs_range, tree type,
+ const irange &op1_range,
+ const irange &op2_range,
+ 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