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]

arguments passed partially in regs and partially in stack


Hello,

I am currently working on a retargetting of gcc.

The ABI specifies that function arguments can use
upto 8 4-bytes registers, and then the stack if
additionnal storage is needed.

If an argument is larger than the available registers,
the first bytes of it should be written in these
regs, and the rest on the stack.

I am currently unable to achieve that.

I suspect it has to do with the fact that below
the stack area dedicated to parameters, another
16 bytes area is reserved, such that the area
gcc could use for the "pretend arguments"
would not be contiguous to that.

That is, the callee stack would look like this:

T-------------------------------------------
O       |pretend|reserved|   args
P--------------------------------------------
        |       |        | 
        |       |       start of stacked args
        |       start of reserved area
       start of pretend args


I believe AP should point to the beginning of
pretend args, but in initial_elimination_offset,
how can I make the difference between the
"pretend" args and the "true" ones?

Currently, when I compute the frame size,
I include current_function_outgoing_args_size
and current_function_pretend_args_size.

In addition, the behavior of FUNCTION_ARG is
not clear to me in this case.
Given that FUNCTION_ARG_PARTIAL returns non-zero
in this case, what is FUNCTION_ARG expected to
return? I have read the doc several times and
still it is not clear; should it return:
- the number of the first register used?
- or parallel describing all the registers to
  use along with a special entry for the stack
  part ?

I can't understand the code in function.c dealing with
FUNCTION_ARG_PARTIAL.



On the other hand, the caller side seems OK.


Should I include the "pretend" area between
my reserved area and the "true" args area
on the caller side?



Thanks,

Christophe.


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