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

Re: [f-cpu] Register allocation when calling a function



Hi,

> > > You overlooked the fact that `var' parameters in Pascal are actually
> > > pointers, although they don't look that way. The same is true for
> > > reference types in C++.
> > That depend on your compiler, no ?
> > So who disagree with adding this recommandation into the manual ?

> I don't disagree (if it is needed, then it's not a bad thing to put it).

> However, i wouldn't make this mandatory.

> My reasoning behind this is : call/return conventions are designed for
> computers of the 80's and 90's with 16 or 32 registers, F-CPU has twice
> more. It sounds simple to simply double all numbers but this sounds like
> using old methods for new computers : you can't win much there.
Euh, I hope that I didn't understand what you say. Did you mean that we must 
continu to use the normal stack call + save all the registers ? Or did you 
have an other idea ? (Don't forget that we must have a call convention so 
that we can start to write F-CPU asm and compiler).

> Today's most advanced compilers can perform in-depth analysis of the
> programs and find the (mostly) optimal register allocation : they examine
> the data life length and their usage statistics, decide whether and how
> long to put (swap) them in memory and even modify other parts of the
> program to enhance the register reuse.
It really depend on the language and it's capacity to explain how the 
application work. I think for example that in eiffel we can have a more 
quicker application than in a pure C program, because you know all the world 
and in one case and only a part of it in the second case.

So fixing some call convention will be needed, so that we can discuss from a 
language to an other.

> If there was a mandatory allocation, these advanced compilers (something
> that looks like a "synthesiser" in the ASIC world) won't be able to compile
> anything more than leaf functions. That would be pretty useless.

> I hope to be not too much misunderstood,
Euh,... I think that I didn't understand what you mean ! ;-(

A+
  Cedric
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/