sparc: Re-add abi compliant structure support

The original code, removed in the "rewrite" patch, was incorrect for
large structures, and required dynamic allocation of a trampoline on
every ffi_call.

Instead, allocate a 4k entry table of all possible structure returns.
The table is 80k, but is read-only and dynamically paged, which ought
to be better than allocating the trampoline.

This is difficult to test with gcc.  One can only use -O0 at present.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63668.
This commit is contained in:
Richard Henderson
2014-11-12 09:36:11 +01:00
parent 92022496ef
commit 6eec410f15
5 changed files with 39 additions and 17 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ E SPARC_RET_F_1
std %f6, [%l2+56]
! Copy the structure into place.
srl %l0, SPARC_FLTMASK_SHIFT, %o0 ! load size_mask
srl %l0, SPARC_SIZEMASK_SHIFT, %o0 ! load size_mask
mov %i2, %o1 ! load dst
mov %l2, %o2 ! load src_gp
call C(ffi_struct_float_copy)