Code optimization <LEA Instruction>
Jeffrey B. Siegal
jbs en quiotix.com
Sab Ene 29 23:14:26 CST 2000
owner-linux-kernel-digest en vger.rutgers.edu wrote:
> On Crusoe I guess the cost of redundant instructions is not so
> significant once they've been through a translation pass, but for those
> instruction streams getting interpreted, and for the speed of
> translation itself, it still makes sense to keep the number of
> instructions (and their size) to a minimum.
Which, interestingly, suggests that -Os (or something like it) is what you
want.
> I wouldn't be surprised if inlining is less important. Crusoe is a sort
> of JIT and would seem well placed to auto-inline things in the
> appropriate, dynamically determined manner.
Inlining can be important to allow cascading optimizations, as in:
int do_it(mode, arg1, arg2, arg3)
{
switch(mode) {
case 1:
... break;
case 2:
... break;
...
}
}
int
fun(args)
{
...
a = do_it(1, arg1, arg2, arg3)
...
}
On the other hand, inlining, as a tradeoff of size for speed, might actually
be bad (the out-of-line function can get translated once, but inline it needs
to get translated at each call-site).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda