Re: Matching and testing against smulhsm3

2020-02-22 Thread Segher Boessenkool
Hi! On Mon, Feb 17, 2020 at 09:54:58PM +0100, Marcus Geelnard wrote: > On 2020-02-17 02:12, Segher Boessenkool wrote: > >>Trying 10, 9 -> 11: > >>Failed to match this instruction: > >>(set (reg:SI 84) > >> (mult:SI (sign_extend:SI (subreg:HI (reg:SI 87) 0)) > >> (sign_extend:SI (subreg

Re: Matching and testing against smulhsm3

2020-02-17 Thread Marcus Geelnard
Hi Segher, Thanks for the analysis! On 2020-02-17 02:12, Segher Boessenkool wrote: Hi! On Sun, Feb 16, 2020 at 09:52:12PM +0100, Marcus Geelnard wrote:   (define_insn "smulhshi3"     [(set (match_operand:HI 0 "register_operand" "=r")   (truncate:HI     (ashiftrt:SI   (mu

Re: Matching and testing against smulhsm3

2020-02-16 Thread Segher Boessenkool
Hi! On Sun, Feb 16, 2020 at 09:52:12PM +0100, Marcus Geelnard wrote: >   (define_insn "smulhshi3" >     [(set (match_operand:HI 0 "register_operand" "=r") >   (truncate:HI >     (ashiftrt:SI >   (mult:SI >     (sign_extend:SI (match_operand:HI

Re: Matching and testing against smulhsm3

2020-02-16 Thread Marcus Geelnard
On 2020-02-09 19:02, Segher Boessenkool wrote: On Sun, Feb 09, 2020 at 12:15:03PM +0100, m wrote: On 2020-02-07 16:44, Segher Boessenkool wrote:   (define_insn "smulhshi3"     [(set (match_operand:HI 0 "register_operand" "=r")   (truncate:HI     (ashiftrt:SI   (mult:SI    

Re: Matching and testing against smulhsm3

2020-02-09 Thread Segher Boessenkool
On Sun, Feb 09, 2020 at 12:15:03PM +0100, m wrote: > On 2020-02-07 16:44, Segher Boessenkool wrote: > >>   (define_insn "smulhshi3" > >>     [(set (match_operand:HI 0 "register_operand" "=r") > >>   (truncate:HI > >>     (ashiftrt:SI > >>   (mult:SI > >>     (sign_extend:SI

Re: Matching and testing against smulhsm3

2020-02-09 Thread m
On 2020-02-07 16:44, Segher Boessenkool wrote: Hi! On Fri, Feb 07, 2020 at 03:41:25PM +0100, m wrote: ...so I tried to write a corresponding matching pattern, like so:   (define_insn "smulhshi3"     [(set (match_operand:HI 0 "register_operand" "=r")   (truncate:HI     (ashiftrt:SI

Re: Matching and testing against smulhsm3

2020-02-07 Thread Segher Boessenkool
Hi! On Fri, Feb 07, 2020 at 03:41:25PM +0100, m wrote: > ...so I tried to write a corresponding matching pattern, like so: > >   (define_insn "smulhshi3" >     [(set (match_operand:HI 0 "register_operand" "=r") >   (truncate:HI >     (ashiftrt:SI >   (mult:SI >     (sign_e

Matching and testing against smulhsm3

2020-02-07 Thread m
Hello! I am trying to implement the following insns for my back end: smulhssi3, smulhshi3, smulhsqi3 According to [1], the operation should be equivalent to:   narrow op0, op1, op2;   op0 = (narrow) (((wide) op1 * (wide) op2) >> (N / 2 - 1)); ...so I tried to write a corresponding matching p