Dave Mitchell:
# Simon Cozens <[EMAIL PROTECTED]> wrote:
# > On Thu, Sep 06, 2001 at 02:54:29PM +0100, Dave Mitchell wrote:
# > > So I guess I'm asking whether we're abandoning the Perl 5 concept
# > > of a pad full of tmp targets, each hardcoded as the
# target for individual
# > > ops to store their tmp results in.
# >
# > Not entirely; the last thing we want to be doing is creating PMCs at
# > runtime.
#
# Sorry, I thought you were suggesting that at compile time a
# fixed number of
# tmp PMCs would be created, and slots 1-N of the PMC registers
# would be set
# permanently to point to them. Which is why I was concerned about the
# possibility of N+1 tmps being needed.
#
# > > If a certain number of PMC regs are 'hardcoded' with pointers to
# > > PMC tmps, then we need to address register overflow, eg
# an expression like
# > >
# > > foo($x+1, $x+2, ...., $x+65);
# >
# > That's slightly different, though, because that'll all be
# passed in as
# > a list.
#
# So how does that all work then? What does the parrot assembler for
#
# foo($x+1, $x+2, ...., $x+65)
#
# look like roughly - and where do the 65 tmp PMCs come from?
# In Perl 5 they're
# the 65 pad tmps associated with the add ops.
If foo is an unprototyped function (and thus takes a list in P0) we can
immediately push the values of those calculations on to the list,
something like (in a lame pseudo-assembler that doesn't use the right
names for instructions):
load $x, I1
load 1, I2
add I1, I2, I3
push P0, I3
load 2, I2
add I1, I2, I3
push P0, I3
(lather, rinse, repeat)
In the more general case, however (say, $x*1+$x*2+...$x*65) that's an
interesting question. Could we just do some fun stuff with lists? What
do real CPUs do?
--Brent Dax
[EMAIL PROTECTED]
"...and if the answers are inadequate, the pumpqueen will be overthrown
in a bloody coup by programmers flinging dead Java programs over the
walls with a trebuchet."