Registers, registers, who's got the registers?

Elian on 2001-05-23T16:41:36

I've been contemplating registers lately. Perl's interpreter has always been a stack-based one, and that's fine, but I'm really wanting Parrot's (AKA "The perl 6 interpreter") model to be register based rather than stack based. And yes, for those of you who're keeping track, the internals of perl 6 are tending more towards that of a CPU than software. Consider Parrot to be a VAX (with all the extensions) on steroids.

That's fine, as far as it goes, but then it brings up the next question--what sort of registers? Should they hold only PMCs? Should there be multiple types, like most modern CPUs do? (The separate intger and float register sets, for those of you that don't hit the metal) I'm currently thinking a set of integer, float, string, and PMC registers, but... should they be independent? Linked? Should the int & float registers be able to hold both normal and big types? (Or should they be split?)

Decisions, decisions...

And, of course, there's always the question of whether this is the right tack to take anyway. Some of the reasons registers are best for hardware don't really apply to software based CPUs (no pipeline, no processing multiple instructions at once, no real performance hit going off-chip), and the reasons for a stack-based software architectures aren't that compelling either. (Simplicity for one--simple is nice, fast is nicer)

Ah, well, something to chew on for perl6-internals, I think.