Commit 69b182fd by Andreas Tobler Committed by Andreas Tobler

types.c (double): Add AIX and Darwin to the right TYPEDEF.

2003-09-18  Andreas Tobler  <a.tobler@schweiz.ch>
	    David Edelsohn  <edelsohn@gnu.org>

	* src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
	* src/powerpc/aix_closure.S: Remove the pointer to the outgoing
	parameter stack.
	* src/powerpc/darwin_closure.S: Likewise.
	* src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
	according to the Darwin/AIX ABI.
	(ffi_prep_cif_machdep): Likewise.
	(ffi_closure_helper_DARWIN): Likewise.
	Remove the outgoing parameter stack logic. Simplify the evaluation
	of the different CASE types.
	(ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
	statement in the trampoline code.

Co-Authored-By: David Edelsohn <edelsohn@gnu.org>

From-SVN: r71530
parent 85b22f78
2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
David Edelsohn <edelsohn@gnu.org>
* src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
* src/powerpc/aix_closure.S: Remove the pointer to the outgoing
parameter stack.
* src/powerpc/darwin_closure.S: Likewise.
* src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
according to the Darwin/AIX ABI.
(ffi_prep_cif_machdep): Likewise.
(ffi_closure_helper_DARWIN): Likewise.
Remove the outgoing parameter stack logic. Simplify the evaluation
of the different CASE types.
(ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
statement in the trampoline code.
2003-09-18 Kaz Kojima <kkojima@gcc.gnu.org>
* src/sh/ffi.c (ffi_prep_args): Take account into the alignement
......
......@@ -105,8 +105,8 @@ ffi_closure_ASM:
/* 24 Bytes (Linkage Area) */
/* 32 Bytes (params) */
/* 104 Bytes (13*8 from FPR) */
/* 8 Bytes (result)
/* 104 Bytes (13*8 from FPR) */
/* 8 Bytes (result) */
/* 168 Bytes */
stwu r1,-176(r1) /* skip over caller save area
......@@ -144,20 +144,16 @@ ffi_closure_ASM:
/* set up registers for the routine that actually does the work */
/* get the context pointer from the trampoline */
mr r3,r11
/* now load up the pointer to the result storage */
addi r4,r1,160
/* now load up the pointer to the saved gpr registers */
addi r5,r1,200
/* now load up the pointer to the saved fpr registers */
addi r6,r1,56
/* now load up the pointer to the outgoing parameter */
/* stack in the previous frame */
addi r7,r1,232
/* make the call */
bl .ffi_closure_helper_DARWIN
nop
......
......@@ -31,7 +31,7 @@
.text
.align 2
.globl _ffi_closure_ASM
.text
.align 2
_ffi_closure_ASM:
......@@ -44,13 +44,13 @@ LCFI0:
104 Bytes (13*8 from FPR)
8 Bytes (result)
168 Bytes */
stwu r1,-176(r1) /* skip over caller save area
keep stack aligned to 16 */
LCFI1:
/* we want to build up an area for the parameters passed
in registers (both floating point and integer) */
/* we store gpr 3 to gpr 10 (aligned to 4)
in the parents outgoing area */
stw r3, 200(r1)
......@@ -80,23 +80,19 @@ LCFI1:
/* set up registers for the routine that actually does the work */
/* get the context pointer from the trampoline */
mr r3,r11
/* now load up the pointer to the result storage */
addi r4,r1,160
/* now load up the pointer to the saved gpr registers */
addi r5,r1,200
/* now load up the pointer to the saved fpr registers */
addi r6,r1,56
/* now load up the pointer to the outgoing parameter
stack in the previous frame */
addi r7,r1,232
/* make the call */
bl Lffi_closure_helper_DARWIN$stub
/* now r3 contains the return type */
/* so use it to look up in a table */
/* so we know how to deal with each type */
......@@ -114,7 +110,7 @@ LFE1:
/* Each of the ret_typeX code fragments has to be exactly 16 bytes long */
/* (4 instructions). For cache effectiveness we align to a 16 byte boundary */
/* first. */
.align 4
nop
......@@ -234,7 +230,7 @@ Lfinish:
lwz r0,8(r1) /* get return address */
mtlr r0 /* reset link register */
blr
/* END(ffi_closure_ASM) */
.data
......
......@@ -76,7 +76,7 @@ FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_TYPE_SINT64);
FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
#elif defined ARM || defined SH || defined POWERPC64
#elif defined ARM || defined SH || defined POWERPC64 || defined POWERPC_AIX || defined POWERPC_DARWIN
FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment