This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch 19/36][mips] Hookize static chain and trampoline macros
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Sep 2009 19:07:07 +0100
- Subject: Re: [patch 19/36][mips] Hookize static chain and trampoline macros
- References: <4AB7F353.3060707@redhat.com> <4AB804EC.8040809@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> Your trampoline can be greatly simplified for N32 and N64 abis. Recall
> that the current address is passed in via $25. Which simplifies your
> trampoline to e.g.
>
> lw $1,20($25)
> lw $25,16($25)
> jr $25
> nop
Ah, good point.
FTR, this is a "hosted" vs. "freestanding" thing really. Non-abicalls
o32, n32 and n64 all use arbitrary pointers while the abicalls versions
all use $25. Same goes for VxWorks kernel mode vs. RTP mode. Maybe the
worry was that it wasn't worth complicating things, but...
> And why emit raw integers to the template? It just makes things a bit
> confusing in my opinion. Integers are of course acceptable if you're
> not going to use a template...
...that's an excellent question. I've no idea.
Using asm would certainly make it easier to handle the $25/not-$25 and
pointer size differences. (As will having it all in mips.c, so thanks
for that.) I'll give it a go.
Richard