Paolo Molaro <lupus@debian.org> writes: > >It's easier to generate code for a stack machine True, but it is easier to generate FAST code for a register machine. A stack machine forces a lot of book-keeping either run-time inc/dec of sp, or alternatively compile-time what-is-offset-now stuff. The latter is a real pain if you are trying to issue multiple instructions at once. > >Too bad less than 1 % of the people that will use parrot have >an alpha or a Cray. Optimize for the common case. The common case will be Pentium-III+ or IA64. P-III+ are multi-issue machines with lots of registers and re-naming (the fact that they do a "run-time compile" to that form from 386 binary ops is a pain.) Explicit stack ops are going to give them indigestion. The P-III+ model is that most things are "on the C stack" i.e. offsets from the few "base" registers. The hardware then "aliases" those offsets into its real registers. I don't think Parrot's register files will give it much trouble, but throwing away the right inc/dec-of-pointer ops that a stack machine implies will (there are obviously HW special cases for x86's push - but Parrot-as-C is unlikely to use x86's sp as its stack-pointer, as the C compiler will have snaffled it.) -- Nick Ing-Simmons http://www.ni-s.u-net.com/Thread Previous | Thread Next