This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fastcall support on cygwin and mingw targets


This patch implements support in gcc for the fastcall calling
convention on cygwin and mingw targets.

When using the fastcall calling convention, parameters are
(if possible) passed in registers, thereby eliminating
the need to use the stack for transferring parameters.

Binutils support for fastcall symbols is already in binutils CVS.

Casper Hornstrup


gcc/testsuite/ChangeLog

2002-11-10  Casper S. Hornstrup  <chorns@users.sourceforge.net>

	* gcc.c-torture/compile/20021110-1.c: New test.
	* gcc.c-torture/compile/20021110-1.x: Likewise.
	* gcc.c-torture/compile/20021110-2.c: Likewise.
	* gcc.c-torture/compile/20021110-2.x: Likewise.
	* gcc.c-torture/compile/20021110-3.c: Likewise.
	* gcc.c-torture/compile/20021110-3.x: Likewise.
	* gcc.c-torture/compile/20021110-4.c: Likewise.
	* gcc.c-torture/compile/20021110-4.x: Likewise.


gcc/ChangeLog

2002-11-10  Danny Smith  <dannysmith@users.sourceforge.net>

	* config/i386/i386.c (ix86_comp_type_attributes): Check for
mismatched
	fastcall types.

2002-11-10  Eric Kohl  <ekohl@rz-online.de>

	* config/i386/cygwin.h (TARGET_OS_CPP_BUILTINS): Add fastcall
	attributes.
	(ASM_OUTPUT_LABELREF): Add __imp_ prefix now rather than in
winnt.c.
	* config/i386/winnt.c (i386_pe_mark_dllimport). Convert internal
	fastcall decoration to MS-compatible decoration. Add __imp_
prefix in
	ASM_OUTPUT_LABELREF rather than here.
	* config/i386/i386.c (ix86_attribute_table): Accept 'fastcall'
as a
	valid attribute.
	(ix86_return_pops_args): Fastcall functions pop the stack.
	(init_cumulative_args): Reserve registers ECX and EDX if
function has
	fastcall attribute.
	(function_arg): Use registers ECX and EDX if function has
fastcall
	attribute.
	* config/i386/i386.h (CUMULATIVE_ARGS): Add fastcall attribute
flag.
	* config/i386/mingw32.h (TARGET_OS_CPP_BUILTINS): Add fastcall
	attributes.
	* config/i386/winnt.c (gen_fastcall_suffix): New function.
Decorates a
	label name with a preliminary fastcall prefix (+) and the
stdcall
	suffix.
	(i386_pe_encode_section_info): Call gen_fastcall_suffix() if a
symbol
	has a fastcall attribute.
	(i386_pe_strip_name_encoding): Return length of internal
fastcall
	prefix (+).
	(i386_pe_fastcall_name_p): New function. Returns wether a symbol
is a
	fastcall symbol.
	(i386_pe_asm_file_end): Output fastcall symbols correctly.
	* doc/extend.texi: Add documentation of fastcall attribute.

Attachment: fastcall.tar.gz
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]