This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: var_args for rs6000 backend
- From: "Meissner, Michael" <michael dot meissner at amd dot com>
- To: "Yao qi" <qiyaobit at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 9 Sep 2005 13:46:52 -0400
- Subject: RE: var_args for rs6000 backend
As I said, I haven't looked at the code in awhile (before GIMPLE), but
the TREE code is the symbol table that allows you to look up the types
of arguments and the function return type. The RTX code are the
instructions you produce for va_arg, etc. For example, I believe the
eabi/System V had a structure that had a few elements, one of which was
the argument number, then there pointers to the save areas for gpr and
fpr registers and the stack frame. The va_arg code would have to
produce code that tested the argument number, and if it was the first 8
arguments it would use the pointer to the gpr/fpr save areas and if not
it would use the stack pointer, and finally bump up the argument number.
I may be somewhat wrong on the details. That is the trouble on working
on quite a few different ports -- after awhile all of the details blend
together.
-----Original Message-----
From: Yao qi [mailto:qiyaobit@hotmail.com]
Sent: Friday, September 09, 2005 6:43 AM
To: Meissner, Michael
Cc: gcc@gcc.gnu.org
Subject: RE: var_args for rs6000 backend
>From: "Meissner, Michael" <michael.meissner@amd.com>
>To: "Yao qi" <qiyaobit@hotmail.com>
>CC: gcc@gcc.gnu.org
>Subject: RE: var_args for rs6000 backend
>Date: Thu, 8 Sep 2005 21:19:25 -0400
>
>Yes, the eABI is a modification of the System V ABI. IIRC (but it has
>been several years since I worked on PowerPC), the differences between
>eABI and System V were:
>
>1) eABI used r2 as a secondary small data pointer (System V used just
>r13), and r0 was used for data centered around location 0;
>
>2) there were some relocations in eABI not in System V (support for 3
>small data pointers, section relative relocations) and some relocations
>in System V not in eABI (shared library support);
>
>3) System V had 16-byte stack alignment and eABI had 8-byte stack
>alignment.
>
>I suspect there may be more changes that I'm forgetting about, and also
>the 64-bit support probably changes things also.
>
Thanks very much for your explanation, and I will take them in mind.
Now, I can understand the ideas about ABI clearly and map these ideas
to the source code partialy.
However, I am cofused by the combination of TREE operations, RTX and
GIMPLE
in the functions about variable arguments. I have to conquer them
before I
hack code
about variable arguments in GCC, don't you? However my focus now is
routines about variable
argument, and do you think it is necessary for me to understand TREE
strucuture, RTX
and GIMPLE before I pay attention on variable arguments ? Is there any
workrounds to
bypass them partially? If there is no such shortcut for them, could you
tell me how to
start the learning in these fields ?
Thank you very much again.
Best Regards
----------------
Yao Qi
Bejing Institute of Technology
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.com/