diff options
author | Tom Tromey <tromey@redhat.com> | 2005-09-26 19:56:22 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2005-09-26 19:56:22 +0000 |
commit | 012beccd0291b6d3c85cf038f4a9459704fc91fb (patch) | |
tree | 46d3d81e265f2f30ae68f0c9b3ef0bd546515080 /libffi/src/powerpc | |
parent | d04c287e53d0cc82ce0bee42aca54569756f0aa1 (diff) |
* testsuite/libffi.call/float1.c (value_type): New typedef.
(CANARY): New define.
(main): Check for result buffer overflow.
* src/powerpc/linux64.S: Handle linux64 long double returns.
* src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant.
(ffi_prep_cif_machdep): Handle linux64 long double returns.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@104660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/src/powerpc')
-rw-r--r-- | libffi/src/powerpc/ffi.c | 7 | ||||
-rw-r--r-- | libffi/src/powerpc/linux64.S | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c index cc410bc6bdc..7d8bf3a1dff 100644 --- a/libffi/src/powerpc/ffi.c +++ b/libffi/src/powerpc/ffi.c @@ -39,6 +39,7 @@ enum { FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */ FLAG_RETURNS_FP = 1 << (31-29), FLAG_RETURNS_64BITS = 1 << (31-28), + FLAG_RETURNS_128BITS = 1 << (31-27), FLAG_ARG_NEEDS_COPY = 1 << (31- 7), FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ @@ -543,6 +544,12 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) /* else fall through. */ #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: + if (type == FFI_TYPE_LONGDOUBLE && cif->abi == FFI_LINUX64) + { + flags |= FLAG_RETURNS_128BITS; + flags |= FLAG_RETURNS_FP; + break; + } #endif intarg_count++; flags |= FLAG_RETVAL_REFERENCE; diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S index 18423bfc972..25b2c4f455b 100644 --- a/libffi/src/powerpc/linux64.S +++ b/libffi/src/powerpc/linux64.S @@ -120,9 +120,13 @@ ffi_call_LINUX64: blr .Lfp_return_value: + bt 27, .Lfd_return_value bf 28, .Lfloat_return_value stfd %f1, 0(%r30) - stfd %f2, 8(%r30) /* It might be a long double */ + b .Ldone_return_value +.Lfd_return_value: + stfd %f1, 0(%r30) + stfd %f2, 8(%r30) b .Ldone_return_value .Lfloat_return_value: stfs %f1, 0(%r30) |