diff options
author | cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-03 16:15:26 +0000 |
---|---|---|
committer | cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-03 16:15:26 +0000 |
commit | 30015fe99e2901a272956e5d926256f089dc440a (patch) | |
tree | 2481128ab8d5d9f7351c754a6aadb1220d50ee2c /libffi | |
parent | b0d55af98f2b56baf63412b9fbbba328cc47c5ea (diff) | |
download | gcc-30015fe99e2901a272956e5d926256f089dc440a.tar.gz |
2010-12-03 Chung-Lin Tang <cltang@codesourcery.com>
* src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
(ffi_closure_VFP): Same.
(ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
directive.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi')
-rw-r--r-- | libffi/ChangeLog | 7 | ||||
-rw-r--r-- | libffi/src/arm/sysv.S | 152 |
2 files changed, 85 insertions, 74 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 34d9aff2625..16e463806f9 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,10 @@ +2010-12-03 Chung-Lin Tang <cltang@codesourcery.com> + + * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive. + (ffi_closure_VFP): Same. + (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp' + directive. + 2010-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define. diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S index 7bce72712bb..72f0ee0ca0c 100644 --- a/libffi/src/arm/sysv.S +++ b/libffi/src/arm/sysv.S @@ -229,6 +229,83 @@ LSYM(Lepilogue): .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) +/* + unsigned int FFI_HIDDEN + ffi_closure_SYSV_inner (closure, respp, args) + ffi_closure *closure; + void **respp; + void *args; +*/ + +ARM_FUNC_START ffi_closure_SYSV + UNWIND .pad #16 + add ip, sp, #16 + stmfd sp!, {ip, lr} + UNWIND .save {r0, lr} + add r2, sp, #8 + UNWIND .pad #16 + sub sp, sp, #16 + str sp, [sp, #8] + add r1, sp, #8 + bl ffi_closure_SYSV_inner + cmp r0, #FFI_TYPE_INT + beq .Lretint + + cmp r0, #FFI_TYPE_FLOAT +#if defined(__SOFTFP__) || defined(__ARM_EABI__) + beq .Lretint +#else + beq .Lretfloat +#endif + + cmp r0, #FFI_TYPE_DOUBLE +#if defined(__SOFTFP__) || defined(__ARM_EABI__) + beq .Lretlonglong +#else + beq .Lretdouble +#endif + + cmp r0, #FFI_TYPE_LONGDOUBLE +#if defined(__SOFTFP__) || defined(__ARM_EABI__) + beq .Lretlonglong +#else + beq .Lretlongdouble +#endif + + cmp r0, #FFI_TYPE_SINT64 + beq .Lretlonglong +.Lclosure_epilogue: + add sp, sp, #16 + ldmfd sp, {sp, pc} +.Lretint: + ldr r0, [sp] + b .Lclosure_epilogue +.Lretlonglong: + ldr r0, [sp] + ldr r1, [sp, #4] + b .Lclosure_epilogue + +#if !defined(__SOFTFP__) && !defined(__ARM_EABI__) +.Lretfloat: + ldfs f0, [sp] + b .Lclosure_epilogue +.Lretdouble: + ldfd f0, [sp] + b .Lclosure_epilogue +.Lretlongdouble: + ldfd f0, [sp] + b .Lclosure_epilogue +#endif + +.ffi_closure_SYSV_end: + UNWIND .fnend + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) + + +/* Below are VFP hard-float ABI call and closure implementations. + Add VFP FPU directive here. */ + .fpu vfp + @ r0: fn @ r1: &ecif @ r2: cif->bytes @@ -321,79 +398,6 @@ LSYM(Lepilogue_vfp): .ffi_call_VFP_end: UNWIND .fnend .size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP) - - -/* - unsigned int FFI_HIDDEN - ffi_closure_SYSV_inner (closure, respp, args) - ffi_closure *closure; - void **respp; - void *args; -*/ - -ARM_FUNC_START ffi_closure_SYSV - UNWIND .pad #16 - add ip, sp, #16 - stmfd sp!, {ip, lr} - UNWIND .save {r0, lr} - add r2, sp, #8 - .pad #16 - sub sp, sp, #16 - str sp, [sp, #8] - add r1, sp, #8 - bl ffi_closure_SYSV_inner - cmp r0, #FFI_TYPE_INT - beq .Lretint - - cmp r0, #FFI_TYPE_FLOAT -#if defined(__SOFTFP__) || defined(__ARM_EABI__) - beq .Lretint -#else - beq .Lretfloat -#endif - - cmp r0, #FFI_TYPE_DOUBLE -#if defined(__SOFTFP__) || defined(__ARM_EABI__) - beq .Lretlonglong -#else - beq .Lretdouble -#endif - - cmp r0, #FFI_TYPE_LONGDOUBLE -#if defined(__SOFTFP__) || defined(__ARM_EABI__) - beq .Lretlonglong -#else - beq .Lretlongdouble -#endif - - cmp r0, #FFI_TYPE_SINT64 - beq .Lretlonglong -.Lclosure_epilogue: - add sp, sp, #16 - ldmfd sp, {sp, pc} -.Lretint: - ldr r0, [sp] - b .Lclosure_epilogue -.Lretlonglong: - ldr r0, [sp] - ldr r1, [sp, #4] - b .Lclosure_epilogue - -#if !defined(__SOFTFP__) && !defined(__ARM_EABI__) -.Lretfloat: - ldfs f0, [sp] - b .Lclosure_epilogue -.Lretdouble: - ldfd f0, [sp] - b .Lclosure_epilogue -.Lretlongdouble: - ldfd f0, [sp] - b .Lclosure_epilogue -#endif - -.ffi_closure_SYSV_end: - UNWIND .fnend - .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) ARM_FUNC_START ffi_closure_VFP @@ -405,7 +409,7 @@ ARM_FUNC_START ffi_closure_VFP UNWIND .save {r0, lr} add r2, sp, #72 add r3, sp, #8 - .pad #72 + UNWIND .pad #72 sub sp, sp, #72 str sp, [sp, #64] add r1, sp, #64 |