This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Arguments in registers
- From: Ravishankar S <ravishankar dot s at hathway dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 25 Sep 2006 20:37:10 +0530
- Subject: Arguments in registers
Greetings,
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
arguments.
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,
Ravishankar