iDevGames Forums
__fastcall calling convention on iPhone - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: __fastcall calling convention on iPhone (/thread-8015.html)



__fastcall calling convention on iPhone - Dimka - Aug 21, 2010 10:47 AM

Does anybody knows how to make __fastcall calling convention as a default?


RE: __fastcall calling convention on iPhone - OneSadCookie - Aug 21, 2010 11:42 AM

__fastcall is an i386 (and largely Windows) thing which makes better use of the small number of registers on i386. The phone is ARM, and has plenty of registers, and therefore no such problem.


RE: __fastcall calling convention on iPhone - Dimka - Aug 21, 2010 03:13 PM

(Aug 21, 2010 11:42 AM)OneSadCookie Wrote:  __fastcall is an i386 (and largely Windows) thing which makes better use of the small number of registers on i386. The phone is ARM, and has plenty of registers, and therefore no such problem.

I'm not so good familiar with ARM/x86 architectures, but as far as i know, x86 processors has more general purpose registers, but that's not the point! You are wrong with purpose of __fastcall, it's used to call functions quicker because firs 2 integer parameters are send throught registers, all other - throught stack (in __cdecl\__stdcall all parameters are send through stack). So i hoped i can get this little profit on iPhone. Anyway, thx for answer!


RE: __fastcall calling convention on iPhone - OneSadCookie - Aug 21, 2010 03:35 PM

ARM has 16 general purpose integer registers, i386 has 4. On ARM, the first 4 integer parameters are always passed in registers:

http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html