diff options
author | Andrew Pinski <apinski@cavium.com> | 2015-02-10 22:46:47 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2015-02-10 14:46:47 -0800 |
commit | 97c32df4ba83a0d2872af9477dbdc83a534d16ef (patch) | |
tree | 758a37aa8fc976d1c982fb96541aa0f877586f4e /libffi | |
parent | c8aa1929d5590eb141207914ec47c073f1d95932 (diff) | |
download | gcc-97c32df4ba83a0d2872af9477dbdc83a534d16ef.tar.gz |
ffitarget.h (ffi_arg): Use unsigned long long for ILP32.
2015-02-10 Andrew Pinski <apinski@cavium.com>
* src/aarch64/ffitarget.h (ffi_arg): Use unsigned long long for ILP32.
(FFI_SIZEOF_ARG): Define to 64 for ILP32.
(ffi_sarg): Use signed long long for ILP32.
* src/aarch64/sysv.S (PTR_REG): New macro.
(PTR_SIZE): New macro.
(ffi_closure_SYSV): Load cif, fn and user_data using PTR_REG.
(ffi_go_closure_SYSV): Load cif and fn using PTR_REG.
From-SVN: r220598
Diffstat (limited to 'libffi')
-rw-r--r-- | libffi/ChangeLog | 11 | ||||
-rw-r--r-- | libffi/src/aarch64/ffitarget.h | 6 | ||||
-rw-r--r-- | libffi/src/aarch64/sysv.S | 18 |
3 files changed, 32 insertions, 3 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 47503d449e6..a690b7bbf98 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,14 @@ +2015-02-10 Andrew Pinski <apinski@cavium.com> + + * src/aarch64/ffitarget.h (ffi_arg): Use unsigned long long for ILP32. + (FFI_SIZEOF_ARG): Define to 64 for ILP32. + (ffi_sarg): Use signed long long for ILP32. + + * src/aarch64/sysv.S (PTR_REG): New macro. + (PTR_SIZE): New macro. + (ffi_closure_SYSV): Load cif, fn and user_data using PTR_REG. + (ffi_go_closure_SYSV): Load cif and fn using PTR_REG. + 2015-01-29 Jack Howarth <howarth.at.gcc@gmail.com> PR libffi/64855 diff --git a/libffi/src/aarch64/ffitarget.h b/libffi/src/aarch64/ffitarget.h index fca2811ae21..2862ec7fccc 100644 --- a/libffi/src/aarch64/ffitarget.h +++ b/libffi/src/aarch64/ffitarget.h @@ -27,8 +27,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endif #ifndef LIBFFI_ASM +#ifdef __ILP32__ +#define FFI_SIZEOF_ARG 8 +typedef unsigned long long ffi_arg; +typedef signed long long ffi_sarg; +#else typedef unsigned long ffi_arg; typedef signed long ffi_sarg; +#endif typedef enum ffi_abi { diff --git a/libffi/src/aarch64/sysv.S b/libffi/src/aarch64/sysv.S index 46f50b9ef21..c1bf9b98e03 100644 --- a/libffi/src/aarch64/sysv.S +++ b/libffi/src/aarch64/sysv.S @@ -45,6 +45,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define BE(X) 0 #endif +#ifdef __ILP32__ +#define PTR_REG(n) w##n +#else +#define PTR_REG(n) x##n +#endif + +#ifdef __ILP32__ +#define PTR_SIZE 4 +#else +#define PTR_SIZE 8 +#endif + .text .align 4 @@ -248,8 +260,8 @@ CNAME(ffi_closure_SYSV): stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] /* Load ffi_closure_inner arguments. */ - ldp x0, x1, [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ - ldr x2, [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+16] /* load user_data */ + ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ + ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ .Ldo_closure: add x3, sp, #16 /* load context */ add x4, sp, #ffi_closure_SYSV_FS /* load stack */ @@ -403,7 +415,7 @@ CNAME(ffi_go_closure_SYSV): stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] /* Load ffi_closure_inner arguments. */ - ldp x0, x1, [x18, #8] /* load cif, fn */ + ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */ mov x2, x18 /* load user_data */ b .Ldo_closure cfi_endproc |