This is the mail archive of the gcc@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: Splitting function arguments.


On 13 Jun 2007 10:47:33 -0700, Ian Lance Taylor <iant@google.com> wrote:
"Mohamed Shafi" <shafitvm@gmail.com> writes:

> I am working for a private GCC target.
> The target has 4  registers, each 32 bits reserved for arguments.
> When passing arguments depending on the type of the argument either
> registers or stack + registers will be used Sometimes the arguments
> will be split between a memory location and the register.Consider the
> following function call
>
> fun(int k, long long j, long long m);
>
> In the above case k and j will be passed through registers and m will
> be passed through register and stack, as all the other registers are
> used by the arguments k and j.
> In this case compiler is splitting the values on its own. But due to
> the restriction placed by load/store operation for the target, the
> splitting has to be modified according to the target.
>
> Is there any target hook that will help me to do it?
> Or can i write a pattern in the md file that can be used for this
> purpose. Is there any other target that does similar to this?

See TARGET_ARG_PARTIAL_BYTES.

I looked into this hook before but this hook only helps me to choose the number of bytes at the beginning of an argument that must be put in registers. But what i want is to shift the 64 bit value 16 times to left before its split. So in essence i need to control which all bytes should go into the register and which all in the memory and the above target hook, IIUC only decides about how many.

So is there any way to do this?

Regards,
Shafi.


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