summaryrefslogtreecommitdiff
path: root/src/prep_cif.c
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2012-10-12 16:46:06 -0400
committerAnthony Green <green@moxielogic.com>2012-10-12 16:46:06 -0400
commit9c00a3f6742d61404b31268cc773e7130ff43331 (patch)
tree6dfdd2b20b69c385aca2f7cf55bca231ab6ebf81 /src/prep_cif.c
parent048d2f41c3a6664b4b64bf21e804686662da4160 (diff)
downloadlibffi-9c00a3f6742d61404b31268cc773e7130ff43331.tar.gz
TILE-Gx/TILEPro support
Diffstat (limited to 'src/prep_cif.c')
-rw-r--r--src/prep_cif.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/prep_cif.c b/src/prep_cif.c
index eb68341..5d1924b 100644
--- a/src/prep_cif.c
+++ b/src/prep_cif.c
@@ -140,6 +140,9 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
#ifdef SPARC
&& (cif->abi != FFI_V9 || cif->rtype->size > 32)
#endif
+#ifdef TILE
+ && (cif->rtype->size > 10 * FFI_SIZEOF_ARG)
+#endif
)
bytes = STACK_ARG_SIZE(sizeof(void*));
#endif
@@ -169,6 +172,16 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
if (((*ptr)->alignment - 1) & bytes)
bytes = ALIGN(bytes, (*ptr)->alignment);
+#ifdef TILE
+ if (bytes < 10 * FFI_SIZEOF_ARG &&
+ bytes + STACK_ARG_SIZE((*ptr)->size) > 10 * FFI_SIZEOF_ARG)
+ {
+ /* An argument is never split between the 10 parameter
+ registers and the stack. */
+ bytes = 10 * FFI_SIZEOF_ARG;
+ }
+#endif
+
bytes += STACK_ARG_SIZE((*ptr)->size);
}
#endif