Hi,
I just made my program ~3% faster, perhaps more (nothing to do with chess) by forcing the compiler to use __fastcall instead of the default __cdecl.
I wonder whether using __fastcall would have the same effect with PGO enabled.
Could someone verify this? I believe it may be a nice speedup for the windows build of a chess engine, if it would hold with PGO.
It may but it may not. I especially wonder what compiler experts have to say about it
I read about this optimization tip many years ago from Dann Corbit and use it whenever possible with Msvc
although I found it produces instability with some chess engine code, so you must be careful. If I used with Intel, binary would always crash or become unstable.
mar wrote:Hi,
I just made my program ~3% faster, perhaps more (nothing to do with chess) by forcing the compiler to use __fastcall instead of the default __cdecl.
I wonder whether using __fastcall would have the same effect with PGO enabled.
Could someone verify this? I believe it may be a nice speedup for the windows build of a chess engine, if it would hold with PGO.
It may but it may not. I especially wonder what compiler experts have to say about it
Martin
Hi,
Just in case you didn't already know - this option is ignored for 64bit builds. The x64 ABI defines only one calling convention, __fastcall.
I read about this optimization tip many years ago from Dann Corbit and use it whenever possible with Msvc
although I found it produces instability with some chess engine code, so you must be careful. If I used with Intel, binary would always crash or become unstable.
That's interesting Jim, I only noticed some compile time problems with libpng and tremor where some callback function ptrs were explicitly declared as __cdecl and thus incompatible with __fastcall, didn't know about stability issues though. I guess I'll be happy with cdecl then. Thanks for clarifying this to me.
Thanks Richard I didn't know that. It seems logical though because as far as I understand 64-bit mode has more registers available than x86 mode. Thanks for the insight.