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: PR40900, extending call patterns


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


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