This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][match-and-simplify] Auto-guess conversion types
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2014 14:36:37 +0200 (CEST)
- Subject: Re: [PATCH][match-and-simplify] Auto-guess conversion types
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1408211322420 dot 20733 at zhemvz dot fhfr dot qr>
- Reply-to: gcc-patches at gcc dot gnu dot org
On Thu, 21 Aug 2014, Richard Biener wrote:
+/* From fold_unary. */
+
+/* (T1)(~(T2) X) -> ~(T1) X */
+(simplify
+ (convert (bit_not@0 (convert @1)))
+ (if (INTEGRAL_TYPE_P (type)
+ && INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0))
+ && INTEGRAL_TYPE_P (TREE_TYPE (@1))
+ && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@1)))
+ (bit_not (convert (bit_not @0)))))
There are a lot of bit_not in this line...
I know the patterns themselves aren't your main preoccupation right now,
and I agree that finishing the infrastructure is the priority, but it
seems that the comments are becoming much terser during the move from
fold-const to *.pd. I believe the == could be <=, so I wanted to check the
rationale, and fold-const at least tries to explain the condition. It
would be nice to copy-paste those comments, if the version in fold-const.c
is supposed to disappear.
(if that's planned for later, please ignore my message)
--
Marc Glisse