lua-users home
lua-l archive

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


On 4 January 2015 at 22:26, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
> On 4 January 2015 at 06:41, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> If you need more opcodes, I would go for one extra instruction
>> that exploits EXTRA_ARG to give the extra functionality.

> Yes I was wondering if there was a standard way to have a two word
> instruction - that way
> I can maintain bytecode compatibility with Lua.

Hi,

I have been investigating the idea of using a pseudo opcode to
introduce a 64-bit instruction while retaining the existing 32-bit
instructions. However this appears to get complicated due to an
assumption in other places that the bytecode fits into a single 32-bit
field within the expression object in the parser/code generator.
Example:

      e->u.info = luaK_codeABC(fs, OP_NOT, 0, e->u.info, 0);
      e->k = VRELOCABLE;

Regards

Dibyendu