Re: [PATCH] gimple-isel: handle x CMP y ? z : 0

2022-05-04 Thread Richard Biener via Gcc-patches
On Wed, 4 May 2022, Richard Earnshaw wrote: > > > On 04/05/2022 12:14, Richard Biener wrote: > > On Wed, May 4, 2022 at 12:16 PM Richard Earnshaw via Gcc-patches > > wrote: > >> > >> > >> Gimple isel already handles x CMP y ? -1 : 0 when lowering vector cond > >> operations, but this can be gen

Re: [PATCH] gimple-isel: handle x CMP y ? z : 0

2022-05-04 Thread Richard Earnshaw via Gcc-patches
On 04/05/2022 12:14, Richard Biener wrote: On Wed, May 4, 2022 at 12:16 PM Richard Earnshaw via Gcc-patches wrote: Gimple isel already handles x CMP y ? -1 : 0 when lowering vector cond operations, but this can be generalized further when the comparison forms a natural mask so that we can

Re: [PATCH] gimple-isel: handle x CMP y ? z : 0

2022-05-04 Thread Richard Biener via Gcc-patches
On Wed, May 4, 2022 at 12:16 PM Richard Earnshaw via Gcc-patches wrote: > > > Gimple isel already handles x CMP y ? -1 : 0 when lowering vector cond > operations, but this can be generalized further when the comparison > forms a natural mask so that we can also handle x CMP y ? z : 0 by > transfor

[PATCH] gimple-isel: handle x CMP y ? z : 0

2022-05-04 Thread Richard Earnshaw via Gcc-patches
Gimple isel already handles x CMP y ? -1 : 0 when lowering vector cond operations, but this can be generalized further when the comparison forms a natural mask so that we can also handle x CMP y ? z : 0 by transforming it into (x CMP y) & z. This will, in most cases save having to load a register