lua-users home
lua-l archive

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


On 8 December 2016 at 16:47, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> I have been thinking of ways of making the Ravi interpreter faster
>> without having to resort to assembly code etc. So far one of the areas
>> I have not really looked at is how to improve the bytecode decoding.
>> The main issue is that the operands B and C require an extra bit
>> compared to operand A, so we cannot make them all 8 bits...
>
> Given a 32- or 64-bit machine, why decoding 8-bit operands would be
> faster/better than 9-bit ones?
>

I don't know whether the extracting the operands itself will be any
faster. One option might be to map the instruction directly to a
struct as each component will be 8 bytes, but I don't know if that is
better. But there should definitely be savings in the macros RKB() and
RKC() if the opcode itself encoded whether the operand is a constant
or register.

I suppose that until I implement and test the performance of various
alternatives it will not be clear whether the changes are worthwhile.

Regards