This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Arguments in registers
- From: Ian Lance Taylor <iant at google dot com>
- To: Ravishankar S <ravishankar dot s at hathway dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 25 Sep 2006 10:04:37 -0700
- Subject: Re: Arguments in registers
- References: <000001c6e0b4$46998880$d346fe3c@lab102371>
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