[PATCH 3/8] sparc: Rewrite everything
Richard Henderson
rth@twiddle.net
Wed Oct 29 20:01:00 GMT 2014
On 10/29/2014 11:10 AM, David Miller wrote:
> From: Richard Henderson <rth@twiddle.net>
> Date: Tue, 28 Oct 2014 12:45:50 -0700
>
>> + case FFI_TYPE_STRUCT:
>> + if (rtype->size > 32)
>> + {
>> + flags = SPARC_RET_VOID | SPARC_FLAG_RET_IN_MEM;
>> + bytes = 8;
>> + }
>> + else
>> + flags = SPARC_RET_STRUCT;
>> + break;
>
> Here you use a cutoff of 32 bytes.
Return type.
>
>> + case FFI_TYPE_LONGDOUBLE:
>> + case FFI_TYPE_STRUCT:
>> + z = ty->size;
>> + if (z > 16)
>> + {
>> + /* For structures larger than 16 bytes we pass reference. */
>> + *argp++ = (unsigned long)a;
>> + break;
>> + }
>> + if (((unsigned long)argp & 15) && ty->alignment > 8)
>> + argp++;
>> + memcpy(argp, a, z);
>> + argp += ALIGN(z, 8) / 8;
>> + break;
>
> Yet here in args prep, the cutoff is 16.
Parameter type.
> Maybe I'm missing something?
The two limits are in fact different. In gcc, see sparc_return_in_memory and
sparc_pass_by_reference.
r~
More information about the Libffi-discuss
mailing list