best ABI strategy ?

Aurelien Buhrig aurelien.buhrig.gcc@gmail.com
Wed Nov 30 21:18:00 GMT 2011


2011/11/30 Georg-Johann Lay <avr@gjlay.de>:
> Aurelien Buhrig wrote:
>> Hi,
>>
>> I'm trying to optimize our target ABI, and I'm wondering what is the
>> best strategy to define it.
>> Is there a paper, or any hint, dealing with this topic ?
>> For instance,
>> - which ratio between call-used-reg vs "static regs"
>> - which ratio between arg regs vs call-used-reg
>> - what should be return regs
>> - ...
>> I guess this problem is very target dependent, but there are maybe
>> general ideas about this.
>
> If it's about new hardware/silicon/controller, it is a good idea to do a
> controller compiler co-design. That way you can get the best out of a new
> architecture as you have the most degrees of freedom to find a good point in
> the ISA/ABI plane.
>
> This requires of course to start the compiler development early and in a stage
> where the ISA is still work in progress, i.e. there is no final silicon but
> just an instruction set simulator for the upcoming hardware.
>
> In many cases, you cannot really say what's the best except you actually
> implement it and look how smooth it works.  My experience is that ISA designers
> just think up to the assembler level, but have no idea how a compiler works and
> what it needs and which features it can use and which not.
>
> If the silicon/ISA is already fix and there is no feedback possible, it is
> often easy to parametrize different ABI flavours through compiler switches so
> you can benchmark, switch back and forth between ABIs and see what their pros
> and contras are.
>
> Johann

Hi Johann,

We actually tried to optimize both the ISA and the compîler for the
new extended version, although there was some legacy. Now ISA is
almost fixed. I'm just trying to see which register convention is the
best. I will try to use/define those switches to benchmak the ABI, but
I wanted to know if such studies were available.

Thanks for your reply,
Aurélien



More information about the Gcc-help mailing list