Benjamin Goldberg wrote:

Dan Sugalski wrote:

Yeah, 32 is a bunch. I've considered going with 16 on and off, and
still might.


16 is not enough for non trivial subroutines. E.g. the _Generate sub in life.p6 consumes 25 P regs.


Given that registers are allocated with the lower numbers being the ones
used more often, how about having 32 registers, as we now have, but two
different ops for saving -- one of which saves registers 0 .. 15, the
other saves all 0 .. 31.  Or is this just a dumb idea?

I think, this is a good idea. For caller-save subroutines we could have:


saveall 10,0,1,2 # save I0..I9, no S, P0, N0..N1
...
restoreall 10,0,1,2
ret

accompanied with push{i,s,p,n}_i and pop{i,s,p,n}_i, for saving/restoring just a certain amount of one kind of registers.

leo



Reply via email to