This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR middle-end/19055, (X | Y) ^ X -> Y & ~X
- From: Jeffrey A Law <law at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 13 Jul 2005 11:07:19 -0600
- Subject: Re: [PATCH] PR middle-end/19055, (X | Y) ^ X -> Y & ~X
- References: <firstname.lastname@example.org>
- Reply-to: law at redhat dot com
On Tue, 2005-07-05 at 09:52 -0400, Andrew Pinski wrote:
> This patch implements a small bit optimization in fold which will help
> targets with a instruction for andc (X & ~ Y) and should not hurt
> which don't have it and that many registers. On X86 if X and Y are not
> afterwards, we actually save 2 bytes in code size. If they are used,
> is no loss.
> OK? Bootstrapped and tested on powerpc-darwin with no regressions.
> Andrew Pinski
> * fold-const.c (fold_binary): Transform "(X | Y) ^ X" to "Y & ~ X".
> * gcc.dg/tree-ssa/pr19055.c: New test.
> * gcc.dg/tree-ssa/pr19055-2.c: New test.
OK for mainline.