Dan --

On Fri, 2001-10-26 at 16:38, Dan Sugalski wrote:
> Okay, here are the conventions.

Looks like I'm going to have to write some real logic in jakoc
pretty soon...

> *) The callee is responsible for saving and restoring non-scratch registers

Nice for callee since if its work fits into five regs of each type
its not going to have to do any saves or restores. Caller, though, is
going to have to vacate those regs. So, if caller got args in those
regs and then calls anyone else, it has to move them from those regs (or
save them).

> *) The first five registers (I0-I4, S0-S4, P0-P4, N0-N4) are scratch and do 
> not have to be preserved by the callee

Still thinking about this... We are reducing the overall number of reg
copies going on by adding these special cases. I just wish we had an
approach that was both uniform (simple, no special cases) and fast too.

> *) In *ALL* cases where the stack is used, things are put on the stack in 
> *reverse* order. The topmost stack element *must* be the integer count of 
> the number of elements on the stack

OK.

> *) The callee is responsible for making sure the stack is cleaned off.

So, in the case of zero args, do we still push a zero on the stack to
make a proper frame? I think yes...

> 
> Inbound args
> ============
> If the called subroutine has a fixed number of arguments, they will be 
> placed in the first five registers of the appropriate register types. First 
> integer goes in I0, second in I1, and so on.
> 
> If there are too many arguments of a particular type the overflow go on the 
> stack. If there are a variable number of arguments, all the *non* fixed 
> args go on the stack.

So for right now, just pretend that all Jako subroutines take a variable
number of args.. :) (Until I get the time to write fully compatible
conventions in jakoc, anyway).

Can we have ops to inquire on the type of the topmost stack entry?

[snip]


Regards,
 
-- Gregor
 _____________________________________________________________________ 
/     perl -e 'srand(-2091643526); print chr rand 90 for (0..4)'      \

   Gregor N. Purdy                          [EMAIL PROTECTED]
   Focus Research, Inc.                http://www.focusresearch.com/
   8080 Beckett Center Drive #203                   513-860-3570 vox
   West Chester, OH 45069                           513-860-3579 fax
\_____________________________________________________________________/

Reply via email to