This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 32bit Calling conventions on linux/ppc.
- From: Dale Johannesen <dalej at apple dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Dale Johannesen <dalej at apple dot com>, Joslwah <joslwah at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 12 Dec 2006 12:03:23 -0800
- Subject: Re: 32bit Calling conventions on linux/ppc.
- References: <20061116173208.cb8cdac3.joslwah@gmail.com> <200612121942.kBCJgGV38264@makai.watson.ibm.com>
On Dec 12, 2006, at 11:42 AM, David Edelsohn wrote:
Joslwah writes:
Joslwah> Looking at the Linux 32bit PowerPC ABI spec, it appears to
me that
Joslwah> floats in excess of those that are passed in registers are
supposed to
Joslwah> be promoted to doubles and passed on the stack. Examing
the resulting
Joslwah> stack from a gcc generated C call it appears they are
passed as
Joslwah> floats.
Joslwah> Can someone confirm/refute this, or else point me to an
ABI that says
Joslwah> that they should be passed as floats.
I have not been able to find any motivation for promoting floats
passed ont the stack. Does this provide some form of compatibility
with
SPARC?
It may have been intended to allow the callee to be a K&R-style or
varargs function, where all float args get promoted to double.
In particular, printf was often called without being declared in K&R-
era code. This is one way to make that code work in a C90 environment.