This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

complex float support and 64 bit hosts


I have checked in this patch.  This allows FUNCTION_VALUE to return a PARALLEL
for a complex type return value.

I used this to get complex float working for a 64-bit target.  Complex float
types are treated like a structure of two fields, and each field goes in its
own floating point register, both for parameter passing and function return
values.  This worked well enough to compile GNU libc without hitting the
"Unable to access real part of complex value in a hard register on this target"
error message.  Fortunately, this is exactly what the ABI specified for
complex float types, so this made it easy.  Unfortunately, complex int will
still fail.  However, the ABI doesn't clearly specify what happens to complex
int, so perhaps we can define our own ABI convention for them.

The ABI covers complex float because Fortran has this type, but I don't think
Fortran has complex int, so that was left unspecified.

We can perhaps use the same technique to solve our 64-bit mips problem with
complex float.  The n32/n64 ABIs imply that complex float values are supposed
to be returned in two FP registers.  There is still a problem for complex float
parameters, as the ABI does not specify that they are passed in two FP
registers.  Instead, it appears that they get passed in one general purpose
register.  If we are willing to violate the ABI, we could pass them in two
separate registers instead.

Thu Aug  5 17:26:01 1999  Jim Wilson  <wilson@cygnus.com>

	* expr.c (emit_group_load): Allow src to be a CONCAT.

Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.158
diff -p -r1.158 expr.c
*** expr.c	1999/08/04 20:32:26	1.158
--- expr.c	1999/08/06 02:29:13
*************** emit_group_load (dst, orig_src, ssize, a
*** 1967,1972 ****
--- 1967,1983 ----
  					  plus_constant (XEXP (src, 0),
  							 bytepos)));
  	}
+       else if (GET_CODE (src) == CONCAT)
+ 	{
+ 	  if (bytepos == 0
+ 	      && bytelen == GET_MODE_SIZE (GET_MODE (XEXP (src, 0))))
+ 	    tmps[i] = XEXP (src, 0);
+ 	  else if (bytepos == GET_MODE_SIZE (GET_MODE (XEXP (src, 0)))
+ 		   && bytelen == GET_MODE_SIZE (GET_MODE (XEXP (src, 1))))
+ 	    tmps[i] = XEXP (src, 1);
+ 	  else
+ 	    abort ();
+ 	}
        else
  	{
  	  tmps[i] = extract_bit_field (src, bytelen*BITS_PER_UNIT,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]