This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 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:HI C))
              (zero_extend:SI (reg:HI A))))


If a target hat native support for

(set (reg:SI B)
     (mult:SI (zero_extend:SI (reg:HI C))
              (const_int 1000)))

then a combine pattern is straight forward.

If the target has no native support it has to work around
it by means of combine pattern, too, alongside with getting
pseudo resp. clobber reg which is quite tedious as we just see.

There's an own pass for widening multiply detection, IMO it
would be better to detect it there and use combine pattern if there
is native support for widening mul with const.

That's much more straight forward than the current approach of not
recognizing such widening multiplies.

Johann

each and every backend


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]