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

Re: [f-cpu] calling conventions




> So recursive function always requires stack operations but as the callee is
in
> charge to save what must callee-saved, for n recursive calls, we just save
n-1
> times callee-saved registers instead of n if caller-saved.

Hum forget it... it would be n times and not n-1...

In fact, what we could reproach against recursivity in imperative languages
like C or Pascal, most of those language compilers tend to save redundant and
unecessary data in recursive calls.

Maybe a very intelligent compiler could just prepend the saving of only
necessary data just before a recursive call and append the restoring of
necessary data just after a recursive call. Is it feasible ? I dunno...




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