From 2c3f7870a88c22ff731fbe82889be5235de6807e Mon Sep 17 00:00:00 2001
From: daney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 7 Dec 2007 23:21:04 +0000
Subject: 2007-12-07  David Daney  <ddaney@avtrex.com> 	* src/mips/ffi.c
 (ffi_prep_cif_machdep): Handle long double return 	type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130699 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libffi/src/mips/ffi.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'libffi/src')

diff --git a/libffi/src/mips/ffi.c b/libffi/src/mips/ffi.c
index cc2a42e7a9f..d0ce201a151 100644
--- a/libffi/src/mips/ffi.c
+++ b/libffi/src/mips/ffi.c
@@ -462,7 +462,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *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;
-- 
cgit v1.2.1