Thank you Jim for the input,
I need to ,make the changes only to the function args(varargs),hence
making the changes in TARGET_PROMOTE_FUNCTION_MODE will do ?.
one more question ,i do have defined the TARGET_PROMOTE_FUNCTION_MODE
(arm.c) and cross compilling for aarch64 ,but still gcc calls
default_promote_function_node i.e
Breakpoint 2, promote_function_mode (type=0x2aaaaacd3540, mode=DImode,
punsignedp=0x7fffffffd81c, funtype=0x2aaaaab79c78,
for_return=0) at /nobackup/ukalappa/gcc/4.7.0/gcc/gcc/explow.c:781
781 if (type == NULL_TREE)
(gdb) s
779 {
(gdb) s
781 if (type == NULL_TREE)
(gdb) s
791 switch (TREE_CODE (type))
(gdb) s
796 return targetm.calls.promote_function_mode (type, mode,
punsignedp, funtype,
(gdb) s
default_promote_function_mode (type=0x2aaaaacd3540, mode=DImode,
punsignedp=0x7fffffffd81c, funtype=0x2aaaaab79c78,
for_return=0) at /nobackup/ukalappa/gcc/4.7.0/gcc/gcc/targhooks.c:127
127 if (type != NULL_TREE && for_return == 2)
I'm sure ,we are missing something here ,looking for it ,any inputs
will be help us lot .
Thank you
~Umesh
On Tue, Apr 5, 2016 at 5:01 AM, Jim Wilson <[email protected]> wrote:
> On 04/04/2016 08:55 AM, Umesh Kalappa wrote:
>>
>> We are in process of changing the gcc compiler for aarch64 abi ,w.r.t
>> varargs function arguments handling.
>>
>> default(LP64) ,where 1,2,4 bytes args are promoted to word size i.e 4
>> bytes ,we need to change these behaviour to 8 bytes (double word).
>>
>> we are looking both hooks like PROMOTE_MODE and
>> TARGET_PROMOTE_FUNCTION_MODE to make the changes.
>
>
> I think this would work. You just need to promote all modes less than 8
> bytes to DImode, instead of the current code that promotes modes smaller
> than 4 bytes to SImode. You would do this for the default LP64 type system,
> but not for the ILP32 type system.
>
> This would affect all function arguments and locals, which may cause code
> size and/or performance issues. You would have to check for that.
>
> Also, this may prevent linking with any 3rd party code compiled by
> unmodified gcc, or code compiled with other compilers (e.g. LLVM), because
> changing TARGET_PROMOTE_FUNCTION_MODE can cause ABI changes. You may need to
> check that also.
>
> Jim
>