lua-users home
lua-l archive

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

> Conversely, if it is a significant optimization, that would suggest that it
> might be better to move the K bits from operand to opcode, making the
> Instruction 8/8/8/8 instead of 6/8/9/9. If my count is right, this would
> actually increase the number of opcodes by 35, but the implementations
> of the additional opcodes are small and it would probably only increase
> the size of the VM by a little.
> In fact, if the K versions of the binary opcodes were only used
> for numeric constants, then the KB-KC variants would be
> unnecessary and the extra opcodes would just fit into the
> existing six bits, and furthermore a number of ttisnumber()
> tests could also be avoided.

We were thinking exactly that for Lua 5.2 :) (A small correction: I did
not say, and I do not think, that this is "a significant optimization",
only an optimization.)

-- Roberto