diff options
Diffstat (limited to 'libffi/src/prep_cif.c')
-rw-r--r-- | libffi/src/prep_cif.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libffi/src/prep_cif.c b/libffi/src/prep_cif.c index eb6834199b1..5d1924bbe58 100644 --- a/libffi/src/prep_cif.c +++ b/libffi/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 |