aboutsummaryrefslogtreecommitdiff
path: root/libffi/src/powerpc
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2003-09-11 05:17:57 +0000
committerAlan Modra <amodra@bigpond.net.au>2003-09-11 05:17:57 +0000
commit93fb09b7aad6a60837914e1f9fa989540e722709 (patch)
tree7fe48b10869cf553f80c9159b587e3d1c6056b5c /libffi/src/powerpc
parent2404ee6c486ee11f1428b7e582b608db40c968c4 (diff)
* src/types.c (double, longdouble): Merge identical SH and ARM
typedefs, and add POWERPC64. * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for struct split over gpr and rest. (ffi_prep_cif_machdep): Correct intarg_count for structures. * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@71295 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/src/powerpc')
-rw-r--r--libffi/src/powerpc/ffi.c6
-rw-r--r--libffi/src/powerpc/linux64.S8
2 files changed, 7 insertions, 7 deletions
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c
index 010050f91ba..9ad85ea7b86 100644
--- a/libffi/src/powerpc/ffi.c
+++ b/libffi/src/powerpc/ffi.c
@@ -376,11 +376,11 @@ void hidden ffi_prep_args64(extended_cif *ecif, unsigned long *const stack)
words = ((*ptr)->size + 7) / 8;
if (next_arg >= gpr_base && next_arg + words > gpr_end)
{
- unsigned int first = (char *) gpr_end - (char *) next_arg;
+ size_t first = (char *) gpr_end - (char *) next_arg;
memcpy((char *) next_arg, (char *) *p_argv, first);
memcpy((char *) rest, (char *) *p_argv + first,
(*ptr)->size - first);
- next_arg = rest + words * 8 - first;
+ next_arg = (unsigned long *) ((char *) rest + words * 8 - first);
}
else
{
@@ -591,7 +591,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
#endif
- intarg_count += ((*ptr)->size + 7) & ~7;
+ intarg_count += ((*ptr)->size + 7) / 8;
break;
default:
diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S
index d8af13b108a..22079807720 100644
--- a/libffi/src/powerpc/linux64.S
+++ b/libffi/src/powerpc/linux64.S
@@ -73,10 +73,10 @@ ffi_call_LINUX64:
ld %r5, -32-(6*8)(%r28)
ld %r6, -32-(5*8)(%r28)
bf- 5, 1f
- ld %r7, -32-(4*4)(%r28)
- ld %r8, -32-(3*4)(%r28)
- ld %r9, -32-(2*4)(%r28)
- ld %r10, -32-(1*4)(%r28)
+ ld %r7, -32-(4*8)(%r28)
+ ld %r8, -32-(3*8)(%r28)
+ ld %r9, -32-(2*8)(%r28)
+ ld %r10, -32-(1*8)(%r28)
1:
/* Load all the FP registers. */