Commit 287dd527 by Andreas Tobler Committed by David Edelsohn

ffi_darwin.c (ffi_prep_args): Skip appropriate number of GPRs for floating-point arguments.

2002-02-21  Andreas Tobler  <toa@pop.agri.ch>

        * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate
        number of GPRs for floating-point arguments.

From-SVN: r49934
parent 7ab56274
2002-02-21 Andreas Tobler <toa@pop.agri.ch>
* src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate
number of GPRs for floating-point arguments.
2002-01-31 Anthony Green <green@redhat.com> 2002-01-31 Anthony Green <green@redhat.com>
* configure: Rebuilt. * configure: Rebuilt.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
Darwin ABI support (c) 2001 John Hornkvist Darwin ABI support (c) 2001 John Hornkvist
AIX ABI support (c) 2002 Free Software Foundation, Inc. AIX ABI support (c) 2002 Free Software Foundation, Inc.
$Id: ffi_darwin.c,v 1.1 2002/01/16 05:32:15 bryce Exp $ $Id: ffi_darwin.c,v 1.2 2002/01/17 16:04:21 dje Exp $
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
...@@ -121,13 +121,21 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack) ...@@ -121,13 +121,21 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
{ {
switch ((*ptr)->type) switch ((*ptr)->type)
{ {
/* If a floating-point parameter appears before all of the general-
purpose registers are filled, the corresponding GPRs that match
the size of the floating-point parameter are skipped. */
case FFI_TYPE_FLOAT: case FFI_TYPE_FLOAT:
case FFI_TYPE_DOUBLE: double_tmp = *(float *)*p_argv;
if ((*ptr)->type == FFI_TYPE_FLOAT) if (fparg_count >= NUM_FPR_ARG_REGISTERS)
double_tmp = *(float *)*p_argv; *(double *)next_arg = double_tmp;
else else
double_tmp = *(double *)*p_argv; *fpr_base++ = double_tmp;
next_arg++;
fparg_count++;
FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
break;
case FFI_TYPE_DOUBLE:
double_tmp = *(double *)*p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS) if (fparg_count >= NUM_FPR_ARG_REGISTERS)
*(double *)next_arg = double_tmp; *(double *)next_arg = double_tmp;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment