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: [PING][AARCH64, Question] Does AARCH64 GCC support long calls?


On Fri, Oct 24, 2014 at 11:28 PM, Yangfei (Felix) <felix.yang@huawei.com> wrote:
>> On Fri, Oct 24, 2014 at 8:35 PM, Yangfei (Felix) <felix.yang@huawei.com> wrote:
>> >> Hi,
>> >>
>> >>     I find that the -mlong-calls option is not there for AARCH64. So
>> >> can this port generate long calls?
>> >>     Any plan on this option? I would like to have a try on this if it's missing :-)
>> >>     Thanks.
>> >
>> >
>> > Any comments?
>>
>> Yes you can use -mcmodel=large to this effect I think.
>>
>> Thanks,
>> Andrew Pinski
>
>
> Thanks for the reply.  It seems that -mcmodel=large is different from -mlong-calls.
> GCC still emit the BL instruction with -mcmodel=large.  I thinks GCC should emit BLR instruction with -mlong-calls, right?


Oh right.  Also it looks like it is not hooked up but the support is
partly there:
/* Return true if calls to DECL should be treated as
   long-calls (ie called via a register).  */
static bool
aarch64_decl_is_long_call_p (const_tree decl ATTRIBUTE_UNUSED)
{
  return false;
}

I had added the attribute in a version for this and the users of the
toolchain has not reported a bug about it so it seems like it is
working.
I don't have time right now to add support for the option or port the
attribute to the latest version but it should be easy as returning
true from that function when the option is turned on.

Thanks,
Andrew Pinski

>
> void test();
> int main()
> {
>         test();
> }
>
> Assembly for this main with -mcmodel=large option:
>
> main:
>         stp     x29, x30, [sp, -16]!
>         add     x29, sp, 0
>         bl      test
>         ldp     x29, x30, [sp], 16
>         ret
>


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