lua-users home
lua-l archive

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

neha mahajan wrote:
> but I wanted to know that on what basis Action Names and their
> numbers are assigned for a particular architecture. I have
> checked out both x86 & ppc code.

These are based on the relocations and variable operand
substitutions needed for a particular instruction set.

> The build_actionlist is so confusing in itself. can you put some light
> on these aspects also.

Well, x86 has really complex rules for immediates, displacements
and relocations. This implies a complex set of actions to encode
them. DynASM for PowerPC has only 10 actions and should be easier
to understand.

But DynASM is just a tool used during the build step. There's no
need to understand its inner workings to understand LuaJIT.

> As action names are different from opcodes for a particular
> architecture.

Action names are based on operands, not on opcodes. E.g. look at
PPC 'addi reg, reg, simm16' with a variable immediate. This is
suffixed with an IMM action (signed=1, scale=0, bits=16, shift=0)
which inserts the immediate into the previous instruction.