public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Trampolines on Harvard architecture?
@ 2013-04-09  1:24 James Bowman
  2013-04-09  6:45 ` Chung-Ju Wu
  2013-04-10  4:24 ` Ian Lance Taylor
  0 siblings, 2 replies; 3+ messages in thread
From: James Bowman @ 2013-04-09  1:24 UTC (permalink / raw)
  To: gcc-help

Do any Harvard architecture targets attempt support for trampolines?

It seems that some limited support is feasible, but if every other
Harvard architecture bails on trampolines, I'll follow the pack.

Thanks

--
James Bowman
http://www.excamera.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trampolines on Harvard architecture?
  2013-04-09  1:24 Trampolines on Harvard architecture? James Bowman
@ 2013-04-09  6:45 ` Chung-Ju Wu
  2013-04-10  4:24 ` Ian Lance Taylor
  1 sibling, 0 replies; 3+ messages in thread
From: Chung-Ju Wu @ 2013-04-09  6:45 UTC (permalink / raw)
  To: James Bowman; +Cc: gcc

2013/4/9 James Bowman <jamesb@excamera.com>:
> Do any Harvard architecture targets attempt support for trampolines?
>
> It seems that some limited support is feasible, but if every other
> Harvard architecture bails on trampolines, I'll follow the pack.
>
> Thanks
>
> --
> James Bowman
> http://www.excamera.com/

I think the point of supporting trampolines is saving static chain value
rather than Harvard/von-Neumann architectures.

Here is a thread for your reference:
http://gcc.gnu.org/ml/gcc/2005-03/msg00684.html


Best regards,
jasonwucj

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trampolines on Harvard architecture?
  2013-04-09  1:24 Trampolines on Harvard architecture? James Bowman
  2013-04-09  6:45 ` Chung-Ju Wu
@ 2013-04-10  4:24 ` Ian Lance Taylor
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2013-04-10  4:24 UTC (permalink / raw)
  To: James Bowman; +Cc: gcc-help

On Mon, Apr 8, 2013 at 6:24 PM, James Bowman <jamesb@excamera.com> wrote:
> Do any Harvard architecture targets attempt support for trampolines?
>
> It seems that some limited support is feasible, but if every other
> Harvard architecture bails on trampolines, I'll follow the pack.

On a true Harvard architecture, for which there is absolutely no way
to write data to the instruction memory, then trampolines are fairly
difficult to implement.  Most systems like that do not bother to
implement trampolines.

That said, on a true Harvard architecture you normally have control
over the ABI.  And that means that you can use a slightly unusual
representation of a function pointer: you can make a function pointer
be a pointer to a function descriptor.  Most ABIs on the PPC do this.
The descriptor contains (at least) two words: a pointer to the code in
instruction memory, and a value to load into the static chain register
before jumping to that code.  Calling a function pointer becomes a
multi-instruction sequence: load the static chain register and then
branch to the code.  With this approach, trampolines do not require
writing into instruction memory.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-10  4:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09  1:24 Trampolines on Harvard architecture? James Bowman
2013-04-09  6:45 ` Chung-Ju Wu
2013-04-10  4:24 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).