This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow more PowerPC sibling calls
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>, dalej at apple dot com, mikestump at comcast dot net
- Date: Mon, 18 Apr 2011 10:29:17 -0700
- Subject: Re: Allow more PowerPC sibling calls
- References: <20110409025146.GF19002@bubble.grove.modra.org>
On Sat, Apr 09, 2011 at 12:21:46PM +0930, Alan Modra wrote:
> a) Allow sibling calls via function pointer. At the time
> rs6000_function_ok_for_sibcall was written, I don't think access to
> arg types of function pointer calls was available in the target
> hook/macro.
>
> + /* Functions with vector parameters are required to have a
> + prototype, so the argument type info must be available
> + here. */
> + for (type = TYPE_ARG_TYPES (fntype);
> + type;
> + type = TREE_CHAIN (type))
> + if (TREE_CODE (TREE_VALUE (type)) == VECTOR_TYPE
> + && (ALTIVEC_VECTOR_MODE (TYPE_MODE (TREE_VALUE (type)))
> + || VSX_VECTOR_MODE (TYPE_MODE (TREE_VALUE (type)))))
> + nvreg++;
> +
> + for (type = TYPE_ARG_TYPES (TREE_TYPE (current_function_decl));
> + type;
> + type = TREE_CHAIN (type))
> + if (TREE_CODE (TREE_VALUE (type)) == VECTOR_TYPE
> + && (ALTIVEC_VECTOR_MODE (TYPE_MODE (TREE_VALUE (type)))
> + || VSX_VECTOR_MODE (TYPE_MODE (TREE_VALUE (type)))))
> + nvreg--;
Could I request that you use FOREACH_FUNCTION_ARGS in these two cases?
The conversion is trivial, and avoiding more exposed TYPE_ARG_TYPES
calls is a good thing.
Thanks,
-Nathan