This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Irix calling conventions for complex numbers
- From: "Billinghurst, David (CALCRTS)" <david dot billinghurst at comalco dot riotinto dot com dot au>
- To: <gcc at gcc dot gnu dot org>
- Cc: <fortran at gcc dot gnu dot org>
- Date: Wed, 7 Jul 2004 15:40:58 +1000
- Subject: Irix calling conventions for complex numbers
I have started to look at C99 complex support on mips-sgi-irix6.5,
since it is required for gfortran complex number support.
A little experimentation suggests that complex numbers are not
beings passed or returned to IRIX libc functions such as cpow{,f,l}.
(I will put together some examples id anyone is interested)
The SGI docs state that for the N32 ABI:
Complex types (C99 and Fortran %val) are passed in multiple floating point
registers, as available. Float complex is passed as 2 floats, double
complex as 2 doubles, and long double complex as 2 long doubles. Because
the size of a float complex is 8 bytes (two 4-byte floats) but two float
argument registers take 16 bytes of space, the float complex is padded with
an extra 8 bytes of empty space in the stack image of the argument registers.
For example, if the float complex is passed in $f12 and $f13, with the
next parameters in $f14, the stack home of the float complex would be at
n($sp) ($f12 would be stored in n($sp) and $f13 into n+4(s0)) and the stack
home of $f14 would be at n+16($sp).
Where in gcc do I look to see if this is the case?