Arguments in registers

Ian Lance Taylor iant@google.com
Mon Sep 25 17:05:00 GMT 2006


Ravishankar S <ravishankar.s@hathway.com> writes:

> 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.

It won't make much difference.  There are other architectures with
similar characteristics.  For example, on MIPS arguments are passed in
$4 through $7 or $11 (depending on the ABI), but values are returned
in $2 and $3.

> 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. 

The return registers are essentially just caller-saved scratch
registers.

I suppose if you are short on registers you might prefer to have more
callee-saved registers.  But if you have enough registers, it doesn't
matter much either way.

Ian



More information about the Gcc-help mailing list