for the register size.
(ffi_closure_helper_SYSV): Handle the structure return value
address correctly.
(ffi_closure_helper_SYSV): Return the appropriate type when
the registers are used for the structure return value.
* src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
the 64-bit return value. Update copyright years.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71521
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-09-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_prep_args): Take account into the alignement
+ for the register size.
+ (ffi_closure_helper_SYSV): Handle the structure return value
+ address correctly.
+ (ffi_closure_helper_SYSV): Return the appropriate type when
+ the registers are used for the structure return value.
+ * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
+ the 64-bit return value. Update copyright years.
+
2003-09-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in
greg += n;
#endif
memcpy (argp, *p_argv, z);
- argp += z;
+ argp += n * sizeof (int);
}
}
}
#endif
memcpy (argp, *p_argv, z);
- argp += z;
+ argp += n * sizeof (int);
}
}
/* Copy the caller's structure return value address so that the closure
returns the data directly to the caller. */
- if (cif->rtype->type == FFI_TYPE_STRUCT)
+ if (cif->rtype->type == FFI_TYPE_STRUCT && STRUCT_VALUE_ADDRESS_WITH_ARG)
{
rvalue = *pgr++;
- ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
+ ireg = 1;
}
else
ireg = 0;
(closure->fun) (cif, rvalue, avalue, closure->user_data);
- /* Tell ffi_closure_osf how to perform return type promotions. */
- return cif->rtype->type;
+ /* Tell ffi_closure_SYSV how to perform return type promotions. */
+ return return_type (cif->rtype);
}
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2002 Kaz Kojima
+ sysv.S - Copyright (c) 2002, 2003 Kaz Kojima
SuperH Foreign Function Interface
...
32 bytes (floating register parameters, SH-4 only)
16 bytes (register parameters)
- 4 bytes (result)
+ 8 bytes (result)
+ 4 bytes (pad)
4 bytes (5th arg)
<- new stack pointer
*/
.LCFI8:
#if defined(__SH4__)
- add #-56,r15
+ add #-64,r15
#else
- add #-24,r15
+ add #-32,r15
#endif
.LCFI9:
mov r15,r14
.LCFIA:
mov r14,r1
- add #24,r1
+ add #32,r1
mov.l r7,@-r1
mov.l r6,@-r1
mov.l r5,@-r1
#if defined(__SH4__)
mov r14,r1
- add #56,r1
+ add #64,r1
#ifdef __LITTLE_ENDIAN__
fmov.s fr10,@-r1
fmov.s fr11,@-r1
#endif
mov r14,r1
- add #4,r1
+ add #8,r1
mov r1,r5
mov r14,r1
#if defined(__SH4__)
- add #64,r1
+ add #72,r1
#else
- add #32,r1
+ add #40,r1
#endif
mov.l r1,@r14
mov.w @r0,r0
mov r14,r2
braf r0
- add #4,r2
+ add #8,r2
0:
.align 2
L_helper:
L_case_v:
#if defined(__SH4__)
- add #56,r15
+ add #64,r15
#else
- add #24,r15
+ add #32,r15
#endif
lds.l @r15+,pr
rts
.4byte .LCFI9-.LCFI8
.byte 0xe /* DW_CFA_def_cfa_offset */
#if defined(__SH4__)
- .byte 8+56 /* uleb128 8+56 */
+ .byte 8+64 /* uleb128 8+64 */
#else
- .byte 8+24 /* uleb128 8+24 */
+ .byte 8+32 /* uleb128 8+32 */
#endif
.byte 0x91 /* DW_CFA_offset, column 0x11 */
.byte 0x2