And note Yao qi, that there are different ABIs on the rs6000, each of which has different conventions (ie, you will need to study the AIX ABI as well as the System V/eabi ABIs, and possibly other ABIs that are now used).
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Lance Taylor Sent: Tuesday, September 06, 2005 2:06 PM To: Yao qi Cc: gcc@gcc.gnu.org Subject: Re: var_args for rs6000 backend "Yao qi" <[EMAIL PROTECTED]> writes: > I am working on variable arguments on rs6000 backend and I have > browsed gcc/confi g/rs6000/rs6000.c for several times, I found > there are some functions relavtive to this issue, they are > setup_incoming_varargs, rs6000_build_builtin_va_list ,rs6000_va_start > ,rs6000_gimplify_va_arg . > > I could not know what they do just by source code. Could anybody > tell me the relationship among these routines? I think it is > important for me to understand the mechnism of GCC backend. Any > comments or advice are highly appreciate. These are partially documented in gcc/doc/tm.texi. Unfortunately the documentation is not particularly good. These functions are all oriented around C stdarg.h functions. In brief, setup_incoming_varargs is called for a function which takes a variable number of arguments, and does any required preparation statements. build_builtin_va_list builds the va_list data type. va_start is called to implement the va_start macro. gimplify_va_arg is called to implement the va_arg macro. > I do not know what is the precondation if I want to do it? May I need > to know the architecture of PowerPC and ABI for it? You do indeed need to know the PowerPC ABIs to understand what these routines are doing and why. Ian