aboutsummaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel1@de.ibm.com>2007-02-13 07:54:40 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2007-02-13 07:54:40 +0000
commit7a23933bdd11a28c04098c1facb00059dd2be272 (patch)
tree160ab02005ff98f1643394606e3465ed3aaebca4 /libffi
parent9606c9dd5e853ca9e24ffd6aab1b8bdc6f3c9b43 (diff)
downloadgcc-7a23933bdd11a28c04098c1facb00059dd2be272.zip
gcc-7a23933bdd11a28c04098c1facb00059dd2be272.tar.gz
gcc-7a23933bdd11a28c04098c1facb00059dd2be272.tar.bz2
ffi.c (ffi_prep_args, [...]): Add long double handling.
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. From-SVN: r121879
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ChangeLog5
-rw-r--r--libffi/src/s390/ffi.c27
2 files changed, 32 insertions, 0 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 4b3c509..5a67ccd 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/libffi/src/s390/ffi.c b/libffi/src/s390/ffi.c
index 399fa2a..2809aa3 100644
--- a/libffi/src/s390/ffi.c
+++ b/libffi/src/s390/ffi.c
@@ -207,6 +207,12 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
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)
{
@@ -364,6 +370,12 @@ ffi_prep_cif_machdep(ffi_cif *cif)
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:
@@ -400,6 +412,12 @@ ffi_prep_cif_machdep(ffi_cif *cif)
{
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)
{
@@ -562,6 +580,12 @@ ffi_closure_helper_SYSV (ffi_closure *closure,
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)
{
@@ -662,6 +686,9 @@ ffi_closure_helper_SYSV (ffi_closure *closure,
/* 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. */