[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] calling conventions



On Fri, Jun 07, 2002 at 02:57:16AM +0200, Christophe wrote:
[...]
> Okay, now I do know why GCC always refuse to mix register and stack parameters,
> because of the sacrosanctity of this ugly legacy.

Well, that's reality. And as we all know, it does suck.

BTW: you *can* mix calling conventions with gcc by using
__attribute__((regparm ...)) if all your functions are properly
declared. You just can't control the calling conventions for individual
arguments (like `first on the stack, second in a register, third on the
stack again').

> Well, I must admit that I don't like this calling convention but regarding with
> your last argument, more intelligent rules are things best forgotten. Sorry for
> annoying you so much.

`I don't like it' isn't an argument, is it? And `more intelligent' is at
least a debatable attribute. `Keep it simple' is IMHO a very intelligent
rule. Everything more complex will cause you headaches sooner or later.

With respect to the memory load/store capabilities (or inabilities) of the
F-CPU, I think that passing arguments in registers is the best choice.
The other simple alternative - putting all arguments on the stack -
will be much slower (and also produce longer code).

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/