From 28165e22cd970f0269c27f31a30c166c9732cfea Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Sat, 28 Sep 2002 12:09:27 +0000 Subject: [PATCH] sysv.S: If we don't have machine/asm.h and the pre-processor has defined... * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor has defined __USER_LABEL_PREFIX__, then use it in CNAME. (ffi_call_SYSV): Handle soft-float. From-SVN: r57609 --- libffi/ChangeLog | 6 ++++++ libffi/src/arm/sysv.S | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 3fd628f8334b..365a1043b996 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,9 @@ +2002-09-28 Richard Earnshaw + + * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor + has defined __USER_LABEL_PREFIX__, then use it in CNAME. + (ffi_call_SYSV): Handle soft-float. + 2002-09-27 Bo Thorsen * include/ffi.h.in: Fix multilib x86-64 support. diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S index 84744d775621..a494a2ffebfd 100644 --- a/libffi/src/arm/sysv.S +++ b/libffi/src/arm/sysv.S @@ -28,6 +28,13 @@ #ifdef HAVE_MACHINE_ASM_H #include #else +#ifdef __USER_LABEL_PREFIX__ +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ +#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) +#else /* XXX these lose for some platforms, I'm sure. */ #define CNAME(x) x #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): @@ -96,12 +103,20 @@ ENTRY(ffi_call_SYSV) # return FLOAT cmp a4, #FFI_TYPE_FLOAT +#ifdef __SOFTFP__ + streq a1, [a3] +#else stfeqs f0, [a3] +#endif beq epilogue # return DOUBLE or LONGDOUBLE cmp a4, #FFI_TYPE_DOUBLE +#ifdef __SOFTFP__ + stmeqia a3, {a1, a2} +#else stfeqd f0, [a3] +#endif epilogue: ldmfd sp!, {a1-a4, fp, pc}