This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: PR40900, extending call patterns
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Bernd Schmidt <bernds at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Andrew Pinski <pinskia at gmail dot com>
- Date: Thu, 6 May 2010 09:14:15 +0200
- Subject: Re: Patch: PR40900, extending call patterns
- References: <4BDA2513.9000705@codesourcery.com> <201005010054.17350.ebotcazou@adacore.com> <4BDE99BF.2030303@codesourcery.com> <201005051458.39945.ebotcazou@adacore.com>
On Wed, May 5, 2010 at 14:58, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Seems to be because it's a signed operation, and arm has
>>
>> #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) ? ? \
>> ? if (GET_MODE_CLASS (MODE) == MODE_INT ? ? ? ? \
>> ? ? ? && GET_MODE_SIZE (MODE) < 4) ? ? ? ? ? ? ?\
>> ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ? if (MODE == QImode) ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ? ? UNSIGNEDP = 1; ? ? ? ? ? ? ? ? ? ? ? ? ?\
>> ? ? ? else if (MODE == HImode) ? ? ? ? ? ? ? ? ?\
>> ? ? ? ? UNSIGNEDP = 1; ? ? ? ? ? ? ? ? ? ? ? ? ?\
>> ? ? ? (MODE) = SImode; ? ? ? ? ? ? ? ? ? ? ? ? ?\
>> ? ? }
>>
>> while ppc doesn't modify UNSIGNEDP.
>
> Can't we be clever during RTL expansion and avoid blindly zero-extending the
> value when we known that
>
> ?D.2014_1 = shortv2 ();
>
> and promote_function_mode sign-extends?
Instead I wonder if ppc optimizes something like
unsigned short short2();
unsigned int int1()
{
return short2() & 0xFFFF;
}
This would be caught by Bernd's patch too (presumably).
Paolo