This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 19/36][mips] Hookize static chain and trampoline macros


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]