Lines Matching +full:a +full:- +full:c

14   We assume that instructions are unsigned 32-bit integers.
20 iABC C(8) | B(8) |k| A(8) | Op(7) |
21 iABx Bx(17) | A(8) | Op(7) |
22 iAsBx sBx (signed)(17) | A(8) | Op(7) |
26 A signed argument is represented in excess K: the represented value is
68 #define L_INTHASBITS(b) ((UINT_MAX >> ((b) - 1)) >= 1)
72 #define MAXARG_Bx ((1<<SIZE_Bx)-1)
81 #define MAXARG_Ax ((1<<SIZE_Ax)-1)
87 #define MAXARG_sJ ((1 << SIZE_sJ) - 1)
95 #define MAXARG_A ((1<<SIZE_A)-1)
96 #define MAXARG_B ((1<<SIZE_B)-1)
97 #define MAXARG_C ((1<<SIZE_C)-1)
101 #define sC2int(i) ((i) - OFFSET_sC)
104 /* creates a mask with 'n' 1 bits at position 'p' */
107 /* creates a mask with 'n' 0 bits at position 'p' */
147 check_exp(checkopm(i, iAsBx), getarg(i, POS_Bx, SIZE_Bx) - OFFSET_sBx)
151 check_exp(checkopm(i, isJ), getarg(i, POS_sJ, SIZE_sJ) - OFFSET_sJ)
156 #define CREATE_ABCk(o,a,b,c,k) ((cast(Instruction, o)<<POS_OP) \ argument
157 | (cast(Instruction, a)<<POS_A) \
159 | (cast(Instruction, c)<<POS_C) \
162 #define CREATE_ABx(o,a,bc) ((cast(Instruction, o)<<POS_OP) \ argument
163 | (cast(Instruction, a)<<POS_A) \
166 #define CREATE_Ax(o,a) ((cast(Instruction, o)<<POS_OP) \ argument
167 | (cast(Instruction, a)<<POS_Ax))
186 ** R[x] - register
187 ** K[x] - constant (in constant table)
193 ** Grep "ORDER OP" if you change these enums. Opcodes marked with a (*)
198 /*----------------------------------------------------------------------
200 ------------------------------------------------------------------------*/
201 OP_MOVE,/* A B R[A] := R[B] */
202 OP_LOADI,/* A sBx R[A] := sBx */
203 OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */
204 OP_LOADK,/* A Bx R[A] := K[Bx] */
205 OP_LOADKX,/* A R[A] := K[extra arg] */
206 OP_LOADFALSE,/* A R[A] := false */
207 OP_LFALSESKIP,/*A R[A] := false; pc++ (*) */
208 OP_LOADTRUE,/* A R[A] := true */
209 OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
210 OP_GETUPVAL,/* A B R[A] := UpValue[B] */
211 OP_SETUPVAL,/* A B UpValue[B] := R[A] */
213 OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:string] */
214 OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */
215 OP_GETI,/* A B C R[A] := R[B][C] */
216 OP_GETFIELD,/* A B C R[A] := R[B][K[C]:string] */
218 OP_SETTABUP,/* A B C UpValue[A][K[B]:string] := RK(C) */
219 OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */
220 OP_SETI,/* A B C R[A][B] := RK(C) */
221 OP_SETFIELD,/* A B C R[A][K[B]:string] := RK(C) */
223 OP_NEWTABLE,/* A B C k R[A] := {} */
225 OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][RK(C):string] */
227 OP_ADDI,/* A B sC R[A] := R[B] + sC */
229 OP_ADDK,/* A B C R[A] := R[B] + K[C]:number */
230 OP_SUBK,/* A B C R[A] := R[B] - K[C]:number */
231 OP_MULK,/* A B C R[A] := R[B] * K[C]:number */
232 OP_MODK,/* A B C R[A] := R[B] % K[C]:number */
233 OP_POWK,/* A B C R[A] := R[B] ^ K[C]:number */
234 OP_DIVK,/* A B C R[A] := R[B] / K[C]:number */
235 OP_IDIVK,/* A B C R[A] := R[B] // K[C]:number */
237 OP_BANDK,/* A B C R[A] := R[B] & K[C]:integer */
238 OP_BORK,/* A B C R[A] := R[B] | K[C]:integer */
239 OP_BXORK,/* A B C R[A] := R[B] ~ K[C]:integer */
241 OP_SHRI,/* A B sC R[A] := R[B] >> sC */
242 OP_SHLI,/* A B sC R[A] := sC << R[B] */
244 OP_ADD,/* A B C R[A] := R[B] + R[C] */
245 OP_SUB,/* A B C R[A] := R[B] - R[C] */
246 OP_MUL,/* A B C R[A] := R[B] * R[C] */
247 OP_MOD,/* A B C R[A] := R[B] % R[C] */
248 OP_POW,/* A B C R[A] := R[B] ^ R[C] */
249 OP_DIV,/* A B C R[A] := R[B] / R[C] */
250 OP_IDIV,/* A B C R[A] := R[B] // R[C] */
252 OP_BAND,/* A B C R[A] := R[B] & R[C] */
253 OP_BOR,/* A B C R[A] := R[B] | R[C] */
254 OP_BXOR,/* A B C R[A] := R[B] ~ R[C] */
255 OP_SHL,/* A B C R[A] := R[B] << R[C] */
256 OP_SHR,/* A B C R[A] := R[B] >> R[C] */
258 OP_MMBIN,/* A B C call C metamethod over R[A] and R[B] (*) */
259 OP_MMBINI,/* A sB C k call C metamethod over R[A] and sB */
260 OP_MMBINK,/* A B C k call C metamethod over R[A] and K[B] */
262 OP_UNM,/* A B R[A] := -R[B] */
263 OP_BNOT,/* A B R[A] := ~R[B] */
264 OP_NOT,/* A B R[A] := not R[B] */
265 OP_LEN,/* A B R[A] := #R[B] (length operator) */
267 OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */
269 OP_CLOSE,/* A close all upvalues >= R[A] */
270 OP_TBC,/* A mark variable A "to be closed" */
272 OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */
273 OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */
274 OP_LE,/* A B k if ((R[A] <= R[B]) ~= k) then pc++ */
276 OP_EQK,/* A B k if ((R[A] == K[B]) ~= k) then pc++ */
277 OP_EQI,/* A sB k if ((R[A] == sB) ~= k) then pc++ */
278 OP_LTI,/* A sB k if ((R[A] < sB) ~= k) then pc++ */
279 OP_LEI,/* A sB k if ((R[A] <= sB) ~= k) then pc++ */
280 OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */
281 OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */
283 OP_TEST,/* A k if (not R[A] == k) then pc++ */
284 OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] (*) */
286 OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */
287 OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */
289 OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */
291 OP_RETURN1,/* A return R[A] */
293 OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */
294 OP_FORPREP,/* A Bx <check values and prepare counters>;
297 OP_TFORPREP,/* A Bx create upvalue for R[A + 3]; pc+=Bx */
298 OP_TFORCALL,/* A C R[A+4], ... ,R[A+3+C] := R[A](R[A+1], R[A+2]); */
299 OP_TFORLOOP,/* A Bx if R[A+2] ~= nil then { R[A]=R[A+2]; pc -= Bx } */
301 OP_SETLIST,/* A B C k R[A][C+i] := R[A+i], 1 <= i <= B */
303 OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */
305 OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
307 OP_VARARGPREP,/*A (adjust vararg parameters) */
320 (*) Opcode OP_LFALSESKIP is used to convert a condition to a boolean
321 value, in a code equivalent to (not cond ? false : true). (It
328 (*) Opcode OP_TESTSET is used in short-circuit expressions that need
329 both to jump and to produce a value, such as (a = b or c).
331 (*) In OP_CALL, if (B == 0) then B = top - A. If (C == 0), then
335 (*) In OP_VARARG, if (C == 0) then use actual number of varargs and
336 set top (like in OP_CALL with C == 0).
344 real C = EXTRAARG _ C (the bits of EXTRAARG concatenated with the
345 bits of C).
347 (*) In OP_NEWTABLE, B is log2 of the hash size (which is always a
349 is C. Otherwise, the array size is EXTRAARG _ C.
357 (*) All 'skips' (pc++) assume that next instruction is a jump.
360 function builds upvalues, which may need to be closed. C > 0 means
362 returning; in this case, (C - 1) is its number of fixed parameters.
364 (*) In comparisons with an immediate operand, C signals whether the
365 original operand was a float. (It must be corrected in case of
373 ** bits 0-2: op mode
374 ** bit 3: instruction set register A
375 ** bit 4: operator is a test (next instruction must be a jump)
376 ** bit 5: instruction uses 'L->top' set by previous instruction (when B == 0)
377 ** bit 6: instruction sets 'L->top' for next instruction (when C == 0)
378 ** bit 7: instruction is an MM instruction (call a metamethod)
398 #define opmode(mm,ot,it,t,a,m) \ argument
399 (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m))
402 /* number of list items to accumulate before a SETLIST instruction */