Re: Why Plan 9 C compilers don't have asm("")

From: Richard Henderson (rth@twiddle.net)
Date: Sun Jul 22 2001 - 01:49:52 EST


On Sat, Jul 21, 2001 at 08:43:43PM -0700, Linus Torvalds wrote:
> So:
> - you _always_ generate the fast case. A call is always considered to be
> a short one, simple "bsr", no GP change, no nothing.
> - you generate a trampoline as well, and teach the linker to go through
> the trampoline if it has to do a far call (one trampoline per target,
> not per caller). Think of it as a "overflow" case for a .rel20.

This is all well and good if one is designing an ABI from scratch.
You can't retrofit it onto the current ABI, however. Not without
pain anyway.

The call-clobbered GP means that your trampoline has to play games
in order to get the GP restored when coming back from an intra
module call. Which means a new stack frame. Which is a tad more
than you bargined for, really. I can't see that kind of heavyweight
solution being any better than the nops.

r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:15 EST