Page 1 of 1
mutliple abi attributes

Posted:
Sat Aug 02, 2014 6:48 am
by notzed
How hard would it be to add a function attribute to gcc that specified different abis?
The main use would be to specify one which changes most of the registers to callee saved so that calling small library functions wont have the impact of requiring work registers to be unnecessarily saved and restored from an application "leaf" function. It would be an interlock so that any function with it set could only call similarly attributed functions (or ones with further restrictions).
Re: mutliple abi attributes

Posted:
Sun Aug 03, 2014 4:59 pm
by aolofsson
notzed,
I agree that this would be very useful for leaf cells. It is certainly possible with a user specified flag. We'll see what we can do.
Check out -mfp-mode in the current e-gcc flags.
https://gcc.gnu.org/onlinedocs/gcc-4.7. ... tions.htmlAndreas
Re: mutliple abi attributes

Posted:
Mon Aug 04, 2014 11:25 am
by notzed
Cool, i'll keep an eye out.
Yeah i've had a good play with most of the flags. fp-mode is definitely one of the most important particularly if one mixes any integer/float.
Re: mutliple abi attributes

Posted:
Wed Aug 06, 2014 11:46 am
by timpart
I must admit to being curious as to whether making the Stack Pointer R7 would make a significant difference to code size. Currently all saving and restoring of registers in a function uses word sized instructions because SP isn't one of R0 to R7.
Function starts are aligned to word boundaries at the moment and I can't find a way of reducing that. (GCC has options to specify alignment but using them makes GCC create an additional align instruction after aligning to a word.)
Tim
Re: mutliple abi attributes

Posted:
Wed Aug 06, 2014 1:41 pm
by amylaar
Re: mutliple abi attributes

Posted:
Wed Aug 06, 2014 1:43 pm
by amylaar
Re: mutliple abi attributes

Posted:
Thu Aug 07, 2014 10:06 am
by notzed