[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rep:[f-cpu] Another proposition for a call convention



hello,

Though this is not such a HW-related topic,
i'm trying to cleanup my mailbox and read some of the mails...

Michael Riepe wrote:


> The `global pointer' register is an invention of mine; it is supposed
> to point to a well-defined address inside the address space of a process
> (e.g. at the beginning of the .data segment), in order to ease addressing:
> with a global pointer, you can use pointer-relative addressing for global
> data (and probably also for code), avoiding time-consuming relocations
> at load time (which in turn improves shareability of code pages). An
> additional `local pointer' will be useful for shared libraries; but we
> can also use one of the `callee-saved' registers for that.

In those discussions, you seem to forget one point :
the "stack" is accessed through load and stores that
only accept "register" addressing. Register post-increment
is an addition that allows you to emulate "push" and "pop".

If you want to access the stack in "random"/arbitrary order,
you'll have first to copy the stack pointer (or whatever base pointer,
frame pointer, whatever closest) and use several post-incremented
loads and stores, possibly needing several copies of the original
stack pointer if you need to interleave consecutive reads or writes.

If you can stay inside the register set, do it.
You can leave arrays outside (it's more practical for pointer stuffs)
but leave the counters and all other management stuff inside the
register set...

WHYGEE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/