This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] x86 interrupt attribute patch [1/2]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Yulia Koval <vaalfreja at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, "Koval, Julia" <julia dot koval at intel dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Lu, Hongjiu" <hongjiu dot lu at intel dot com>, "ubizjak at gmail dot com" <ubizjak at gmail dot com>, "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- Date: Thu, 28 Apr 2016 12:32:53 -0700
- Subject: Re: [PATCH] x86 interrupt attribute patch [1/2]
- Authentication-results: sourceware.org; auth=none
- References: <4E89A029A0F8D443B436A5167BA3C53F03CFFF4E at CDSMSX101 dot ccr dot corp dot intel dot com> <739bb353-4440-f6da-400b-c3f9464ff2e9 at redhat dot com> <CAE0nxxg+ohuFOxbSdxewqCctG_k_4t5RO2gHgTjKccatQprQuw at mail dot gmail dot com>
On Thu, Apr 28, 2016 at 11:22 AM, Yulia Koval <vaalfreja@gmail.com> wrote:
> Thank you,
> Here is the repost.
>
> Update TARGET_FUNCTION_INCOMING_ARG documentation
>
> On x86, interrupt handlers are only called by processors which push
> interrupt data onto stack at the address where the normal return address
> is. Since interrupt handlers must access interrupt data via pointers so
> that they can update interrupt data, the pointer argument is passed as
> "argument pointer - word".
>
> TARGET_FUNCTION_INCOMING_ARG defines how callee sees its argument.
> Normally it returns REG, NULL, or CONST_INT. This patch adds arbitrary
> address computation based on hard register, which can be forced into a
> register, to the list.
>
> When copying an incoming argument onto stack, assign_parm_setup_stack
> has:
>
> if (argument in memory)
> copy argument in memory to stack
> else
> move argument to stack
>
> Since an arbitrary address computation may be passed as an argument, we
> change it to:
>
> if (argument in memory)
> copy argument in memory to stack
> else
> {
> if (argument isn't in register)
> force argument into a register
> move argument to stack
> }
>
> * function.c (assign_parm_setup_stack): Force source into a
> register if needed.
> * target.def (function_incoming_arg): Update documentation to
> allow arbitrary address computation based on hard register.
> * doc/tm.texi: Regenerated.
>
>
> Br,
> Yulia
>
You also need to update
DEFHOOK
(function_incoming_arg,
"Define this hook if the target machine has ``register windows'', so\n\
that the register in which a function sees an arguments is not\n\
necessarily the same as the one in which the caller passed the\n\
argument.\n\
\n\
.....
in target.def.
--
H.J.