James --

> Hey all.  I just looked through the changes to jakoc, and I think the
> calling convention is mostly good... except for the return address.
> 
> Originaly, I thought that perhaps it'd be good to put the return address
> after the args on the stack, so that once you've eaten the args, it's in the
> right position to ret without doing any swaps.

I just put in the 'rotate' op Dan requested instead of 'swap', and it begs
the question:

   Should we have bsr(i|ic, i|ic), that jumps to $1, with the return
   address below the $2 arguments? Similarly, should we have ret(i|ic),
   that rotates the return address out from under $1 arguments and then
   returns to it?

These don't have to be instead of the exising ops. They can be in addition
to them (since the current ops are equivalent to a final 0 arg in the
new ones).
 
> OTOH, we could keep our current ABI, and pop the return address into an I
> register, and then push it and ret, or jmp to it.

The return address is a pointer, which doesn't necessarily fit in an IV,
I believe. I played with doing this first, but didn't like having to use
a register for it. If we wanted registers to be part of the calling
convention, we should just say so, but again we run into the question of
which type of register to use.


Regards,

-- Gregor

Reply via email to