Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-24 Thread Kewen.Lin
on 2024/7/24 06:53, Andrew Pinski wrote: > On Mon, Jul 22, 2024 at 7:41 PM Kewen.Lin wrote: >> >> Hi Andrew, >> >> on 2024/7/23 08:09, Andrew Pinski wrote: >>> On Sun, Jun 30, 2024 at 11:17 PM Kewen.Lin wrote: Hi, As PR115659 shows, assuming c = x CMP y, there are some fo

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-23 Thread Andrew Pinski
On Mon, Jul 22, 2024 at 7:41 PM Kewen.Lin wrote: > > Hi Andrew, > > on 2024/7/23 08:09, Andrew Pinski wrote: > > On Sun, Jun 30, 2024 at 11:17 PM Kewen.Lin wrote: > >> > >> Hi, > >> > >> As PR115659 shows, assuming c = x CMP y, there are some > >> folding chances for patterns r = c ? 0/z : z/-1:

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-22 Thread Kewen.Lin
Hi Andrew, on 2024/7/23 08:09, Andrew Pinski wrote: > On Sun, Jun 30, 2024 at 11:17 PM Kewen.Lin wrote: >> >> Hi, >> >> As PR115659 shows, assuming c = x CMP y, there are some >> folding chances for patterns r = c ? 0/z : z/-1: >> - For r = c ? 0 : z, it can be folded into r = ~c & z. >> - Fo

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-22 Thread Andrew Pinski
On Sun, Jun 30, 2024 at 11:17 PM Kewen.Lin wrote: > > Hi, > > As PR115659 shows, assuming c = x CMP y, there are some > folding chances for patterns r = c ? 0/z : z/-1: > - For r = c ? 0 : z, it can be folded into r = ~c & z. > - For r = c ? z : -1, it can be folded into r = ~c | z. > > But BI

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-02 Thread Kewen.Lin
Hi! on 2024/7/2 04:28, Segher Boessenkool wrote: > On Mon, Jul 01, 2024 at 04:36:44PM +0200, Richard Biener wrote: >> On Mon, Jul 1, 2024 at 8:17 AM Kewen.Lin wrote: >>> As PR115659 shows, assuming c = x CMP y, there are some >>> folding chances for patterns r = c ? 0/z : z/-1: >>> - For r = c

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-01 Thread Segher Boessenkool
Hi! On Mon, Jul 01, 2024 at 02:17:33PM +0800, Kewen.Lin wrote: > * config/rs6000/rs6000-builtins.def: Update some bif expanders by > replacing orc3 with iorc3. > * config/rs6000/rs6000-string.cc (expand_cmp_vec_sequence): Update gen > function by replacing orc3 with iorc3.

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-01 Thread Segher Boessenkool
On Mon, Jul 01, 2024 at 04:36:44PM +0200, Richard Biener wrote: > On Mon, Jul 1, 2024 at 8:17 AM Kewen.Lin wrote: > > As PR115659 shows, assuming c = x CMP y, there are some > > folding chances for patterns r = c ? 0/z : z/-1: > > - For r = c ? 0 : z, it can be folded into r = ~c & z. > > - Fo

Re: [RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-01 Thread Richard Biener
On Mon, Jul 1, 2024 at 8:17 AM Kewen.Lin wrote: > > Hi, > > As PR115659 shows, assuming c = x CMP y, there are some > folding chances for patterns r = c ? 0/z : z/-1: > - For r = c ? 0 : z, it can be folded into r = ~c & z. > - For r = c ? z : -1, it can be folded into r = ~c | z. > > But BIT_

[RFC/PATCH] isel: Fold more in gimple_expand_vec_cond_expr with andc/iorc

2024-07-01 Thread Kewen.Lin
Hi, As PR115659 shows, assuming c = x CMP y, there are some folding chances for patterns r = c ? 0/z : z/-1: - For r = c ? 0 : z, it can be folded into r = ~c & z. - For r = c ? z : -1, it can be folded into r = ~c | z. But BIT_AND/BIT_IOR applied on one BIT_NOT operand is a compound operatio