From: Chung-Lin Tang <cltang@codesourcery.com>
To: Richard Henderson <rth@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c
Date: Thu, 17 Mar 2011 01:55:00 -0000 [thread overview]
Message-ID: <4D816A07.1000000@codesourcery.com> (raw)
In-Reply-To: <4D80FFB3.5010806@redhat.com>
On 2011/3/17 03:21 AM, Richard Henderson wrote:
> On 03/11/2011 06:14 AM, Chung-Lin Tang wrote:
>> + /* Given (xor (and A B) C), using P^Q == ~PQ | ~QP (concat as AND),
>> + we can transform (AB)^C into:
>> + A(~CB) | ~AC | ~BC
>> + Attempt a few simplifications when B and C are both constants. */
>
> I don't quite follow the step that gets you to that final form.
>
> P^Q == ~PQ | ~QP
>
> AB ^ C
> == ~(AB)C | (~C)AB
> == (~A)(~B)C | (~C)AB
> == ?
You have to use DeMorgan's Law to distribute the ~ operator:
~(AB)C | (~C)AB
== (~A | ~B)C | A(~CB) // DeMorgan's Law
== ~AC | ~BC | A(~CB) // Distribute C over the |
next prev parent reply other threads:[~2011-03-17 1:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-11 14:14 Chung-Lin Tang
2011-03-12 8:49 ` Chung-Lin Tang
2011-03-16 18:21 ` Richard Henderson
2011-03-17 1:55 ` Chung-Lin Tang [this message]
2011-03-17 15:18 ` Richard Henderson
2011-03-21 7:38 ` Chung-Lin Tang
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=4D816A07.1000000@codesourcery.com \
--to=cltang@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.com \
/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: link
Be 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).