[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] MiNTLib 0.51
Guido Flohr wrote:
> Is that really worth the while? I mean, the code has to do extra work to
> spread the arguments on the registers and there is less space for local
> register variables.
No extra work. The stack is bypassed for those arguments.
The arguments are placed in the work registers (D0-D2,A0/A1,FP0-FP2)
and then only moved elsewhere if the function needs that work register.
This speeds small functions (with relatively huge call overhead and
not very much local variables) immensely up.
The effect on the size of the code can be dramatic (in positive sense).
Also small functions tend to be called frequently, which multiplies the effect.
Quite often, if a argument is passes to a deeper function, it happens
to be already in the correct register. :-)
Arguments are of course themselves local variables, and quite often the
more important.
In large functions the benefit is of course less significant.
Greetings
Henk