+2007-02-13 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep,
+ ffi_closure_helper_SYSV): Add long double handling.
+
2007-02-02 Jakub Jelinek <jakub@redhat.com>
* src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2
void *arg = *p_argv;
int type = (*ptr)->type;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ /* 16-byte long double is passed like a struct. */
+ if (type == FFI_TYPE_LONGDOUBLE)
+ type = FFI_TYPE_STRUCT;
+#endif
+
/* Check how a structure type is passed. */
if (type == FFI_TYPE_STRUCT)
{
cif->flags = FFI390_RET_DOUBLE;
break;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ case FFI_TYPE_LONGDOUBLE:
+ cif->flags = FFI390_RET_STRUCT;
+ n_gpr++;
+ break;
+#endif
/* Integer values are returned in gpr 2 (and gpr 3
for 64-bit values on 31-bit machines). */
case FFI_TYPE_UINT64:
{
int type = (*ptr)->type;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ /* 16-byte long double is passed like a struct. */
+ if (type == FFI_TYPE_LONGDOUBLE)
+ type = FFI_TYPE_STRUCT;
+#endif
+
/* Check how a structure type is passed. */
if (type == FFI_TYPE_STRUCT)
{
int deref_struct_pointer = 0;
int type = (*ptr)->type;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ /* 16-byte long double is passed like a struct. */
+ if (type == FFI_TYPE_LONGDOUBLE)
+ type = FFI_TYPE_STRUCT;
+#endif
+
/* Check how a structure type is passed. */
if (type == FFI_TYPE_STRUCT)
{
/* Void is easy, and so is struct. */
case FFI_TYPE_VOID:
case FFI_TYPE_STRUCT:
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ case FFI_TYPE_LONGDOUBLE:
+#endif
break;
/* Floating point values are returned in fpr 0. */