lua-users home
lua-l archive

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

 > > Hmmm.  Did that change add much complexity to the compiler?  In
 > > particular, the logic in the compiler that has to fall back on a
 > > multi-instruction sequence when the number of constants is large?
 > It does add complexity, but not in that part. The complexity comes
 > because now there are several different kinds of operands and
 > instructions for one same operation. For instance, a sum can be
 > coded with OP_ADD (two registers), OP_ADDI (a register plus an
 > immediate small integer), and OP_ADDK (a register plus a constant
 > in the contant table). 

Oh, that sounds like a noticeable change all right.  Reminds me just a
little of generating code for MIPS---similar issues with a 32-bit
instruction word.  

I'm curious about the impacts on code size and run time.  And which
opcodes are worth ramifying in this way.  I imagine that ADD and the
comparisons would get most of the low-hanging fruit.

Will there be a paper forthcoming?