[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: basic parrot questions



Terrence Brannon:
# Why would a software machine closely emulating CISC architecture
# be expected to execute as efficiently on RISC and CISC machines?

We're not necessarily expecting it to run as efficiently.  We're just
expecting it to run efficiently enough.

# Does it make any sense to create a low-level machine modeled on
# one-architecture instead of a high-level architecture which can
# flexibly optimize to either architecture?

Yes, because we've tried higher-level machines and were always either
killed by stack thrash or other issues uniquely destructive to a
high-level machine's operation, or buried in complicated code.
Optimizers are good, but they still can't recognize a stack machine when
they see one.  :^)

We don't expect to have our architecture map directly on to the physical
architecture of any machine.  We don't expect any machine to have 128
registers, 64 of which are pointers, 32 ints and 32 floats.  Registers
are basically just conveniently numbered slots in memory.

# Also, I thought Parrot was not "stack-based" If that is the case
# then why does Overview.pod say this:
#
# "Registers will be stored in register frames, which can be pushed and
# popped onto the register stack. For instance, a subroutine or a block
# might need its own register frame."

That's just a convenience in case you manage to fill up the registers
and need s'more.  Many architectures have something like this--IIRC
Sparc (I think it's Sparc, but I'm not sure) has a way to 'rotate' the
register set and get the first half of the registers moved to the last
half of the slots; the first half of the slots are then filled with
fresh registers.  But Sparc (or whatever it is) is definitely a
register-based architecture.  We actually do have a data stack too, for
passing arguments that won't fit in the first five registers or for
saving data for later--we're still register-based because most of our
operations are on registers.

--Brent Dax
brentdax@cpan.org
Configure pumpking for Perl 6

"Nothing important happened today."
    --George III of England's diary entry for 4-Jul-1776