Fastcall support added to MinGW

Danny Smith danny_r_smith_2001@yahoo.co.nz
Fri Nov 2 18:54:00 GMT 2001


I have upload beta releases of gcc-2.95.3 and binutils-2.11.92
to MinGW's  Sourceforge File Release page:
https://sourceforge.net/project/showfiles.php?group_id=2435

These are labelled: 
gcc-2.95.3-20011106-beta  and binutils-2.11.92-20011113-beta


The main feature provided by these beta releases is the ability to use
fastcall functions with MinGW.
Thanks go to Eric Kohl for this feature.

On the Intel 386, the `fastcall' attribute causes the compiler to pass the
fist two arguments in the registers 
ECX and EDX. Subsequent arguments are passed on the stack. 
The called function  will pop the arguments off the stack. 
If the number of arguments is variable all arguments are 
pushed on the stack.


To use fastcall mark your functions like so:

int __fastcall foo(int a, int b);

This will produce symbol @foo$8 (and _imp_@foo@8
if marked as dllimport).

The --add-stdcall-alias and the --kill-at 
features of dlltool and ld remove all decoration from 
fastcall symbols, ie, they add the alias 

foo = @foo@n
 
However, the --enable-stdcall-fixup feature (which is on by
default) has not yet been extended to fastcall symbols.  
That is, an undefined symbol @foo@n will *not* 
automatically be resolved to a defined symbol foo. 

Th gcc snapshot also fixes a bug in profiling and changes 
gcc's handling of win32-thread support. 
The latter will not add any new functionality until mingw-runtime
has been updated.

The binutils beta also fixes two long-standing bugs in windres
affecting FONT attributes and child dialog boxes


Thanks again to Eric

Danny

http://briefcase.yahoo.com.au - Yahoo! Briefcase
- Manage your files online.



More information about the Cygwin-apps mailing list