ovember 18, 2020 11:33 AM
To: Richard Biener ; Eugene Rozenfeld
Cc: gcc-patches@gcc.gnu.org
Subject: [EXTERNAL] Re: [PATCH] [tree-optimization] Optimize two patterns with
three xors.
On 11/17/20 12:57 AM, Richard Biener via Gcc-patches wrote:
> On Tue, Nov 17, 2020 at 3:19 AM Eugene Rozenf
On 11/17/20 12:57 AM, Richard Biener via Gcc-patches wrote:
> On Tue, Nov 17, 2020 at 3:19 AM Eugene Rozenfeld
> wrote:
>> Thank you for the review Richard!
>>
>> I re-worked the patch based on your suggestions (attached).
>> I made the change to reuse the first bit_xor in both patterns and I a
x27;s correct.
The patch is OK.
Thanks,
Richard.
> Eugene
>
> -Original Message-
> From: Richard Biener
> Sent: Monday, November 16, 2020 4:11 AM
> To: Eugene Rozenfeld
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] [tree-optimization] Optimize two pattern
: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] [tree-optimization] Optimize two patterns with three xors.
On Thu, Nov 12, 2020 at 2:53 AM Eugene Rozenfeld via Gcc-patches
wrote:
>
> Simplify (a ^ b) & ((b ^ c) ^ a) --> (a ^ b) & ~c.
>
> int f(int a, int b, int c)
> {
>
On Thu, Nov 12, 2020 at 2:53 AM Eugene Rozenfeld via Gcc-patches
wrote:
>
> Simplify (a ^ b) & ((b ^ c) ^ a) --> (a ^ b) & ~c.
>
> int f(int a, int b, int c)
> {
> return (a ^ b) & ((b ^ c) ^ a);
> }
>
> Code without the patch:
> moveax,edx
> xoreax,esi
> xoreax,edi
> xoredi,es
Simplify (a ^ b) & ((b ^ c) ^ a) --> (a ^ b) & ~c.
int f(int a, int b, int c)
{
return (a ^ b) & ((b ^ c) ^ a);
}
Code without the patch:
moveax,edx
xoreax,esi
xoreax,edi
xoredi,esi
andeax,edi
ret
Code with the patch:
xoredi,esi
andn eax,edx,edi
ret
Simplify (a