Commit Graph

20 Commits

Author SHA1 Message Date
Richard Henderson bf8da5fc77 configure.ac: Tidy target case.
* configure.ac: Tidy target case.
        (HAVE_LONG_DOUBLE): Allow the target to override.
        * configure: Regenerate.
        * include/ffi.h.in: Don't define ffi_type_foo if
        LIBFFI_HIDE_BASIC_TYPES is defined.
        (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define
        to ffi_type_double.
        * types.c (LIBFFI_HIDE_BASIC_TYPES): Define.
        (FFI_TYPEDEF, ffi_type_void): Mark the data const.
        (ffi_type_longdouble): Special case for Alpha.  Don't define
        if long double == double.

        * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value.
        (ffi_prep_cif_machdep): Handle it as the 128-bit type.
        (ffi_call, ffi_closure_osf_inner): Likewise.
        (ffi_closure_osf_inner): Likewise.  Mark hidden.
        (ffi_call_osf, ffi_closure_osf): Mark hidden.
        * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition.
        * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden.
        (load_table): Handle 128-bit long double.

        * testsuite/libffi.call/float4.c: Add -mieee for alpha.

From-SVN: r123622
2007-04-06 09:24:16 -07:00
Richard Henderson 5df07255e2 types.c (FFI_AGGREGATE_TYPEDEF): Remove.
* src/types.c (FFI_AGGREGATE_TYPEDEF): Remove.
        (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF.  Replace size and
        offset parameters with a type parameter; deduce size and structure
        alignment.  Update all users.

From-SVN: r92775
2004-12-31 14:04:30 -08:00
Richard Henderson 81a69b1333 types.c (FFI_TYPE_POINTER): Define with sizeof.
* src/types.c (FFI_TYPE_POINTER): Define with sizeof.
        (FFI_TYPE_LONGDOUBLE): Fix for ia64.
        * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move
        into ffi_prep_closure.
        * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite
        from scratch.

From-SVN: r92774
2004-12-31 12:11:17 -08:00
Kazuhiro Inaoka a472e9d4e6 Makefile.am: Add m32r support.
* Makefile.am: Add m32r support.
* configure.ac: Likewise.
* Makefile.in: Regenerate.
* confiugre: Regenerate.
* src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF
 (uint64, sint64, double, longdouble)
* src/m32r: New directory.
* src/m32r/ffi.c: New file.
* src/m32r/sysv.S: Likewise.
* src/m32r/ffitarget.h: Likewise.

From-SVN: r88993
2004-10-13 17:20:24 +00:00
Andreas Tobler 2fe7404ad4 ffi_darwin.c: Add flag for longdouble return values.
2004-09-02  Andreas Tobler  <a.tobler@schweiz.ch>

	* src/powerpc/ffi_darwin.c: Add flag for longdouble return values.
	(ffi_prep_args): Handle longdouble arguments.
	(ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for
	longdouble.
	(ffi_closure_helper_DARWIN): Add closure handling for longdouble.
	* src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble
	values.
	* src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise.
	* src/types.c: Defined longdouble size and alignment for darwin.

From-SVN: r86992
2004-09-02 23:14:45 +02:00
Hosaka Yuji 09cababc5f types.c: Fix alignment size of X86_WIN32 case int64 and double.
2004-03-16  Hosaka Yuji  <hos@tamanegi.org>

	* src/types.c: Fix alignment size of X86_WIN32 case int64 and
	double.
	* src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type
	with ecif->cif->flags.
	(ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type
	with cif->flags.
	(ffi_prep_cif_machdep): Add X86_WIN32 struct case.
	(ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32.
	* src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b,
	sc_retstruct2b): Add for 1 or 2-bytes struct case.

From-SVN: r79542
2004-03-16 20:17:33 +01:00
Alan Modra 12001e0ff9 * src/types.c (pointer): POWERPC64 has 8 byte pointers.
From-SVN: r77533
2004-02-09 23:40:37 +10:30
Alan Modra dd5f9ea23b * src/types.c: Use 16 byte long double for POWERPC64.
From-SVN: r77441
2004-02-07 13:41:59 +10:30
Andreas Tobler 1450eb7a07 [multiple changes]
2003-10-21  Andreas Tobler  <a.tobler@schweiz.ch>

	* configure.in: AC_LINK_FILES(ffitarget.h).
	* configure: Regenerate.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.
	* fficonfig.h.in: Likewise.

2003-10-21  Paolo Bonzini  <bonzini@gnu.org>
	    Richard Henderson  <rth@redhat.com>

	Avoid that ffi.h includes fficonfig.h.

	* Makefile.am (EXTRA_DIST): Include ffitarget.h files
	(TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
	(TARGET_SRC_MIPS_SGI): Removed.
	(MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
	(MIPS_SGI): Removed.
	(CLEANFILES): Removed.
	(mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
	targets.
	* acconfig.h: Removed.
	* configure.in: Compute sizeofs only for double and long double.
	Use them to define and subst HAVE_LONG_DOUBLE.  Include comments
	into AC_DEFINE instead of using acconfig.h.  Create
	include/ffitarget.h instead of include/fficonfig.h.  Rename
	MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
	AC_DEFINE EH_FRAME_FLAGS.
	* include/Makefile.am (DISTCLEANFILES): New automake macro.
	(hack_DATA): Add ffitarget.h.
	* include/ffi.h.in: Remove all system specific definitions.
	Declare raw API even if it is not installed, why bother?
	Use limits.h instead of SIZEOF_* to define ffi_type_*.  Do
	not define EH_FRAME_FLAGS, it is in fficonfig.h now.  Include
	ffitarget.h instead of fficonfig.h.  Remove ALIGN macro.
	(UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
	* include/ffi_common.h (bool): Do not define.
	(ffi_assert): Accept failed assertion.
	(ffi_type_test): Return void and accept file/line.
	(FFI_ASSERT): Pass stringized failed assertion.
	(FFI_ASSERT_AT): New macro.
	(FFI_ASSERT_VALID_TYPE): New macro.
	(UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
	UINT64, SINT64): Define here with gcc's __attribute__ macro
	instead of in ffi.h
	(FLOAT32, ALIGN): Define here instead of in ffi.h
	* include/ffi-mips.h: Removed.  Its content moved to
	src/mips/ffitarget.h after separating assembly and C sections.
	* src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
	src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
	src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
	src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
	SIZEOF_ARG -> FFI_SIZEOF_ARG.
	* src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
	* src/debug.c (ffi_assert): Accept stringized failed assertion.
	(ffi_type_test): Rewritten.
	* src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
	FFI_ASSERT_VALID_TYPE.
	* src/alpha/ffitarget.h, src/arm/ffitarget.h,
	src/ia64/ffitarget.h, src/m68k/ffitarget.h,
	src/mips/ffitarget.h, src/powerpc/ffitarget.h,
	src/s390/ffitarget.h, src/sh/ffitarget.h,
	src/sh64/ffitarget.h, src/sparc/ffitarget.h,
	src/x86/ffitarget.h: New files.
	* src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
	src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
	src/powerpc/aix.S, src/powerpc/darwin.S,
	src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
	src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
	src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
	src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
	src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
	include fficonfig.h

From-SVN: r72766
2003-10-21 21:01:58 +02:00
Alan Modra 2612ffce1f types.c (double, longdouble): Default POWERPC64 to 8 byte size and align.
* src/types.c (double, longdouble): Default POWERPC64 to 8 byte size
	and align.

From-SVN: r72432
2003-10-14 02:07:44 +09:30
Andreas Tobler 69b182fda6 types.c (double): Add AIX and Darwin to the right TYPEDEF.
2003-09-18  Andreas Tobler  <a.tobler@schweiz.ch>
	    David Edelsohn  <edelsohn@gnu.org>

	* src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
	* src/powerpc/aix_closure.S: Remove the pointer to the outgoing
	parameter stack.
	* src/powerpc/darwin_closure.S: Likewise.
	* src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
	according to the Darwin/AIX ABI.
	(ffi_prep_cif_machdep): Likewise.
	(ffi_closure_helper_DARWIN): Likewise.
	Remove the outgoing parameter stack logic. Simplify the evaluation
	of the different CASE types.
	(ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
	statement in the trampoline code.

Co-Authored-By: David Edelsohn <edelsohn@gnu.org>

From-SVN: r71530
2003-09-18 20:23:47 +02:00
Alan Modra 5af1c8062d types.c (double, longdouble): Merge identical SH and ARM typedefs, and add POWERPC64.
* 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.

From-SVN: r71295
2003-09-11 14:47:57 +09:30
Jim Wilson bc3cf76072 Fix Portable .NET bug with IA-64 pointer size.
* src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64.

From-SVN: r59541
2002-11-26 14:24:05 -08:00
Ulrich Weigand c4f17c6f58 configure.in: Add s390x-*-linux-* target.
* configure.in: Add s390x-*-linux-* target.
	* configure: Regenerate.
	* include/ffi.h.in: Define S390X for s390x targets.
	(FFI_CLOSURES): Define for s390/s390x.
	(FFI_TRAMPOLINE_SIZE): Likewise.
	(FFI_NATIVE_RAW_API): Likewise.
	* src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
	* src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
	* src/s390/ffi.c: Major rework of existing code.  Add support for
	s390x targets.  Add closure support.
	* src/s390/sysv.S: Likewise.

From-SVN: r57646
2002-09-30 11:59:42 +00:00
Kaz Kojima ddebdfebad Makefile.am: Add SH support.
* Makefile.am: Add SH support.
	* Makefile.in: Regenerate.
	* configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target.
	* configure: Regenerate.
	* include/ffi.h.in: Add SH support.
	* src/sh/ffi.c: New file.
	* src/sh/sysv.S: New file.
	* src/types.c: Add SH support.

From-SVN: r55574
2002-07-19 01:08:43 +00:00
Bo Thorsen c94974caed [multiple changes]
2002-07-16  Bo Thorsen  <bo@suse.de>

	* src/x86/ffi64.c: New file that adds x86-64 support.
	* src/x86/unix64.S: New file that handles argument setup for
	x86-64.
	* src/x86/sysv.S: Don't use this on x86-64.
	* src/x86/ffi.c: Don't use this on x86-64.
	Remove unused vars.
	* src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
	for x86-64.
	* src/ffitest.c (struct6): New test that tests a special case in
	the x86-64 ABI.
	(struct7): Likewise.
	(struct8): Likewise.
	(struct9): Likewise.
	(closure_test_fn): Silence warning about this when it's not used.
	(main): Add the new tests.
	(main): Fix a couple of wrong casts and silence some compiler warnings.
	* include/ffi.h.in: Add x86-64 ABI definition.
	* fficonfig.h.in: Regenerate.
	* Makefile.am: Add x86-64 support.
	* configure.in: Likewise.
	* Makefile.in: Regenerate.
	* configure: Likewise.

2002-06-24  Bo Thorsen  <bo@suse.de>

	* src/types.c: Merge settings for similar architectures.
	Add x86-64 sizes and alignments.

2002-06-23  Bo Thorsen  <bo@suse.de>

	* src/arm/ffi.c (ffi_prep_args): Remove unused vars.
	* src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
	* src/mips/ffi.c (ffi_prep_args): Likewise.
	* src/m68k/ffi.c (ffi_prep_args): Likewise.

From-SVN: r55571
2002-07-19 01:08:31 +02:00
Jon Beniston d6c4152ac0 configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
2001-03-27  Jon Beniston  <jon@beniston.com>

	* configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
	* configure: Rebuilt.
	* Makefile.am: Added X86_WIN32 target support.
	* Makefile.in: Rebuilt.

	* include/ffi.h.in: Added X86_WIN32 target support.

	* src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets.
	* src/types.c: Added X86_WIN32 target support.

	* src/x86/win32.S: New file. Based on sysv.S, but with EH
	stuff removed and made to work with CygWin's gas.

From-SVN: r40860
2001-03-27 03:39:16 +01:00
Nick Clifton 4d2cf7156f Remove RCS ident strings to allow comparisions with multiple source checkouts to work
From-SVN: r40195
2001-03-02 22:21:24 +00:00
Jakub Jelinek 3791773c93 Port to sparc 32 and 64 Linux.
From-SVN: r33196
2000-04-17 02:15:32 +00:00
Anthony Green 63e5e3e0db Initial revision
From-SVN: r28593
1999-08-08 13:27:18 +00:00