This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


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

Fwd: Patch: MinGW fastcall support


I have asked Eric to submit patches to binutils and gcc-patches.
Any comments?

Danny


--- Eric Kohl <ekohl@rz-online.de> wrote: > From: "Eric Kohl"
<ekohl@rz-online.de>
> To: "Danny Smith" <danny_r_smith_2001@yahoo.co.nz>
> Subject: Patch: MinGW fastcall support
> Date: Sun, 24 Jun 2001 20:34:37 +0200
> 
> Hello, Danny!
> 
> I have just completed patches that implement fastcall support to the
> current
> mingw version (gcc-2.95.3-4 and binutils-2.11.90).
> 
> The 'gcc' patch is based on a patch I found on the net. The original
> patch
> (from July 2000) implemented argument passing via ecx and edx, but
> function
> labels we not generated correctly. I added the code to generate
> decorated
> fastcall symbols.
> 
> The binutils patch enables 'as' to handle fastcall symbols. It also
> extends
> 'dlltool' to create import libraries and export tables that contain
> fastcall
> functions.
> 
> These patches were successfully tested with a modified version of the
> ReactOS source code. The current cvs source treats fastcall functions
> as
> stdcall functions.
> 
> Please apply these patches to the mingw source tree.
> 
> Best regards,
> Eric Kohl
> 
> 
> Change log for fastcall_gcc.diff:
> 
> gcc/ChangeLog:
> 
> * gcc/config/i386/crtdll.h:
> (CPP_PREDEFINES): Add fastcall attributes.
> 
> * 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/mingw32.h:
> (CPP_PREDEFINES): Add fastcall attributes.
> 
> * gcc/config/i386/win-nt.h:
> (CPP_PREDEFINES): Add fastcall attributes.
> (ENCODE_SECTION_INFO): Decorate fastcall function.
> 
> * 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 two registers and enable swapping of
> eax and
> ecx.
> (function_arg): Swap eax and ecx.
> 
> * gcc/config/i386/i386.h:
> (CUMULATIVE_ARGS): Add flag to indicate register swapping.
> 
> * 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.
> 
> 
> 
> ChangeLog for fastcall_binutils.diff:
> 
> binutils/ChangeLog:
> 
> * binutils/deflex.l:
> Accept at-sign as first character of an ID.
> 
> * binutils/dlltool.c:
> (scan_drectve_symbol): Search for last at-sign instead of first.
> (scan_filtered_symbol): Search for last at-sign instead of first.
> (gen_exp_file): Generate microsoft-compatible fastcall symbols.
> (xlate): Undecorate fastcall symbol.
> (make_label): Decorate fastcall symbol.
> (make_one_lib_file): Generate microsoft-compatible fastcall symbols.
> 
> * gas/config/te-pe.h:
> (AT_LEX): Accept at-sign (@) as first character of a label.
> 
> 

> ATTACHMENT part 2 application/x-compressed name=fastcall-patches.tgz







_____________________________________________________________________________
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!

fastcall-patches.tgz


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