This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[Patch] libffi-MIPS: Fix long double return types in n32/n64.
- From: David Daney <ddaney at avtrex dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard Sandiford <rsandifo at nildram dot co dot uk>
- Date: Fri, 07 Dec 2007 00:14:56 -0800
- Subject: [Patch] libffi-MIPS: Fix long double return types in n32/n64.
This patch fixes failures in the libffi testsuite for long double return
values. These are the last remaining failures for mips64 in libffi.
The fix is to add special handling for long double return values.
Testing on mips64-unknown-linux-gnu n32 and n64.
OK to commit if no problems found?
2007-12-07 David Daney <ddaney@avtrex.com>
* src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return
type.
Index: src/mips/ffi.c
===================================================================
--- src/mips/ffi.c (revision 130659)
+++ src/mips/ffi.c (working copy)
@@ -462,7 +462,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif
case FFI_TYPE_DOUBLE:
cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
break;
-
+ case FFI_TYPE_LONGDOUBLE:
+ /* Long double is returned as if it were a struct containing
+ two doubles. */
+ cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
+ cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
+ << (4 + (FFI_FLAG_BITS * 8));
+ break;
default:
cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
break;