On Sat, Sep 25, 2004 at 02:11:10PM -0400, Chip Salzenberg wrote: : According to Dan Sugalski: : > At 12:25 PM -0400 9/25/04, Chip Salzenberg wrote: : > > my $i is register; : > : > Except that makes things significantly sub-optimal in the face of : > continuations, since registers aren't preserved... : : Well, I know I'd be willing to put in a few register declarations for : inner loops.
The intent is that saying things like my int $i; my num $x; could have that very effect (at least, whenever the optimizer decides it wouldn't be a bad idea). The declaration even tells it what kind of register you want so it doesn't have to guess. Though scalar registers only get you so far, even under JIT. My guess is that inner loops will be sped up a lot more by declarations of compact arrays, especially when we get optimized hyperoperators cooking over them, *especially* when we can hand them off to a modern GPU that has a heck of a lot more power than a Cray-1, and just leave those slow scalar registers for the CPU to fiddle around with while the GPU does the heavy lifting. Larry