[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Assembler Interface of LuaJIT VM.
- From: Mike Pall <mikelu-1009@...>
- Date: Fri, 3 Sep 2010 12:41:32 +0200
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.
--Mike