RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-11-04 Thread Richard Biener via Gcc-patches
On Wed, 3 Nov 2021, Tamar Christina wrote: > Hi, > > I have addressed all the feedback and updated patch attached: > > Bootstrapped Regtested on aarch64-none-linux-gnu, > x86_64-pc-linux-gnu and no regressions. > > Ok for master? > > Thanks, > Tamar > > gcc/ChangeLog: > > * match.pd: N

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-11-03 Thread Tamar Christina via Gcc-patches
Hi, I have addressed all the feedback and updated patch attached: Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu and no regressions. Ok for master? Thanks, Tamar gcc/ChangeLog: * match.pd: New negate+shift pattern. gcc/testsuite/ChangeLog: * gcc.dg/sig

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-15 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Friday, October 15, 2021 10:07 AM > To: Tamar Christina > Cc: Richard Earnshaw ; gcc- > patc...@gcc.gnu.org; nd > Subject: RE: [PATCH]middle-end convert negate + right shift into compare > greater. > &

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-15 Thread Richard Biener via Gcc-patches
On Fri, 15 Oct 2021, Richard Earnshaw wrote: > On 15/10/2021 10:06, Richard Biener via Gcc-patches wrote: > > On Fri, 15 Oct 2021, Tamar Christina wrote: > > > > +/* Fold (-x >> C) into x > 0 where C = precision(type) - 1. */ (for > +cst (INTEGER_CST VECTOR_CST) (simplify >

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-15 Thread Richard Earnshaw via Gcc-patches
On 15/10/2021 10:06, Richard Biener via Gcc-patches wrote: On Fri, 15 Oct 2021, Tamar Christina wrote: +/* Fold (-x >> C) into x > 0 where C = precision(type) - 1. */ (for +cst (INTEGER_CST VECTOR_CST) (simplify + (rshift (negate:s @0) cst@1) + (if (!flag_wrapv) Don't test flag_wrapv di

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-15 Thread Richard Biener via Gcc-patches
On Fri, 15 Oct 2021, Tamar Christina wrote: > > > > > > +/* Fold (-x >> C) into x > 0 where C = precision(type) - 1. */ (for > > > +cst (INTEGER_CST VECTOR_CST) (simplify > > > + (rshift (negate:s @0) cst@1) > > > + (if (!flag_wrapv) > > > > Don't test flag_wrapv directly, instead use the ap

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-15 Thread Tamar Christina via Gcc-patches
> > > > +/* Fold (-x >> C) into x > 0 where C = precision(type) - 1. */ (for > > +cst (INTEGER_CST VECTOR_CST) (simplify > > + (rshift (negate:s @0) cst@1) > > + (if (!flag_wrapv) > > Don't test flag_wrapv directly, instead use the appropriate > TYPE_OVERFLOW_{UNDEFINED,WRAPS} predicates. Bu

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-13 Thread Richard Biener via Gcc-patches
On Mon, 11 Oct 2021, Tamar Christina wrote: > Hi all, > > Here's a new version of the patch. > > > >>> " If an exceptional condition occurs during the evaluation of an > > >>> expression > > >> (that is, if the result is not mathematically defined or not in the > > >> range of representable valu

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-11 Thread Tamar Christina via Gcc-patches
Hi all, Here's a new version of the patch. > >>> " If an exceptional condition occurs during the evaluation of an > >>> expression > >> (that is, if the result is not mathematically defined or not in the > >> range of representable values for its type), the behavior is undefined." > >>> > >>> So

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-07 Thread Richard Earnshaw via Gcc-patches
compare greater. On 05/10/2021 14:49, Tamar Christina wrote: -Original Message- From: Richard Earnshaw Sent: Tuesday, October 5, 2021 2:34 PM To: Tamar Christina ; gcc-patches@gcc.gnu.org Cc: nd ; rguent...@suse.de Subject: Re: [PATCH]middle-end convert negate + right shift into compare

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Earnshaw > Sent: Tuesday, October 5, 2021 2:52 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end convert negate + right shift into compare > greater. > > >

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Richard Earnshaw via Gcc-patches
On 05/10/2021 14:49, Tamar Christina wrote: -Original Message- From: Richard Earnshaw Sent: Tuesday, October 5, 2021 2:34 PM To: Tamar Christina ; gcc-patches@gcc.gnu.org Cc: nd ; rguent...@suse.de Subject: Re: [PATCH]middle-end convert negate + right shift into compare greater

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Earnshaw > Sent: Tuesday, October 5, 2021 2:34 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end convert negate + right shift into compare > greater. > > >

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Richard Earnshaw via Gcc-patches
On 05/10/2021 14:30, Tamar Christina wrote: -Original Message- From: Richard Earnshaw Sent: Tuesday, October 5, 2021 1:56 PM To: Tamar Christina ; gcc-patches@gcc.gnu.org Cc: nd ; rguent...@suse.de Subject: Re: [PATCH]middle-end convert negate + right shift into compare greater

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Earnshaw > Sent: Tuesday, October 5, 2021 1:56 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end convert negate + right shift into compare > greater. > > >

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Richard Earnshaw via Gcc-patches
On 05/10/2021 13:50, Tamar Christina via Gcc-patches wrote: Hi All, This turns an inversion of the sign bit + arithmetic right shift into a comparison with 0. i.e. void fun1(int32_t *x, int n) { for (int i = 0; i < (n & -16); i++) x[i] = (-x[i]) >> 31; } Notwithstanding that I