return true;
}
-class foperator_gt : public range_operator
-{
- using range_operator::fold_range;
- using range_operator::op1_range;
- using range_operator::op2_range;
- using range_operator::op1_op2_relation;
-public:
- bool fold_range (irange &r, tree type,
- const frange &op1, const frange &op2,
- relation_trio = TRIO_VARYING) const final override;
- relation_kind op1_op2_relation (const irange &lhs) const final override
- {
- return gt_op1_op2_relation (lhs);
- }
- bool op1_range (frange &r, tree type,
- const irange &lhs, const frange &op2,
- relation_trio = TRIO_VARYING) const final override;
- bool op2_range (frange &r, tree type,
- const irange &lhs, const frange &op1,
- relation_trio = TRIO_VARYING) const final override;
-} fop_gt;
-
bool
-foperator_gt::fold_range (irange &r, tree type,
- const frange &op1, const frange &op2,
- relation_trio rel) const
+operator_gt::fold_range (irange &r, tree type,
+ const frange &op1, const frange &op2,
+ relation_trio rel) const
{
if (frelop_early_resolve (r, type, op1, op2, rel, VREL_GT))
return true;
}
bool
-foperator_gt::op1_range (frange &r,
- tree type,
- const irange &lhs,
- const frange &op2,
- relation_trio) const
+operator_gt::op1_range (frange &r,
+ tree type,
+ const irange &lhs,
+ const frange &op2,
+ relation_trio) const
{
switch (get_bool_state (r, lhs, type))
{
}
bool
-foperator_gt::op2_range (frange &r,
- tree type,
- const irange &lhs,
- const frange &op1,
- relation_trio) const
+operator_gt::op2_range (frange &r,
+ tree type,
+ const irange &lhs,
+ const frange &op1,
+ relation_trio) const
{
switch (get_bool_state (r, lhs, type))
{
op1_no_nan.clear_nan ();
if (op2.maybe_isnan ())
op2_no_nan.clear_nan ();
- if (!fop_gt.fold_range (r, type, op1_no_nan, op2_no_nan, rel))
+ if (!range_op_handler (GT_EXPR).fold_range (r, type, op1_no_nan,
+ op2_no_nan, rel))
return false;
// The result is the same as the ordered version when the
// comparison is true or when the operands cannot be NANs.
// All the relational operators are expected to work, because the
// calculation of ranges on outgoing edges expect the handlers to be
// present.
- set (GT_EXPR, fop_gt);
set (GE_EXPR, fop_ge);
set (ABS_EXPR, fop_abs);
void update_bitmask (irange &r, const irange &lh,
const irange &rh) const final override;
};
+
+class operator_gt : public range_operator
+{
+public:
+ using range_operator::fold_range;
+ using range_operator::op1_range;
+ using range_operator::op2_range;
+ using range_operator::op1_op2_relation;
+ bool fold_range (irange &r, tree type,
+ const irange &op1, const irange &op2,
+ relation_trio = TRIO_VARYING) const;
+ bool fold_range (irange &r, tree type,
+ const frange &op1, const frange &op2,
+ relation_trio = TRIO_VARYING) const final override;
+
+ bool op1_range (irange &r, tree type,
+ const irange &lhs, const irange &op2,
+ relation_trio = TRIO_VARYING) const;
+ bool op1_range (frange &r, tree type,
+ const irange &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 = TRIO_VARYING) const;
+ bool op2_range (frange &r, tree type,
+ const irange &lhs, const frange &op1,
+ relation_trio = TRIO_VARYING) const final override;
+ relation_kind op1_op2_relation (const irange &lhs) const final override;
+ void update_bitmask (irange &r, const irange &lh, const irange &rh) const;
+};
#endif // GCC_RANGE_OP_MIXED_H
operator_not_equal op_not_equal;
operator_lt op_lt;
operator_le op_le;
+operator_gt op_gt;
// Invoke the initialization routines for each class of range.
set (NE_EXPR, op_not_equal);
set (LT_EXPR, op_lt);
set (LE_EXPR, op_le);
+ set (GT_EXPR, op_gt);
}
// The tables are hidden and accessed via a simple extern function.
}
-class operator_gt : public range_operator
+void
+operator_gt::update_bitmask (irange &r, const irange &lh,
+ const irange &rh) const
{
- using range_operator::fold_range;
- using range_operator::op1_range;
- using range_operator::op2_range;
- using range_operator::op1_op2_relation;
-public:
- virtual bool fold_range (irange &r, tree type,
- const irange &op1,
- const irange &op2,
- relation_trio = TRIO_VARYING) const;
- virtual bool op1_range (irange &r, tree type,
- const irange &lhs,
- const irange &op2,
- relation_trio = TRIO_VARYING) const;
- virtual bool op2_range (irange &r, tree type,
- const irange &lhs,
- const irange &op1,
- relation_trio = TRIO_VARYING) const;
- virtual relation_kind op1_op2_relation (const irange &lhs) const;
- void update_bitmask (irange &r, const irange &lh, const irange &rh) const
- { update_known_bitmask (r, GT_EXPR, lh, rh); }
-} op_gt;
+ update_known_bitmask (r, GT_EXPR, lh, rh);
+}
// Check if the LHS range indicates a relation between OP1 and OP2.
relation_kind
-gt_op1_op2_relation (const irange &lhs)
+operator_gt::op1_op2_relation (const irange &lhs) const
{
if (lhs.undefined_p ())
return VREL_UNDEFINED;
return VREL_VARYING;
}
-relation_kind
-operator_gt::op1_op2_relation (const irange &lhs) const
-{
- return gt_op1_op2_relation (lhs);
-}
-
-
bool
operator_gt::fold_range (irange &r, tree type,
const irange &op1, const irange &op2,
\f
integral_table::integral_table ()
{
- set (GT_EXPR, op_gt);
set (GE_EXPR, op_ge);
set (PLUS_EXPR, op_plus);
set (MINUS_EXPR, op_minus);
set (MIN_EXPR, op_ptr_min_max);
set (MAX_EXPR, op_ptr_min_max);
- set (GT_EXPR, op_gt);
set (GE_EXPR, op_ge);
set (SSA_NAME, op_ident);
set (INTEGER_CST, op_integer_cst);
wide_int &mustbe_nonzero);
// op1_op2_relation methods that are the same across irange and frange.
-relation_kind gt_op1_op2_relation (const irange &lhs);
relation_kind ge_op1_op2_relation (const irange &lhs);
// This implements the range operator tables as local objects.