[PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-11-22 Thread HAO CHEN GUI via Gcc-patches
Hi, There is a new insn on my target, which has a nested if_then_else and set -1, 0 and 1 according to a comparison. [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y") (const_int 0))

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-11-23 Thread Richard Biener via Gcc-patches
On Wed, Nov 23, 2022 at 8:09 AM HAO CHEN GUI via Gcc-patches wrote: > > Hi, > There is a new insn on my target, which has a nested if_then_else and > set -1, 0 and 1 according to a comparison. > >[(set (match_operand:SI 0 "gpc_reg_operand" "=r") > (if_then_else:SI (lt (match_operand

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-11-23 Thread HAO CHEN GUI via Gcc-patches
Hi Richard, 在 2022/11/24 4:06, Richard Biener 写道: > Wouldn't we usually either add an optab or try to recog a canonical > RTL form instead of adding a new target hook for things like this? Thanks so much for your comments. Please let me make it clear. Do you mean we should create an optab for "

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-11-24 Thread Richard Biener via Gcc-patches
On Thu, Nov 24, 2022 at 8:25 AM HAO CHEN GUI wrote: > > Hi Richard, > > > 在 2022/11/24 4:06, Richard Biener 写道: > > Wouldn't we usually either add an optab or try to recog a canonical > > RTL form instead of adding a new target hook for things like this? > > Thanks so much for your comments. Pleas

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-12-01 Thread Hans-Peter Nilsson
On Wed, 23 Nov 2022, HAO CHEN GUI via Gcc-patches wrote: > diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi > index 92bda1a7e14..9823eccbe68 100644 > --- a/gcc/doc/tm.texi > +++ b/gcc/doc/tm.texi > @@ -7094,6 +7094,15 @@ the @code{POLY_VALUE_MIN}, @code{POLY_VALUE_MAX} and > implementation returns

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-12-01 Thread HAO CHEN GUI via Gcc-patches
Hi Nilsson, 在 2022/12/2 10:49, Hans-Peter Nilsson 写道: > On Wed, 23 Nov 2022, HAO CHEN GUI via Gcc-patches wrote: > >> diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi >> index 92bda1a7e14..9823eccbe68 100644 >> --- a/gcc/doc/tm.texi >> +++ b/gcc/doc/tm.texi >> @@ -7094,6 +7094,15 @@ the @code{POLY_

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-12-06 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Thu, Nov 24, 2022 at 8:25 AM HAO CHEN GUI wrote: >> >> Hi Richard, >> >> >> 在 2022/11/24 4:06, Richard Biener 写道: >> > Wouldn't we usually either add an optab or try to recog a canonical >> > RTL form instead of adding a new target hook for things like

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-12-06 Thread Segher Boessenkool
Hi! On Thu, Nov 24, 2022 at 11:24:15AM +0100, Richard Biener wrote: > On Thu, Nov 24, 2022 at 8:25 AM HAO CHEN GUI wrote: > > 在 2022/11/24 4:06, Richard Biener 写道: > > > Wouldn't we usually either add an optab or try to recog a canonical > > > RTL form instead of adding a new target hook for thin