diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-10 17:06:36 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-12 10:51:09 -0400 |
commit | 5410b07a8c3c2ed0e8d6202c898df5ed4cf58494 (patch) | |
tree | f92aa6ba359de99cdc45bfbe97b601a9e928b0e5 /gcc/range-op.cc | |
parent | 1b1de36ac83eff7ab8bd9fc379516d723f620a2e (diff) | |
download | gcc-5410b07a8c3c2ed0e8d6202c898df5ed4cf58494.zip gcc-5410b07a8c3c2ed0e8d6202c898df5ed4cf58494.tar.gz gcc-5410b07a8c3c2ed0e8d6202c898df5ed4cf58494.tar.bz2 |
Provide interface for non-standard operators.
THis removes the hack introduced for WIDEN_MULT which exported a pointer
to the operator and the gimple-range-op.cc set the operator to this
pointer whenn it was appropriate.
Instead, we simple change the range-op table to be unsigned indexed,
and add new opcodes to the end of the table, allowing them to be indexed
directly via range_op_handler::range_op.
* gimple-range-op.cc (gimple_range_op_handler::maybe_non_standard):
Use range_op_handler directly.
* range-op.cc (range_op_handler::range_op_handler): Unsigned
param instead of tree-code.
(ptr_op_widen_plus_signed): Delete.
(ptr_op_widen_plus_unsigned): Delete.
(ptr_op_widen_mult_signed): Delete.
(ptr_op_widen_mult_unsigned): Delete.
(range_op_table::initialize_integral_ops): Add new opcodes.
* range-op.h (range_op_handler): Use unsigned.
(OP_WIDEN_MULT_SIGNED): New.
(OP_WIDEN_MULT_UNSIGNED): New.
(OP_WIDEN_PLUS_SIGNED): New.
(OP_WIDEN_PLUS_UNSIGNED): New.
(RANGE_OP_TABLE_SIZE): New.
(range_op_table::operator []): Use unsigned.
(range_op_table::set): Use unsigned.
(m_range_tree): Make unsigned.
(ptr_op_widen_mult_signed): Remove.
(ptr_op_widen_mult_unsigned): Remove.
(ptr_op_widen_plus_signed): Remove.
(ptr_op_widen_plus_unsigned): Remove.
Diffstat (limited to 'gcc/range-op.cc')
-rw-r--r-- | gcc/range-op.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/range-op.cc b/gcc/range-op.cc index a271e00..8a661fd 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -135,7 +135,7 @@ range_op_handler::range_op_handler () // Create a range_op_handler for CODE. Use a default operatoer if CODE // does not have an entry. -range_op_handler::range_op_handler (tree_code code) +range_op_handler::range_op_handler (unsigned code) { m_operator = operator_table[code]; if (!m_operator) @@ -1726,7 +1726,6 @@ public: const wide_int &rh_lb, const wide_int &rh_ub) const; } op_widen_plus_signed; -range_operator *ptr_op_widen_plus_signed = &op_widen_plus_signed; void operator_widen_plus_signed::wi_fold (irange &r, tree type, @@ -1760,7 +1759,6 @@ public: const wide_int &rh_lb, const wide_int &rh_ub) const; } op_widen_plus_unsigned; -range_operator *ptr_op_widen_plus_unsigned = &op_widen_plus_unsigned; void operator_widen_plus_unsigned::wi_fold (irange &r, tree type, @@ -2184,7 +2182,6 @@ public: const wide_int &rh_ub) const; } op_widen_mult_signed; -range_operator *ptr_op_widen_mult_signed = &op_widen_mult_signed; void operator_widen_mult_signed::wi_fold (irange &r, tree type, @@ -2217,7 +2214,6 @@ public: const wide_int &rh_ub) const; } op_widen_mult_unsigned; -range_operator *ptr_op_widen_mult_unsigned = &op_widen_mult_unsigned; void operator_widen_mult_unsigned::wi_fold (irange &r, tree type, @@ -4298,6 +4294,11 @@ range_op_table::initialize_integral_ops () set (IMAGPART_EXPR, op_unknown); set (REALPART_EXPR, op_unknown); set (ABSU_EXPR, op_absu); + set (OP_WIDEN_MULT_SIGNED, op_widen_mult_signed); + set (OP_WIDEN_MULT_UNSIGNED, op_widen_mult_unsigned); + set (OP_WIDEN_PLUS_SIGNED, op_widen_plus_signed); + set (OP_WIDEN_PLUS_UNSIGNED, op_widen_plus_unsigned); + } #if CHECKING_P |