aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2004-03-11 14:25:44 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>2004-03-11 14:25:44 +0000
commit254ea4774bc05a44f3dd1a56f2f8af66783ca7c5 (patch)
treeba689ff75b31513162adabcf47e243128c66fba1
parent40131a384c12ca47a142e349af17bc14345015ff (diff)
downloadgcc-254ea4774bc05a44f3dd1a56f2f8af66783ca7c5.zip
gcc-254ea4774bc05a44f3dd1a56f2f8af66783ca7c5.tar.gz
gcc-254ea4774bc05a44f3dd1a56f2f8af66783ca7c5.tar.bz2
ffi.c (ffi_prep_incoming_args_UNIX): Get floating point arguments from fp registers only for the first 8 parameter slots.
* src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point arguments from fp registers only for the first 8 parameter slots. Don't convert a float parameter when passed in memory. From-SVN: r79323
-rw-r--r--libffi/ChangeLog6
-rw-r--r--libffi/src/ia64/ffi.c15
2 files changed, 13 insertions, 8 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 2d3a1e8f..4b966cd 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-11 Andreas Schwab <schwab@suse.de>
+
+ * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point
+ arguments from fp registers only for the first 8 parameter slots.
+ Don't convert a float parameter when passed in memory.
+
2004-03-09 Hans-Peter Nilsson <hp@axis.com>
* configure: Regenerate for config/accross.m4 correction.
diff --git a/libffi/src/ia64/ffi.c b/libffi/src/ia64/ffi.c
index c846f6e..1dc27db 100644
--- a/libffi/src/ia64/ffi.c
+++ b/libffi/src/ia64/ffi.c
@@ -196,7 +196,7 @@ ffi_prep_args(struct ia64_args *stack, extended_cif *ecif, int bytes)
*fp_argp++ = *(float *)(* p_argv);
}
/* Also put it into the integer registers or memory: */
- *(UINT64 *) argp = *(UINT32 *)(* p_argv);
+ *(UINT64 *) argp = *(UINT32 *)(* p_argv);
break;
case FFI_TYPE_DOUBLE:
@@ -204,7 +204,7 @@ ffi_prep_args(struct ia64_args *stack, extended_cif *ecif, int bytes)
if (fp_argp - stack->fp_regs < 8)
*fp_argp++ = *(double *)(* p_argv);
/* Also put it into the integer registers or memory: */
- *(double *) argp = *(double *)(* p_argv);
+ *(double *) argp = *(double *)(* p_argv);
break;
case FFI_TYPE_STRUCT:
@@ -547,7 +547,7 @@ ffi_prep_incoming_args_UNIX(struct ia64_args *args, void **rvalue,
register unsigned int i;
register unsigned int avn;
register void **p_argv;
- register unsigned long *argp = args -> out_regs;
+ register long *argp = args -> out_regs;
unsigned fp_reg_num = 0;
register ffi_type **p_arg;
@@ -576,17 +576,15 @@ ffi_prep_incoming_args_UNIX(struct ia64_args *args, void **rvalue,
case FFI_TYPE_FLOAT:
z = 1;
/* Convert argument back to float in place from the saved value */
- if (fp_reg_num < 8) {
+ if (argp - args->out_regs < 8 && fp_reg_num < 8) {
*(float *)argp = args -> fp_regs[fp_reg_num++];
- } else {
- *(float *)argp = *(double *)argp;
}
*p_argv = (void *)argp;
break;
case FFI_TYPE_DOUBLE:
z = 1;
- if (fp_reg_num < 8) {
+ if (argp - args->out_regs < 8 && fp_reg_num < 8) {
*p_argv = args -> fp_regs + fp_reg_num++;
} else {
*p_argv = (void *)argp;
@@ -598,7 +596,8 @@ ffi_prep_incoming_args_UNIX(struct ia64_args *args, void **rvalue,
size_t sz = (*p_arg)->size;
unsigned short element_type;
z = ((*p_arg)->size + FFI_SIZEOF_ARG - 1)/FFI_SIZEOF_ARG;
- if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) {
+ if (argp - args->out_regs < 8
+ && is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) {
int nelements = sz/float_type_size(element_type);
if (nelements + fp_reg_num >= 8) {
/* hard case NYI. */