Re-enable msabi testing (#436)
* Revert "disable msabi testing for now"
This reverts commit 7b7638eb0e.
* x86: Correct testing for 64-bit x86-64
Since passing -m32 to x86-64 compiler will generate i386 code, we
need to check both __ILP32__ and __i386__ for 64-bit x86-64.
* x86: Check __i386__ instead of i?86-*-* targets
Since passing -m32 to x86-64 compiler will generate i386 code, we need
to check __i386__ instead of i?86-*-* targets for i386 targets.
* i386: Properly passing integer parameters in registers
For thiscall and fastcall, if the paramter passed as 64-bit integer or
struct, all following integer paramters will be passed on stack.
* test: Add ABI_ATTR to callback_code
Add ABI_ATTR to callback_code to properly test different ABIs.
This commit is contained in:
@@ -345,6 +345,15 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
||||
size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG);
|
||||
size_t align = FFI_SIZEOF_ARG;
|
||||
|
||||
/* Issue 434: For thiscall and fastcall, if the paramter passed
|
||||
as 64-bit integer or struct, all following integer paramters
|
||||
will be passed on stack. */
|
||||
if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
|
||||
&& (t == FFI_TYPE_SINT64
|
||||
|| t == FFI_TYPE_UINT64
|
||||
|| t == FFI_TYPE_STRUCT))
|
||||
narg_reg = 2;
|
||||
|
||||
/* Alignment rules for arguments are quite complex. Vectors and
|
||||
structures with 16 byte alignment get it. Note that long double
|
||||
on Darwin does have 16 byte alignment, and does not get this
|
||||
@@ -475,6 +484,15 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
|
||||
if (t == FFI_TYPE_STRUCT && ty->alignment >= 16)
|
||||
align = 16;
|
||||
|
||||
/* Issue 434: For thiscall and fastcall, if the paramter passed
|
||||
as 64-bit integer or struct, all following integer paramters
|
||||
will be passed on stack. */
|
||||
if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
|
||||
&& (t == FFI_TYPE_SINT64
|
||||
|| t == FFI_TYPE_UINT64
|
||||
|| t == FFI_TYPE_STRUCT))
|
||||
narg_reg = 2;
|
||||
|
||||
if (dir < 0)
|
||||
{
|
||||
/* ??? These reverse argument ABIs are probably too old
|
||||
|
||||
Reference in New Issue
Block a user