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]

[PATCH]: Fastcall support, 3rd. try


Hi!

The attached patch (against current CVS) implements the fastcall calling
convention for i386 on Win32 systems (CygWin/MinGW).

I fixed the remaining bugs of the previous patch.

Regards,
Eric Kohl



gcc/ChangeLog:

* gcc/config/i386/cygwin.h:
(CPP_SPEC): Add fastcall attributes.
(I386_PE_STRIP_ENCODING): Return length of internal fastcall prefix (+).
(ASM_OUTPUT_LABELREF): Convert internal fastcall symbol to official fastcall
symbol.

* gcc/config/i386/i386.c:
(i386_valid_type_attribute_p): Accept 'fastcall' as a valid type attribute.
(i386_return_pops_args): Fastcall functions pop the stack.
(init_cumulative_args): Reserve registers ECX and EDX if function has
fastcall attribute.
(function_arg_advance): Take care of argument type restrictions of fastcall
functions.
(function_arg): Use registers ECX and EDX if function has fastcall
attribute.

* gcc/config/i386/i386.h:
(CUMULATIVE_ARGS): Add fastcall attribute flag.

* gcc/config/i386/mingw32.h:
(CPP_SPEC): Add fastcall attributes.

* gcc/config/i386/win32.h:
(CPP_PREDEFINES): Add fastcall attributes.
(ENCODE_SECTION_INFO): Decorate fastcall function.

* gcc/config/i386/winnt.h:
(gen_fastcall_suffix): New function. Decorates a label name with a
preliminary fastcall prefix (+)
and the stdcall suffix.
(i386_pe_encode_section_info): Calls gen_fastcall_suffix() if a symbol has a
fastcall attribute.

* gcc/doc/extend.texi:
Added documentation of fastcall attribute.


gcc-fastcall.diff.gz


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