[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/libffi/src/powerpc asm.h,1.1,1.2 darwin
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/libffi/src/powerpc asm.h,1.1,1.2 darwin.S,1.1,1.2 darwin_closure.S,1.1,1.2 ffi.c,1.1,1.2 ffi_darwin.c,1.3,1.4 ppc_closure.S,1.1,1.2 sysv.S,1.1,1.2 |
Date: |
Wed, 05 Feb 2003 20:15:41 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc
In directory subversions:/tmp/cvs-serv21586/libffi/src/powerpc
Modified Files:
asm.h darwin.S darwin_closure.S ffi.c ffi_darwin.c
ppc_closure.S sysv.S
Log Message:
Update the libffi library from the gcc CVS tree.
Index: asm.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/asm.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
Index: darwin.S
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/darwin.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** darwin.S 10 May 2002 23:04:40 -0000 1.1
--- darwin.S 6 Feb 2003 01:15:38 -0000 1.2
***************
*** 4,9 ****
PowerPC Assembly glue.
- $Id$
-
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
--- 4,7 ----
***************
*** 40,47 ****
.align 2
_ffi_call_DARWIN:
! mr r12,r8 // We only need r12 until the call, so it doesn't have
to be saved...
/* Save the old stack pointer as AP. */
mr r8,r1
!
/* Allocate the stack space we need. */
stwux r1,r1,r4
--- 38,48 ----
.align 2
_ffi_call_DARWIN:
! LFB0:
! mr r12,r8 /* We only need r12 until the call,
! so it doesn't have to be saved... */
! LFB1:
/* Save the old stack pointer as AP. */
mr r8,r1
! LCFI0:
/* Allocate the stack space we need. */
stwux r1,r1,r4
***************
*** 50,67 ****
mflr r9
! stw r28,-16(r8)
stw r29,-12(r8)
stw r30, -8(r8)
stw r31, -4(r8)
!
! stw r9, 8(r8)
stw r2, 20(r1)
/* Save arguments over call... */
! mr r31,r5 /* flags, */
! mr r30,r6 /* rvalue, */
! mr r29,r7 /* function address, */
! mr r28,r8 /* our AP. */
!
/* Call ffi_prep_args. */
mr r4,r1
--- 51,69 ----
mflr r9
! stw r28,-16(r8)
stw r29,-12(r8)
stw r30, -8(r8)
stw r31, -4(r8)
!
! stw r9, 8(r8)
stw r2, 20(r1)
+ LCFI1:
/* Save arguments over call... */
! mr r31,r5 /* flags, */
! mr r30,r6 /* rvalue, */
! mr r29,r7 /* function address, */
! mr r28,r8 /* our AP. */
! LCFI2:
/* Call ffi_prep_args. */
mr r4,r1
***************
*** 146,150 ****
stfs f1,0(r30)
b L(done_return_value)
! //END(_ffi_call_DARWIN)
/* Provide a null definition of _ffi_call_AIX. */
--- 148,153 ----
stfs f1,0(r30)
b L(done_return_value)
! LFE1:
! /* END(_ffi_call_DARWIN) */
/* Provide a null definition of _ffi_call_AIX. */
***************
*** 156,159 ****
_ffi_call_AIX:
blr
! //END(_ffi_call_AIX)
--- 159,218 ----
_ffi_call_AIX:
blr
! /* END(_ffi_call_AIX) */
+ .data
+ .section __TEXT,__eh_frame
+ Lframe1:
+ .set L$set$0,LECIE1-LSCIE1
+ .long L$set$0 ; Length of Common Information Entry
+ LSCIE1:
+ .long 0x0 ; CIE Identifier Tag
+ .byte 0x1 ; CIE Version
+ .ascii "zR\0" ; CIE Augmentation
+ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
+ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor
+ .byte 0x41 ; CIE RA Column
+ .byte 0x1 ; uleb128 0x1; Augmentation size
+ .byte 0x10 ; FDE Encoding (pcrel)
+ .byte 0xc ; DW_CFA_def_cfa
+ .byte 0x1 ; uleb128 0x1
+ .byte 0x0 ; uleb128 0x0
+ .align 2
+ LECIE1:
+ LSFDE1:
+ .set L$set$1,LEFDE1-LASFDE1
+ .long L$set$1 ; FDE Length
+ LASFDE1:
+ .set L$set$2,LASFDE1-Lframe1
+ .long L$set$2 ; FDE CIE offset
+ .long LFB0-. ; FDE initial location
+ .set L$set$3,LFE1-LFB0
+ .long L$set$3 ; FDE address range
+ .byte 0x0 ; uleb128 0x0; Augmentation size
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$4,LCFI0-LFB1
+ .long L$set$4
+ .byte 0xd ; DW_CFA_def_cfa_register
+ .byte 0x08 ; uleb128 0x08
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$5,LCFI1-LCFI0
+ .long L$set$5
+ .byte 0x11 ; DW_CFA_offset_extended_sf
+ .byte 0x41 ; uleb128 0x41
+ .byte 0x7e ; sleb128 -2
+ .byte 0x9f ; DW_CFA_offset, column 0x1f
+ .byte 0x1 ; uleb128 0x1
+ .byte 0x9e ; DW_CFA_offset, column 0x1e
+ .byte 0x2 ; uleb128 0x2
+ .byte 0x9d ; DW_CFA_offset, column 0x1d
+ .byte 0x3 ; uleb128 0x3
+ .byte 0x9c ; DW_CFA_offset, column 0x1c
+ .byte 0x4 ; uleb128 0x4
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$6,LCFI2-LCFI1
+ .long L$set$6
+ .byte 0xd ; DW_CFA_def_cfa_register
+ .byte 0x1c ; uleb128 0x1c
+ .align 2
+ LEFDE1:
+
Index: darwin_closure.S
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/darwin_closure.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** darwin_closure.S 10 May 2002 23:04:40 -0000 1.1
--- darwin_closure.S 6 Feb 2003 01:15:38 -0000 1.2
***************
*** 1,5 ****
/* -----------------------------------------------------------------------
! darwin_closures.S - Copyright (c) 2002 Free Software Foundation, Inc.
! based on ppc_closures.S
PowerPC Assembly glue.
--- 1,5 ----
/* -----------------------------------------------------------------------
! darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation,
! Inc. based on ppc_closure.S
PowerPC Assembly glue.
***************
*** 38,45 ****
.align 2
_ffi_closure_ASM:
!
! mflr r0 /* extract return address */
! stw r0, 8(r1) /* save the return address */
!
/* 24 Bytes (Linkage Area) */
/* 32 Bytes (outgoing parameter area, always reserved) */
--- 38,45 ----
.align 2
_ffi_closure_ASM:
! LFB1:
! mflr r0 /* extract return address */
! stw r0, 8(r1) /* save the return address */
! LCFI0:
/* 24 Bytes (Linkage Area) */
/* 32 Bytes (outgoing parameter area, always reserved) */
***************
*** 48,55 ****
/* 164 Bytes */
! stwu r1,-164(r1) /* skip over caller save area */
!
! /* 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) */
--- 48,55 ----
/* 164 Bytes */
! stwu r1,-164(r1) /* skip over caller save area */
! 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) */
***************
*** 112,116 ****
add r3,r3,r4 /* add contents of table to table address */
mtctr r3
! bctr /* jump to it */
.L60:
--- 112,118 ----
add r3,r3,r4 /* add contents of table to table address */
mtctr r3
! bctr /* jump to it */
! LFE1:
! .align 2
.L60:
***************
*** 186,189 ****
blr
! /* END(ffi_closure_ASM) */
--- 188,235 ----
blr
! /* END(ffi_closure_ASM) */
!
! .data
! .section __TEXT,__eh_frame
! Lframe1:
! .set L$set$0,LECIE1-LSCIE1
! .long L$set$0 ; Length of Common Information Entry
! LSCIE1:
! .long 0x0 ; CIE Identifier Tag
! .byte 0x1 ; CIE Version
! .ascii "zR\0" ; CIE Augmentation
! .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
! .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor
! .byte 0x41 ; CIE RA Column
! .byte 0x1 ; uleb128 0x1; Augmentation size
! .byte 0x10 ; FDE Encoding (pcrel)
! .byte 0xc ; DW_CFA_def_cfa
! .byte 0x1 ; uleb128 0x1
! .byte 0x0 ; uleb128 0x0
! .align 2
! LECIE1:
! LSFDE1:
! .set L$set$1,LEFDE1-LASFDE1
! .long L$set$1 ; FDE Length
!
! LASFDE1:
! .set L$set$2,LASFDE1-Lframe1
! .long L$set$2 ; FDE CIE offset
! .long LFB1-. ; FDE initial location
! .set L$set$3,LFE1-LFB1
! .long L$set$3 ; FDE address range
! .byte 0x0 ; uleb128 0x0; Augmentation size
! .byte 0x4 ; DW_CFA_advance_loc4
! .set L$set$3,LCFI1-LCFI0
! .long L$set$3
! .byte 0xe ; DW_CFA_def_cfa_offset
! .byte 164,1 ; uleb128 164
! .byte 0x4 ; DW_CFA_advance_loc4
! .set L$set$4,LCFI0-LFB1
! .long L$set$4
! .byte 0x11 ; DW_CFA_offset_extended_sf
! .byte 0x41 ; uleb128 0x41
! .byte 0x7e ; sleb128 -2
! .align 2
! LEFDE1:
Index: ffi.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/ffi.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ffi.c 10 May 2002 23:04:40 -0000 1.1
--- ffi.c 6 Feb 2003 01:15:38 -0000 1.2
***************
*** 138,146 ****
{
case FFI_TYPE_FLOAT:
! case FFI_TYPE_DOUBLE:
! if ((*ptr)->type == FFI_TYPE_FLOAT)
! double_tmp = *(float *)*p_argv;
else
! double_tmp = *(double *)*p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
--- 138,155 ----
{
case FFI_TYPE_FLOAT:
! double_tmp = *(float *)*p_argv;
! if (fparg_count >= NUM_FPR_ARG_REGISTERS)
! {
! *(float *)next_arg = (float)double_tmp;
! next_arg += 1;
! }
else
! *fpr_base++ = double_tmp;
! fparg_count++;
! FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
! break;
!
! case FFI_TYPE_DOUBLE:
! double_tmp = *(double *)*p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
***************
*** 321,324 ****
--- 330,337 ----
{
case FFI_TYPE_FLOAT:
+ fparg_count++;
+ /* floating singles are not 8-aligned on stack */
+ break;
+
case FFI_TYPE_DOUBLE:
fparg_count++;
***************
*** 613,622 ****
/* unfortunately float values are stored as doubles
* in the ffi_closure_SYSV code (since we don't check
! * the type in that routine). This is also true
! * of floats passed on the outgoing parameter stack.
! * Also, on the outgoing stack all values are aligned
! * to 8
! *
! * Don't you just love the simplicity of this ABI!
*/
--- 626,630 ----
/* unfortunately float values are stored as doubles
* in the ffi_closure_SYSV code (since we don't check
! * the type in that routine).
*/
***************
*** 624,630 ****
if (nf < 8) {
! temp = *(double*)pfr;
*(float*)pfr = (float)temp;
! avalue[i] = pfr;
nf++;
pfr+=2;
--- 632,638 ----
if (nf < 8) {
! temp = *(double*)pfr;
*(float*)pfr = (float)temp;
! avalue[i] = pfr;
nf++;
pfr+=2;
***************
*** 635,644 ****
* naughty thing to do but...
*/
- if (((long)pst) & 4) pst++;
- temp = *(double*)pst;
- *(float*)pst = (float)temp;
avalue[i] = pst;
nf++;
! pst+=2;
}
break;
--- 643,649 ----
* naughty thing to do but...
*/
avalue[i] = pst;
nf++;
! pst+=1;
}
break;
Index: ffi_darwin.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/ffi_darwin.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ffi_darwin.c 11 Jun 2002 01:57:18 -0000 1.3
--- ffi_darwin.c 6 Feb 2003 01:15:38 -0000 1.4
***************
*** 7,12 ****
AIX ABI support (c) 2002 Free Software Foundation, Inc.
- $Id$
-
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
--- 7,10 ----
Index: ppc_closure.S
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/ppc_closure.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ppc_closure.S 10 May 2002 23:04:40 -0000 1.1
--- ppc_closure.S 6 Feb 2003 01:15:38 -0000 1.2
***************
*** 2,6 ****
#include <powerpc/asm.h>
! .globl ffi_closure_helper_SYSV
ENTRY(ffi_closure_SYSV)
--- 2,6 ----
#include <powerpc/asm.h>
! .file "ppc_closure.S"
ENTRY(ffi_closure_SYSV)
***************
*** 9,13 ****
.LCFI0:
mflr %r0
- stw %r31,140(%r1)
.LCFI1:
stw %r0,148(%r1)
--- 9,12 ----
***************
*** 64,148 ****
# by using return type as offset
addi %r5,%r1,112 # get pointer to results area
! addis %r4,0,address@hidden # get address of jump table
! addi %r4,%r4,address@hidden
! slwi %r3,%r3,2 # now multiply return type by 4
! lwzx %r3,%r4,%r3 # get the contents of that table value
! add %r3,%r3,%r4 # add contents of table to table address
mtctr %r3
bctr # jump to it
.LFE1:
- .align 2
- .L60:
- .long .L44-.L60 # FFI_TYPE_VOID
- .long .L50-.L60 # FFI_TYPE_INT
- .long .L47-.L60 # FFI_TYPE_FLOAT
- .long .L46-.L60 # FFI_TYPE_DOUBLE
- .long .L46-.L60 # FFI_TYPE_LONGDOUBLE
- .long .L56-.L60 # FFI_TYPE_UINT8
- .long .L55-.L60 # FFI_TYPE_SINT8
- .long .L58-.L60 # FFI_TYPE_UINT16
- .long .L57-.L60 # FFI_TYPE_SINT16
- .long .L50-.L60 # FFI_TYPE_UINT32
- .long .L50-.L60 # FFI_TYPE_SINT32
- .long .L48-.L60 # FFI_TYPE_UINT64
- .long .L48-.L60 # FFI_TYPE_SINT64
- .long .L44-.L60 # FFI_TYPE_STRUCT
- .long .L50-.L60 # FFI_TYPE_POINTER
! # case double
! .L46:
! lfd %f1,0(%r5)
! b .L44
! # case float
! .L47:
lfs %f1,0(%r5)
! b .L44
!
! # case long long
! .L48:
lwz %r3,0(%r5)
lwz %r4,4(%r5)
! b .L44
!
! # case default / int32 / pointer
! .L50:
lwz %r3,0(%r5)
! b .L44
!
! # case signed int8
! .L55:
! addi %r5,%r5,3
! lbz %r3,0(%r5)
! extsb %r3,%r3
! b .L44
! # case unsigned int8
! .L56:
! addi %r5,%r5,3
! lbz %r3,0(%r5)
! b .L44
!
! # case signed int16
! .L57:
! addi %r5,%r5,2
! lhz %r3,0(%r5)
! extsh %r3,%r3
! b .L44
!
! #case unsigned int16
! .L58:
! addi %r5,%r5,2
! lhz %r3,0(%r5)
! # case void / done
! .L44:
! lwz %r11,0(%r1)
! lwz %r0,4(%r11)
mtlr %r0
! lwz %r31,-4(%r11)
! mr %r1,%r11
blr
END(ffi_closure_SYSV)
--- 63,196 ----
# by using return type as offset
addi %r5,%r1,112 # get pointer to results area
! bl .Lget_ret_type0_addr # get pointer to .Lret_type0 into LR
! mflr %r4 # move to r4
! slwi %r3,%r3,4 # now multiply return type by 16
! add %r3,%r3,%r4 # add contents of table to table address
mtctr %r3
bctr # jump to it
.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
+ nop
+ nop
+ .Lget_ret_type0_addr:
+ blrl
+
+ # case FFI_TYPE_VOID
+ .Lret_type0:
+ b .Lfinish
+ nop
+ nop
+ nop
! # case FFI_TYPE_INT
! .Lret_type1:
! lwz %r3,0(%r5)
! b .Lfinish
! nop
! nop
! # case FFI_TYPE_FLOAT
! .Lret_type2:
lfs %f1,0(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_DOUBLE
! .Lret_type3:
! lfd %f1,0(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_LONGDOUBLE
! .Lret_type4:
! lfd %f1,0(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_UINT8
! .Lret_type5:
! lbz %r3,3(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_SINT8
! .Lret_type6:
! lbz %r3,3(%r5)
! extsb %r3,%r3
! b .Lfinish
! nop
!
! # case FFI_TYPE_UINT16
! .Lret_type7:
! lhz %r3,2(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_SINT16
! .Lret_type8:
! lha %r3,2(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_UINT32
! .Lret_type9:
! lwz %r3,0(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_SINT32
! .Lret_type10:
! lwz %r3,0(%r5)
! b .Lfinish
! nop
! nop
!
! # case FFI_TYPE_UINT64
! .Lret_type11:
lwz %r3,0(%r5)
lwz %r4,4(%r5)
! b .Lfinish
! nop
!
! # case FFI_TYPE_SINT64
! .Lret_type12:
lwz %r3,0(%r5)
! lwz %r4,4(%r5)
! b .Lfinish
! nop
! # case FFI_TYPE_STRUCT
! .Lret_type13:
! b .Lfinish
! nop
! nop
! nop
!
! # case FFI_TYPE_POINTER
! .Lret_type14:
! lwz %r3,0(%r5)
! b .Lfinish
! nop
! nop
! # case done
! .Lfinish:
! lwz %r0,148(%r1)
mtlr %r0
! addi %r1,%r1,144
blr
END(ffi_closure_SYSV)
Index: sysv.S
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libffi/src/powerpc/sysv.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/libffi/src/powerpc asm.h,1.1,1.2 darwin.S,1.1,1.2 darwin_closure.S,1.1,1.2 ffi.c,1.1,1.2 ffi_darwin.c,1.3,1.4 ppc_closure.S,1.1,1.2 sysv.S,1.1,1.2,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnet/libffi/src/arm ffi.c,1.1,1.2 sysv.S,1.1,1.2
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnet/libgc/doc leak.html,NONE,1.1 README,1.2,1.3 README.changes,1.2,1.3 README.environment,1.2,1.3 README.linux,1.1.1.1,1.2 README.win32,1.2,1.3debugging.html,1.2,1.3
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnet/libffi/src/arm ffi.c,1.1,1.2 sysv.S,1.1,1.2
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnet/libgc/doc leak.html,NONE,1.1 README,1.2,1.3 README.changes,1.2,1.3 README.environment,1.2,1.3 README.linux,1.1.1.1,1.2 README.win32,1.2,1.3debugging.html,1.2,1.3
- Index(es):