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: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.
Yes. And the result you show is quite valid and correct.
What isn't correct is
(zero_extend:HI (const_int 100000))
because const_int does not have a mode, and we no longer
know what the source mode is for the extension.
r~