This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, tree-ssa] PR54295 Incorrect value extension in widening multiply-accumulate
On Fri, Aug 17, 2012 at 7:05 PM, Richard Earnshaw <rearnsha@arm.com> wrote:
> On 17/08/12 16:20, Richard Earnshaw wrote:
>> Ok, in which case we have to give is_widening_mult_rhs_p enough smarts
>> to not strip
>>
>> (s32)u32
>>
>> and return u32.
>>
>> I'll have another think about it.
>
> Take two.
>
> This version should address your concerns about handling
>
> (u32)u16 * (u32)u16 -> u64
>
> We now look at each operand directly, but when doing so we check whether
> the operand is the same size as the result or not. When it is, we can
> strip any conversion; when it isn't the conversion must preserve
> signedness of the inner operand and mustn't be a narrowing conversion.
>
> * tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
> New function.
> (is_widening_mult_rhs_p): Use it.
>
> Testing underway (again)
>
> OK?
Ok.
Thanks,
Richard.
> R.
>