Irix calling conventions for complex numbers
Billinghurst, David (CALCRTS)
david.billinghurst@comalco.riotinto.com.au
Wed Jul 7 05:41:00 GMT 2004
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?
More information about the Fortran
mailing list