diff options
-rw-r--r-- | libffi/ChangeLog | 5 | ||||
-rw-r--r-- | libffi/src/sparc/ffi.c | 2 | ||||
-rw-r--r-- | libffi/src/sparc/v9.S | 42 |
3 files changed, 32 insertions, 17 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog index e5f4836..7e96f27 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,8 @@ +2003-07-28 Andreas Tobler <a.tobler@schweiz.ch> + + * src/sparc/ffi.c: Handle all floating point registers. + * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410. + 2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> * README: Note that libffi is not part of GCC. Update the project diff --git a/libffi/src/sparc/ffi.c b/libffi/src/sparc/ffi.c index 573fc84..3c71771 100644 --- a/libffi/src/sparc/ffi.c +++ b/libffi/src/sparc/ffi.c @@ -494,7 +494,7 @@ ffi_closure_sparc_inner(ffi_closure *closure, argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; #ifdef SPARC64 - if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT + if (i < 16 && (arg_types[i]->type == FFI_TYPE_FLOAT || arg_types[i]->type == FFI_TYPE_DOUBLE #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || arg_types[i]->type == FFI_TYPE_LONGDOUBLE diff --git a/libffi/src/sparc/v9.S b/libffi/src/sparc/v9.S index e2eeb43..20ce0f4 100644 --- a/libffi/src/sparc/v9.S +++ b/libffi/src/sparc/v9.S @@ -126,9 +126,9 @@ dostruct: .size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9 -#define STACKFRAME 240 /* 16*8 register window + +#define STACKFRAME 320 /* 16*8 register window + 6*8 args backing store + - 8*8 locals */ + 18*8 locals */ #define FP %fp+STACK_BIAS /* ffi_closure_v9(...) @@ -153,19 +153,29 @@ ffi_closure_v9: stx %i5, [FP+128+40] ! Store possible floating point argument registers too. - std %f0, [FP-48] - std %f2, [FP-40] - std %f4, [FP-32] - std %f6, [FP-24] - std %f8, [FP-16] - std %f10, [FP-8] + std %f0, [FP-128] + std %f2, [FP-120] + std %f4, [FP-112] + std %f6, [FP-104] + std %f8, [FP-96] + std %f10, [FP-88] + std %f12, [FP-80] + std %f14, [FP-72] + std %f16, [FP-64] + std %f18, [FP-56] + std %f20, [FP-48] + std %f22, [FP-40] + std %f24, [FP-32] + std %f26, [FP-24] + std %f28, [FP-16] + std %f30, [FP-8] ! Call ffi_closure_sparc_inner to do the bulk of the work. mov %g1, %o0 - add %fp, STACK_BIAS-64, %o1 + add %fp, STACK_BIAS-144, %o1 add %fp, STACK_BIAS+128, %o2 call ffi_closure_sparc_inner - add %fp, STACK_BIAS-48, %o3 + add %fp, STACK_BIAS-128, %o3 ! Load up the return value in the proper type. cmp %o0, FFI_TYPE_VOID @@ -173,33 +183,33 @@ ffi_closure_v9: cmp %o0, FFI_TYPE_FLOAT be,a,pn %icc, done1 - ld [FP-64], %f0 + ld [FP-144], %f0 cmp %o0, FFI_TYPE_DOUBLE be,a,pn %icc, done1 - ldd [FP-64], %f0 + ldd [FP-144], %f0 cmp %o0, FFI_TYPE_LONGDOUBLE be,a,pn %icc, longdouble1 - ldd [FP-64], %f0 + ldd [FP-144], %f0 cmp %o0, FFI_TYPE_STRUCT be,pn %icc, struct1 ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER - ldx [FP-64], %i0 + ldx [FP-144], %i0 done1: ret restore struct1: - ldx [FP-56], %i2 + ldx [FP-136], %i2 ret restore longdouble1: - ldd [FP-56], %f2 + ldd [FP-136], %f2 ret restore .LLFE2: |