Arguments in registers

Ravishankar S
Mon Sep 25 15:07:00 GMT 2006


This may probably be the wrong mailing list to ask this question. But
due to many compiler experts in this list,
I hope to get this clarified. 

The issue is about passing arguments in registers: Most of the RISC
architecture's I presume, pass function arguments in registers, as its
faster. For example in PowerPC arguments are passed in r3-r7 and return
value is in r3 (for 32 bit return values). The same registers are used
for passing arguments and for return values. It is the same case with
ARM. I also think that it's the same case with other RISC architectures.

But TriCore's EABI specifies separate registers for passing arguments
and returning values. D2-D3 for returning values and D4-D7 for passing

My question is : Will it make a difference from a compiler writer's
point for this type of calling convention. From experience, will it make
for a differnce in performance.

On the surface, it seems like it does, as there most of functions do not
return values and most anyway don't return 64 bit values. So reusing the
registers as PowerPC does may be better. 

Any insigths ?

Best Regards,

More information about the Gcc-help mailing list