PkK Posted August 14, 2021 Share Posted August 14, 2021 There has been some work on a change of the ABI in SDCC. It is not yet decided if the change will go ahead. Basically, such a change would break existing asm code (as the way parameters and return values are passed)¹, but would give an improvement in code size and speed. In particular, the new ABI would pass some parameters in registers, would pass the return values in different registers, and for some function the cleanup of stack parameters would be done by the callee instead of the caller. More details can be found in the SDCC feature request: https://sourceforge.net/p/sdcc/feature-requests/732/ Work is happening the in the breaktheworld branch, where the new ABI is the default, and mostly working (in particular, banked calls, i.e. for the ColecoVision using a Megacart is not yet working there). ¹ There is a way to mark individual functions as using the old ABI via __sdcccall(0) to continue using existing asm functions from C code compiled for the new convention. Quote Link to comment Share on other sites More sharing options...
youki Posted August 14, 2021 Share Posted August 14, 2021 Would'nt be better to maker individual functions as using the new ABI a let the old by default? Or having a parameter in the compiler to active new ABI if we want? Quote Link to comment Share on other sites More sharing options...
PkK Posted August 14, 2021 Author Share Posted August 14, 2021 There would also be a --sdcccall N option to set the default. The final change of default ABI, if it happens would change the default in case of absence of --sdcccall N or __sdccall(N), and set the default for the precompiled standard library. Quote Link to comment Share on other sites More sharing options...
PkK Posted February 10, 2022 Author Share Posted February 10, 2022 SDCC has gone ahead with this. In the upcoming SDCC 4.2.0, the default ABI uses register arguments. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.