Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-20 Thread Richard Henderson
On 07/20/2011 04:12 AM, Georg-Johann Lay wrote: > Johann > > PR target/36467 > PR target/49687 > * config/avr/avr.md (mulhi3): Use register_or_s9_operand for > operand2 and expand appropriately if there is a CONST_INT in > operand2. > (usmulqihi3): New insn. >

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-20 Thread Georg-Johann Lay
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01411.html Richard Henderson wrote: > On 07/18/2011 08:41 AM, Georg-Johann Lay wrote: >> +(define_insn_and_split "*muluqihi3.uconst" >> + [(set (match_operand:HI 0 "register_operand" "=r") >> +(mult:HI (zero_extend:HI (m

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-19 Thread Richard Henderson
On 07/19/2011 03:21 AM, Georg-Johann Lay wrote: >> Yes, it is sad that the backends have to work around the fact >> that sign/zero_extension of constants is invalid rtl. > > Why is that invalid? > > (set (reg:HI A) > (const_int 1000)) > > (set (reg:SI B) > (mult:SI (zero_extend:SI (reg

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-19 Thread Georg-Johann Lay
Vladimir Makarov wrote: > On 07/19/2011 04:13 AM, Georg-Johann Lay wrote: >> Vladimir Makarov wrote: >>> On 07/18/2011 04:14 PM, Richard Henderson wrote: On 07/18/2011 12:15 PM, Georg-Johann Lay wrote: >> However, what you've done is try very hard to work around reload >> doing the Rig

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-19 Thread Vladimir Makarov
On 07/19/2011 04:13 AM, Georg-Johann Lay wrote: Vladimir Makarov wrote: On 07/18/2011 04:14 PM, Richard Henderson wrote: On 07/18/2011 12:15 PM, Georg-Johann Lay wrote: However, what you've done is try very hard to work around reload doing the Right Thing with constant spilling, namely re-gene

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-19 Thread Georg-Johann Lay
Richard Henderson wrote: > On 07/18/2011 08:41 AM, Georg-Johann Lay wrote: >> +(define_insn_and_split "*muluqihi3.uconst" >> + [(set (match_operand:HI 0 "register_operand" "=r") >> +(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" >> "r")) >> +

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-19 Thread Georg-Johann Lay
Richard Henderson wrote: > On 07/18/2011 12:15 PM, Georg-Johann Lay wrote: >> Moreover, I wonder why target-independent code does not already >> catch the situation because the pattern to be generated is just >> an ordinary umulqihi3 widening multiplication. > > Yes, it is sad that the backends ha

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-19 Thread Georg-Johann Lay
Vladimir Makarov wrote: > On 07/18/2011 04:14 PM, Richard Henderson wrote: >> On 07/18/2011 12:15 PM, Georg-Johann Lay wrote: However, what you've done is try very hard to work around reload doing the Right Thing with constant spilling, namely re-generate the constant rather than spi

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-18 Thread Vladimir Makarov
On 07/18/2011 04:14 PM, Richard Henderson wrote: On 07/18/2011 12:15 PM, Georg-Johann Lay wrote: However, what you've done is try very hard to work around reload doing the Right Thing with constant spilling, namely re-generate the constant rather than spill and restore it. I cannot believe that

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-18 Thread Richard Henderson
On 07/18/2011 12:15 PM, Georg-Johann Lay wrote: >> However, what you've done is try very hard to work around reload >> doing the Right Thing with constant spilling, namely re-generate >> the constant rather than spill and restore it. I cannot believe >> that's the right way to proceed. > > You me

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-18 Thread Georg-Johann Lay
Richard Henderson schrieb: On 07/18/2011 11:05 AM, Georg-Johann Lay wrote: What's bad with pre-reload splits? The only weak point is in target-independent code because there is nothing like split1_completed and other missing information for better pass-awareness. Nothing's wrong with pre-relo

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-18 Thread Richard Henderson
On 07/18/2011 11:05 AM, Georg-Johann Lay wrote: > What's bad with pre-reload splits? > The only weak point is in target-independent code because there > is nothing like split1_completed and other missing information > for better pass-awareness. Nothing's wrong with pre-reload splits. However, wha

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-18 Thread Georg-Johann Lay
Richard Henderson wrote: > On 07/18/2011 08:41 AM, Georg-Johann Lay wrote: >> +(define_insn_and_split "*muluqihi3.uconst" >> + [(set (match_operand:HI 0 "register_operand" "=r") >> +(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" >> "r")) >> +

Re: [Patch,AVR]: Fix PR36467, PR49687 (better widening mul)

2011-07-18 Thread Richard Henderson
On 07/18/2011 08:41 AM, Georg-Johann Lay wrote: > +(define_insn_and_split "*muluqihi3.uconst" > + [(set (match_operand:HI 0 "register_operand" "=r") > +(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r")) > + (match_operand:HI 2 "u8_