[Patch] libffi-MIPS: Fix long double return types in n32/n64.
Andrew Haley
aph@redhat.com
Fri Dec 7 10:48:00 GMT 2007
David Daney writes:
> 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));
I seem to be the indentation police today. :-)
cif->flags += ((FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
<< (4 + (FFI_FLAG_BITS * 8)));
Andrew.
More information about the Java-patches
mailing list