public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Andrew Macleod <amacleod@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1721] Move operator_bitwise_xor to the unified range-op table. Date: Mon, 12 Jun 2023 15:32:02 +0000 (GMT) [thread overview] Message-ID: <20230612153202.E061A3858D33@sourceware.org> (raw) https://gcc.gnu.org/g:af52b862970b18ac753072337452eca82a77a082 commit r14-1721-gaf52b862970b18ac753072337452eca82a77a082 Author: Andrew MacLeod <amacleod@redhat.com> Date: Sat Jun 10 16:01:05 2023 -0400 Move operator_bitwise_xor to the unified range-op table. * range-op-mixed.h (class operator_bitwise_xor): Move from... * range-op.cc (unified_table::unified_table): Add BIT_XOR_EXPR. (class operator_bitwise_xor): Move from here. (integral_table::integral_table): Remove BIT_XOR_EXPR. (pointer_table::pointer_table): Remove BIT_XOR_EXPR. Diff: --- gcc/range-op-mixed.h | 23 +++++++++++++++++++++++ gcc/range-op.cc | 36 +++++++----------------------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index ba04c51a2d8..644473053e0 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -527,4 +527,27 @@ public: relation_trio rel = TRIO_VARYING) const final override; }; +class operator_bitwise_xor : public range_operator +{ +public: + using range_operator::op1_range; + using range_operator::op2_range; + bool op1_range (irange &r, tree type, + const irange &lhs, const irange &op2, + relation_trio rel = TRIO_VARYING) const final override; + bool op2_range (irange &r, tree type, + const irange &lhs, const irange &op1, + relation_trio rel = TRIO_VARYING) 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; + 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; +}; #endif // GCC_RANGE_OP_MIXED_H diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 107582a9571..11f576c55c5 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -77,6 +77,7 @@ operator_negate op_negate; operator_mult op_mult; operator_addr_expr op_addr; operator_bitwise_not op_bitwise_not; +operator_bitwise_xor op_bitwise_xor; // Invoke the initialization routines for each class of range. @@ -109,6 +110,7 @@ unified_table::unified_table () // integral implementation. set (ADDR_EXPR, op_addr); set (BIT_NOT_EXPR, op_bitwise_not); + set (BIT_XOR_EXPR, op_bitwise_xor); } // The tables are hidden and accessed via a simple extern function. @@ -3732,33 +3734,12 @@ operator_bitwise_or::op2_range (irange &r, tree type, return operator_bitwise_or::op1_range (r, type, lhs, op1); } - -class operator_bitwise_xor : public range_operator +void +operator_bitwise_xor::update_bitmask (irange &r, const irange &lh, + const irange &rh) const { - using range_operator::op1_range; - using range_operator::op2_range; -public: - virtual 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; - virtual bool op1_range (irange &r, tree type, - const irange &lhs, - const irange &op2, - relation_trio rel = TRIO_VARYING) const; - virtual bool op2_range (irange &r, tree type, - const irange &lhs, - const irange &op1, - relation_trio rel = TRIO_VARYING) const; - virtual bool op1_op2_relation_effect (irange &lhs_range, - tree type, - const irange &op1_range, - const irange &op2_range, - relation_kind rel) const; - void update_bitmask (irange &r, const irange &lh, const irange &rh) const - { update_known_bitmask (r, BIT_XOR_EXPR, lh, rh); } -} op_bitwise_xor; + update_known_bitmask (r, BIT_XOR_EXPR, lh, rh); +} void operator_bitwise_xor::wi_fold (irange &r, tree type, @@ -4588,7 +4569,6 @@ integral_table::integral_table () set (MAX_EXPR, op_max); set (BIT_AND_EXPR, op_bitwise_and); set (BIT_IOR_EXPR, op_bitwise_or); - set (BIT_XOR_EXPR, op_bitwise_xor); } // Initialize any integral operators to the primary table @@ -4618,8 +4598,6 @@ pointer_table::pointer_table () set (BIT_IOR_EXPR, op_pointer_or); set (MIN_EXPR, op_ptr_min_max); set (MAX_EXPR, op_ptr_min_max); - - set (BIT_XOR_EXPR, op_bitwise_xor); } // Initialize any pointer operators to the primary table
reply other threads:[~2023-06-12 15:32 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230612153202.E061A3858D33@sourceware.org \ --to=amacleod@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).