whoops, forgot to CC the list....

------------- Begin Forwarded Message -------------

Date: Thu, 6 Sep 2001 14:32:19 +0100 (BST)
From: Dave Mitchell <davem>
Subject: Re: pads and lexicals
To: [EMAIL PROTECTED]
Content-MD5: iVd18ng5xfzBBgJHSPdShg==

Ken Fox <[EMAIL PROTECTED]> wrote:
> Dave Mitchell wrote:
> > Hmmm, except that at the hardware level, registers can store the actual
> > temporary values themselves
> 
> register struct value *hardware_registers_can_be_pointers_too;
> 
> The PMC registers act like pointer-to-struct registers. Other register
> sets can hold immediate values. This is exactly the same as real
> hardware having registers for floating point, addresses, words, etc.
> Parrot just uses more types.

Just to clarify what I'm talking about. I'm referring to ops that return
a PMC (as opposed to a raw ints for example).

In C, the code a = a + a*b needs to store the intermediate result (a*b)
somewhere. The compiler can go this by storing it in a temporary
hardware register. The Perl equivalent $a = $a + $a*$b requires a
temporary PMC to store the intermediate result ($a*$b). I'm asking
where this tmp PMC comes from. A C compiler doesnt have the same
problem, which is why the analogy with C and h/w registers breaks down
slightly.

------------- End Forwarded Message -------------


Reply via email to