At 11:44 AM 4/28/2002 -0400, Dan Sugalski wrote: >At 7:00 AM +0100 4/27/02, Piers Cawley wrote: >>Andrew J Bromage <[EMAIL PROTECTED]> writes: >> >>> G'day all. >>> >>> On Fri, Apr 26, 2002 at 08:16:27AM -0400, Melvin Smith wrote: >>> >>>> I also vote for reserving some caller-save registers to make >>>> arg passing faster, however, reserving 16 is probably useless, except >>>> for symmetry. >>>> >>>> I think most texts agree that 5 or so are about all you need. >>> >>> Fair enough. In that case, in the interests of using round numbers, >>> I vote for X0-X7 to be for argument passing and, in the event that >>> they're not actually used for argument passing, caller-save. >> >>I'm trying to see how, if you want genuine continuations and/or tail >>call optimization, you're going to get away with anything but 'caller >>saves everything important to it', and what do you know, I >>can't. A decent compiler will obviously optimize away some of the >>saving of 'extras' for relatively simple subroutine calls, but at the >>limit you're going to need to presave everything surely. > >We're going caller-save. I think I made this declaration before, but now >it's backed up with pure PDD goodness. :)
I don't think I and Andrew were saying we shouldn't do caller-save, we were just discussing that the calling convention (read activation record of a subroutine) should support the common optimization of passing args in scratch registers when it might make sense. Having scratch registers and/or allowing passing in registers says nothing about whether you can implement co-routines or continuations how you see fit nor whether a caller saves its environment correctly or not. Leaving something important in a register across a call is different from _passing_ a parameter to the routine. Anyway, from reading the PDD you just posted, it appears you have reserved a place in the spec for just this thing. -Melvin