This is the mail archive of the
mailing list for the GCC project.
Re: The nvptx port [7/11+] Inform the port about call arguments
- From: Jeff Law <law at redhat dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 21 Oct 2014 21:11:28 +0000
- Subject: Re: The nvptx port [7/11+] Inform the port about call arguments
- Authentication-results: sourceware.org; auth=none
- References: <54451994 dot 9070209 at codesourcery dot com> <54451C57 dot 5020705 at codesourcery dot com>
On 10/20/14 14:29, Bernd Schmidt wrote:
How exactly do you need to decorate? Just mention the register, size
information or do you need full type information?
In ptx assembly we need to decorate call insns with the arguments that
are being passed. We also need to know the exact function type. This is
kind of hard to do with the existing infrastructure since things like
function_arg are called at other times rather than just when emitting a
call, so this patch adds two more hooks, one called just before argument
registers are loaded (once for each arg), and the other just after the
call is complete.
* target.def (call_args, end_call_args): New hooks.
* hooks.c (hook_void_rtx_tree): New empty function.
* hooks.h (hook_void_rtx_tree): Declare.
* doc/tm.texi.in (TARGET_CALL_ARGS, TARGET_END_CALL_ARGS): Add.
* doc/tm.texi: Regenerate.
* calls.c (expand_call): Slightly rearrange the code. Use the two new
(expand_library_call_value_1): Use the two new hooks.
We've had targets where we had to indicate register banks for each
argument. Those would walk CALL_INSN_FUNCTION_USAGE to find the
argument registers, then from the register # we would know which
register bank to use. Would that work for you?