#include "llimits.h"
Go to the source code of this file.
Macros | |
#define | checkopm(i, m) (getOpMode(GET_OPCODE(i)) == m) |
#define | CREATE_ABCk(o, a, b, c, k) |
#define | CREATE_ABx(o, a, bc) |
#define | CREATE_Ax(o, a) |
#define | CREATE_sJ(o, j, k) |
#define | GET_OPCODE(i) (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0))) |
#define | getarg(i, pos, size) (cast_int(((i)>>(pos)) & MASK1(size,0))) |
#define | GETARG_A(i) getarg(i, POS_A, SIZE_A) |
#define | GETARG_Ax(i) check_exp(checkopm(i, iAx), getarg(i, POS_Ax, SIZE_Ax)) |
#define | GETARG_B(i) check_exp(checkopm(i, iABC), getarg(i, POS_B, SIZE_B)) |
#define | GETARG_Bx(i) check_exp(checkopm(i, iABx), getarg(i, POS_Bx, SIZE_Bx)) |
#define | GETARG_C(i) check_exp(checkopm(i, iABC), getarg(i, POS_C, SIZE_C)) |
#define | GETARG_k(i) check_exp(checkopm(i, iABC), getarg(i, POS_k, 1)) |
#define | GETARG_sB(i) sC2int(GETARG_B(i)) |
#define | GETARG_sBx(i) check_exp(checkopm(i, iAsBx), getarg(i, POS_Bx, SIZE_Bx) - OFFSET_sBx) |
#define | GETARG_sC(i) sC2int(GETARG_C(i)) |
#define | GETARG_sJ(i) check_exp(checkopm(i, isJ), getarg(i, POS_sJ, SIZE_sJ) - OFFSET_sJ) |
#define | getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 7)) |
#define | int2sC(i) ((i) + OFFSET_sC) |
#define | isIT(i) (testITMode(GET_OPCODE(i)) && GETARG_B(i) == 0) |
#define | isOT(i) |
#define | L_INTHASBITS(b) ((UINT_MAX >> ((b) - 1)) >= 1) |
#define | LFIELDS_PER_FLUSH 50 |
#define | MASK0(n, p) (~MASK1(n,p)) |
#define | MASK1(n, p) ((~((~(Instruction)0)<<(n)))<<(p)) |
#define | MAXARG_A ((1<<SIZE_A)-1) |
#define | MAXARG_Ax MAX_INT |
#define | MAXARG_B ((1<<SIZE_B)-1) |
#define | MAXARG_Bx MAX_INT |
#define | MAXARG_C ((1<<SIZE_C)-1) |
#define | MAXARG_sJ MAX_INT |
#define | MAXINDEXRK MAXARG_B |
#define | NO_REG MAXARG_A |
#define | NUM_OPCODES ((int)(OP_EXTRAARG) + 1) |
#define | OFFSET_sBx (MAXARG_Bx>>1) /* 'sBx' is signed */ |
#define | OFFSET_sC (MAXARG_C >> 1) |
#define | OFFSET_sJ (MAXARG_sJ >> 1) |
#define | opmode(mm, ot, it, t, a, m) (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m)) |
#define | POS_A (POS_OP + SIZE_OP) |
#define | POS_Ax POS_A |
#define | POS_B (POS_k + 1) |
#define | POS_Bx POS_k |
#define | POS_C (POS_B + SIZE_B) |
#define | POS_k (POS_A + SIZE_A) |
#define | POS_OP 0 |
#define | POS_sJ POS_A |
#define | sC2int(i) ((i) - OFFSET_sC) |
#define | SET_OPCODE(i, o) |
#define | setarg(i, v, pos, size) |
#define | SETARG_A(i, v) setarg(i, v, POS_A, SIZE_A) |
#define | SETARG_Ax(i, v) setarg(i, v, POS_Ax, SIZE_Ax) |
#define | SETARG_B(i, v) setarg(i, v, POS_B, SIZE_B) |
#define | SETARG_Bx(i, v) setarg(i, v, POS_Bx, SIZE_Bx) |
#define | SETARG_C(i, v) setarg(i, v, POS_C, SIZE_C) |
#define | SETARG_k(i, v) setarg(i, v, POS_k, 1) |
#define | SETARG_sBx(i, b) SETARG_Bx((i),cast_uint((b)+OFFSET_sBx)) |
#define | SETARG_sJ(i, j) setarg(i, cast_uint((j)+OFFSET_sJ), POS_sJ, SIZE_sJ) |
#define | SIZE_A 8 |
#define | SIZE_Ax (SIZE_Bx + SIZE_A) |
#define | SIZE_B 8 |
#define | SIZE_Bx (SIZE_C + SIZE_B + 1) |
#define | SIZE_C 8 |
#define | SIZE_OP 7 |
#define | SIZE_sJ (SIZE_Bx + SIZE_A) |
#define | testAMode(m) (luaP_opmodes[m] & (1 << 3)) |
#define | TESTARG_k(i) check_exp(checkopm(i, iABC), (cast_int(((i) & (1u << POS_k))))) |
#define | testITMode(m) (luaP_opmodes[m] & (1 << 5)) |
#define | testMMMode(m) (luaP_opmodes[m] & (1 << 7)) |
#define | testOTMode(m) (luaP_opmodes[m] & (1 << 6)) |
#define | testTMode(m) (luaP_opmodes[m] & (1 << 4)) |
Enumerations | |
enum | OpCode { OP_MOVE, OP_LOADI, OP_LOADF, OP_LOADK, OP_LOADKX, OP_LOADFALSE, OP_LFALSESKIP, OP_LOADTRUE, OP_LOADNIL, OP_GETUPVAL, OP_SETUPVAL, OP_GETTABUP, OP_GETTABLE, OP_GETI, OP_GETFIELD, OP_SETTABUP, OP_SETTABLE, OP_SETI, OP_SETFIELD, OP_NEWTABLE, OP_SELF, OP_ADDI, OP_ADDK, OP_SUBK, OP_MULK, OP_MODK, OP_POWK, OP_DIVK, OP_IDIVK, OP_BANDK, OP_BORK, OP_BXORK, OP_SHRI, OP_SHLI, OP_ADD, OP_SUB, OP_MUL, OP_MOD, OP_POW, OP_DIV, OP_IDIV, OP_BAND, OP_BOR, OP_BXOR, OP_SHL, OP_SHR, OP_MMBIN, OP_MMBINI, OP_MMBINK, OP_UNM, OP_BNOT, OP_NOT, OP_LEN, OP_CONCAT, OP_CLOSE, OP_TBC, OP_JMP, OP_EQ, OP_LT, OP_LE, OP_EQK, OP_EQI, OP_LTI, OP_LEI, OP_GTI, OP_GEI, OP_TEST, OP_TESTSET, OP_CALL, OP_TAILCALL, OP_RETURN, OP_RETURN0, OP_RETURN1, OP_FORLOOP, OP_FORPREP, OP_TFORPREP, OP_TFORCALL, OP_TFORLOOP, OP_SETLIST, OP_CLOSURE, OP_VARARG, OP_VARARGPREP, OP_EXTRAARG } |
enum | OpMode { iABC, iABx, iAsBx, iAx, isJ } |
#define checkopm | ( | i, | |
m | |||
) | (getOpMode(GET_OPCODE(i)) == m) |
Definition at line 118 of file lopcodes.h.
#define CREATE_ABCk | ( | o, | |
a, | |||
b, | |||
c, | |||
k | |||
) |
Definition at line 156 of file lopcodes.h.
#define CREATE_ABx | ( | o, | |
a, | |||
bc | |||
) |
Definition at line 162 of file lopcodes.h.
#define CREATE_Ax | ( | o, | |
a | |||
) |
Definition at line 166 of file lopcodes.h.
#define CREATE_sJ | ( | o, | |
j, | |||
k | |||
) |
Definition at line 169 of file lopcodes.h.
Definition at line 114 of file lopcodes.h.
Definition at line 121 of file lopcodes.h.
Definition at line 125 of file lopcodes.h.
Definition at line 143 of file lopcodes.h.
Definition at line 128 of file lopcodes.h.
Definition at line 140 of file lopcodes.h.
Definition at line 132 of file lopcodes.h.
Definition at line 137 of file lopcodes.h.
Definition at line 129 of file lopcodes.h.
Definition at line 146 of file lopcodes.h.
Definition at line 133 of file lopcodes.h.
Definition at line 150 of file lopcodes.h.
#define getOpMode | ( | m | ) | (cast(enum OpMode, luaP_opmodes[m] & 7)) |
Definition at line 370 of file lopcodes.h.
#define int2sC | ( | i | ) | ((i) + OFFSET_sC) |
Definition at line 100 of file lopcodes.h.
#define isIT | ( | i | ) | (testITMode(GET_OPCODE(i)) && GETARG_B(i) == 0) |
Definition at line 383 of file lopcodes.h.
#define isOT | ( | i | ) |
Definition at line 378 of file lopcodes.h.
#define L_INTHASBITS | ( | b | ) | ((UINT_MAX >> ((b) - 1)) >= 1) |
Definition at line 68 of file lopcodes.h.
#define LFIELDS_PER_FLUSH 50 |
Definition at line 390 of file lopcodes.h.
#define MASK0 | ( | n, | |
p | |||
) | (~MASK1(n,p)) |
Definition at line 108 of file lopcodes.h.
#define MASK1 | ( | n, | |
p | |||
) | ((~((~(Instruction)0)<<(n)))<<(p)) |
Definition at line 105 of file lopcodes.h.
#define MAXARG_A ((1<<SIZE_A)-1) |
Definition at line 95 of file lopcodes.h.
#define MAXARG_Ax MAX_INT |
Definition at line 83 of file lopcodes.h.
#define MAXARG_B ((1<<SIZE_B)-1) |
Definition at line 96 of file lopcodes.h.
#define MAXARG_Bx MAX_INT |
Definition at line 74 of file lopcodes.h.
#define MAXARG_C ((1<<SIZE_C)-1) |
Definition at line 97 of file lopcodes.h.
#define MAXARG_sJ MAX_INT |
Definition at line 89 of file lopcodes.h.
#define MAXINDEXRK MAXARG_B |
Definition at line 175 of file lopcodes.h.
#define NO_REG MAXARG_A |
Definition at line 182 of file lopcodes.h.
#define NUM_OPCODES ((int)(OP_EXTRAARG) + 1) |
Definition at line 312 of file lopcodes.h.
#define OFFSET_sBx (MAXARG_Bx>>1) /* 'sBx' is signed */ |
Definition at line 77 of file lopcodes.h.
#define OFFSET_sC (MAXARG_C >> 1) |
Definition at line 98 of file lopcodes.h.
#define OFFSET_sJ (MAXARG_sJ >> 1) |
Definition at line 92 of file lopcodes.h.
#define opmode | ( | mm, | |
ot, | |||
it, | |||
t, | |||
a, | |||
m | |||
) | (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m)) |
Definition at line 385 of file lopcodes.h.
Definition at line 49 of file lopcodes.h.
#define POS_Ax POS_A |
Definition at line 56 of file lopcodes.h.
#define POS_B (POS_k + 1) |
Definition at line 51 of file lopcodes.h.
#define POS_Bx POS_k |
Definition at line 54 of file lopcodes.h.
Definition at line 52 of file lopcodes.h.
Definition at line 50 of file lopcodes.h.
#define POS_OP 0 |
Definition at line 47 of file lopcodes.h.
#define POS_sJ POS_A |
Definition at line 58 of file lopcodes.h.
#define sC2int | ( | i | ) | ((i) - OFFSET_sC) |
Definition at line 101 of file lopcodes.h.
#define SET_OPCODE | ( | i, | |
o | |||
) |
#define setarg | ( | i, | |
v, | |||
pos, | |||
size | |||
) |
Definition at line 122 of file lopcodes.h.
Definition at line 126 of file lopcodes.h.
Definition at line 144 of file lopcodes.h.
Definition at line 130 of file lopcodes.h.
Definition at line 141 of file lopcodes.h.
Definition at line 134 of file lopcodes.h.
Definition at line 138 of file lopcodes.h.
#define SETARG_sBx | ( | i, | |
b | |||
) | SETARG_Bx((i),cast_uint((b)+OFFSET_sBx)) |
Definition at line 148 of file lopcodes.h.
Definition at line 152 of file lopcodes.h.
#define SIZE_A 8 |
Definition at line 41 of file lopcodes.h.
Definition at line 42 of file lopcodes.h.
#define SIZE_B 8 |
Definition at line 39 of file lopcodes.h.
Definition at line 40 of file lopcodes.h.
#define SIZE_C 8 |
Definition at line 38 of file lopcodes.h.
#define SIZE_OP 7 |
Definition at line 45 of file lopcodes.h.
Definition at line 43 of file lopcodes.h.
#define testAMode | ( | m | ) | (luaP_opmodes[m] & (1 << 3)) |
Definition at line 371 of file lopcodes.h.
Definition at line 136 of file lopcodes.h.
#define testITMode | ( | m | ) | (luaP_opmodes[m] & (1 << 5)) |
Definition at line 373 of file lopcodes.h.
#define testMMMode | ( | m | ) | (luaP_opmodes[m] & (1 << 7)) |
Definition at line 375 of file lopcodes.h.
#define testOTMode | ( | m | ) | (luaP_opmodes[m] & (1 << 6)) |
Definition at line 374 of file lopcodes.h.
#define testTMode | ( | m | ) | (luaP_opmodes[m] & (1 << 4)) |
Definition at line 372 of file lopcodes.h.
enum OpCode |
Definition at line 196 of file lopcodes.h.
enum OpMode |
Enumerator | |
---|---|
iABC | |
iABx | |
iAsBx | |
iAx | |
isJ |
Definition at line 32 of file lopcodes.h.