Jump to content
PkK

SDCC maybe changing the default ABI

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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?

 

 

 

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

SDCC has gone ahead with this. In the upcoming SDCC 4.2.0, the default ABI uses register arguments.

 

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...