From: Kevin S. <sch...@kw...> - 2011-05-20 00:12:12
|
Hi folks, LLVM has support for multiple calling conventions. In principle someone could eventually define additional calling conventions to match IAR, gcc (if that is not the default), or others. But the two important ones (quoting from the assembly reference) are - > "ccc" - The C calling convention: > This calling convention (the default if no other calling > convention is specified) matches the target C calling conventions. > This calling convention supports varargs function calls and > tolerates some mismatch in the declared prototype and implemented > declaration of the function (as does normal C). > "fastcc" - The fast calling convention: > This calling convention attempts to make calls as fast as > possible (e.g. by passing things in registers). This calling > convention allows the target to use whatever tricks it wants > to produce fast code for the target, without having to conform > to an externally specified ABI (Application Binary Interface). Optimization promotes calls to fastcc where possible (generally, if the function has fixed arguments and is not externally visible). I think in the (not very) long term the normal use case for AVR would be to have libraries of LLVM bitcode, rather than object code, and to do link-time whole-program optimization. Then nearly all calls could be promoted to fastcc, and the performance of the external calling convention is moot. The fastcc is not externally visible, so it can be changed over time. Regards, -- Kevin Schoedel <sch...@kw...> VA3TCS |