Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-21 Thread Chung-Lin Tang
On 2011/3/18 12:18 AM, Richard Henderson wrote: > On 03/16/2011 06:55 PM, Chung-Lin Tang wrote: >> You have to use DeMorgan's Law to distribute the ~ operator: > > Duh. Not sure where my head was yesterday. > > Let's enhance the comment for someone else having an off day. Perhaps > > /*

Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-17 Thread Richard Henderson
On 03/16/2011 06:55 PM, Chung-Lin Tang wrote: > You have to use DeMorgan's Law to distribute the ~ operator: Duh. Not sure where my head was yesterday. Let's enhance the comment for someone else having an off day. Perhaps /* Given (xor (and A B) C), using P^Q == ~P&Q | ~Q&P and DeMorga

Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-16 Thread Chung-Lin Tang
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 simpli

Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-16 Thread Richard Henderson
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 do

Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-12 Thread Chung-Lin Tang
On 2011/3/11 10:14 PM, Chung-Lin Tang wrote: > Hi, > this patch adds a bit more sophistication to the handled xor RTX cases > in foo(). > > This may look a bit ad hoc, but I am seeing it useful for some cases > where we combine zero_extend with (not (shift ...)). The supplied ARM > testcase demon

[patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-11 Thread Chung-Lin Tang
Hi, this patch adds a bit more sophistication to the handled xor RTX cases in foo(). This may look a bit ad hoc, but I am seeing it useful for some cases where we combine zero_extend with (not (shift ...)). The supplied ARM testcase demonstrates when 3-insn combining comes up with: (set (reg:SI 1