Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-04-01 Thread Richard Henderson via Gcc-patches
On 4/1/20 9:28 AM, Richard Sandiford wrote: > How important is it to describe the flags operation as a compare though? > Could we instead use an unspec with three inputs, and keep it as :CC? > That would still allow special-case matching for zero operands. I'm not sure. My guess is that the only

Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-04-01 Thread Richard Sandiford
Richard Henderson writes: > On 3/31/20 11:34 AM, Richard Sandiford wrote: >>> +(define_insn "*cmp3_carryinC" >>> + [(set (reg:CC CC_REGNUM) >>> + (compare:CC >>> + (ANY_EXTEND: >>> + (match_operand:GPI 0 "register_operand" "r")) >>> + (plus: >>> + (ANY_EXTEND: >>> +

Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-04-01 Thread Segher Boessenkool
On Tue, Mar 31, 2020 at 03:44:51PM -0700, Richard Henderson wrote: > If we add more CC modes, does that mean that we have to improve SELECT_CC_MODE > to match those patterns? Or do we add new CC modes just so that combine's use > of SELECT_CC_MODE *cannot* match them? Adding new CC modes isn't

Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-03-31 Thread Richard Henderson via Gcc-patches
On 3/31/20 11:34 AM, Richard Sandiford wrote: >> +(define_insn "*cmp3_carryinC" >> + [(set (reg:CC CC_REGNUM) >> +(compare:CC >> + (ANY_EXTEND: >> +(match_operand:GPI 0 "register_operand" "r")) >> + (plus: >> +(ANY_EXTEND: >> + (match_operand:GPI 1

Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-03-31 Thread Richard Sandiford
Richard Henderson writes: > Duplicate all usub_*_carryinC, but use xzr for the output when we > only require the flags output. The signed versions use sign_extend > instead of zero_extend for combine's benefit. > > These will be used shortly for TImode comparisons. > > *

Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-03-22 Thread Richard Henderson via Gcc-patches
On 3/22/20 12:30 PM, Segher Boessenkool wrote: > Hi! > > On Fri, Mar 20, 2020 at 07:42:25PM -0700, Richard Henderson via Gcc-patches > wrote: >> Duplicate all usub_*_carryinC, but use xzr for the output when we >> only require the flags output. The signed versions use sign_extend >> instead of

Re: [PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-03-22 Thread Segher Boessenkool
Hi! On Fri, Mar 20, 2020 at 07:42:25PM -0700, Richard Henderson via Gcc-patches wrote: > Duplicate all usub_*_carryinC, but use xzr for the output when we > only require the flags output. The signed versions use sign_extend > instead of zero_extend for combine's benefit. You actually use

[PATCH v2 3/9] aarch64: Add cmp_*_carryinC patterns

2020-03-20 Thread Richard Henderson via Gcc-patches
Duplicate all usub_*_carryinC, but use xzr for the output when we only require the flags output. The signed versions use sign_extend instead of zero_extend for combine's benefit. These will be used shortly for TImode comparisons. * config/aarch64/aarch64.md (cmp3_carryinC): New.