40 #define SIZE_Bx (SIZE_C + SIZE_B) 42 #define SIZE_Ax (SIZE_C + SIZE_B + SIZE_A) 47 #define POS_A (POS_OP + SIZE_OP) 48 #define POS_C (POS_A + SIZE_A) 49 #define POS_B (POS_C + SIZE_C) 59 #if SIZE_Bx < LUAI_BITSINT-1 60 #define MAXARG_Bx ((1<<SIZE_Bx)-1) 61 #define MAXARG_sBx (MAXARG_Bx>>1) 63 #define MAXARG_Bx MAX_INT 64 #define MAXARG_sBx MAX_INT 67 #if SIZE_Ax < LUAI_BITSINT-1 68 #define MAXARG_Ax ((1<<SIZE_Ax)-1) 70 #define MAXARG_Ax MAX_INT 74 #define MAXARG_A ((1<<SIZE_A)-1) 75 #define MAXARG_B ((1<<SIZE_B)-1) 76 #define MAXARG_C ((1<<SIZE_C)-1) 80 #define MASK1(n,p) ((~((~(Instruction)0)<<(n)))<<(p)) 83 #define MASK0(n,p) (~MASK1(n,p)) 89 #define GET_OPCODE(i) (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0))) 90 #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ 91 ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP)))) 93 #define getarg(i,pos,size) (cast(int, ((i)>>pos) & MASK1(size,0))) 94 #define setarg(i,v,pos,size) ((i) = (((i)&MASK0(size,pos)) | \ 95 ((cast(Instruction, v)<<pos)&MASK1(size,pos)))) 97 #define GETARG_A(i) getarg(i, POS_A, SIZE_A) 98 #define SETARG_A(i,v) setarg(i, v, POS_A, SIZE_A) 100 #define GETARG_B(i) getarg(i, POS_B, SIZE_B) 101 #define SETARG_B(i,v) setarg(i, v, POS_B, SIZE_B) 103 #define GETARG_C(i) getarg(i, POS_C, SIZE_C) 104 #define SETARG_C(i,v) setarg(i, v, POS_C, SIZE_C) 106 #define GETARG_Bx(i) getarg(i, POS_Bx, SIZE_Bx) 107 #define SETARG_Bx(i,v) setarg(i, v, POS_Bx, SIZE_Bx) 109 #define GETARG_Ax(i) getarg(i, POS_Ax, SIZE_Ax) 110 #define SETARG_Ax(i,v) setarg(i, v, POS_Ax, SIZE_Ax) 112 #define GETARG_sBx(i) (GETARG_Bx(i)-MAXARG_sBx) 113 #define SETARG_sBx(i,b) SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx)) 116 #define CREATE_ABC(o,a,b,c) ((cast(Instruction, o)<<POS_OP) \ 117 | (cast(Instruction, a)<<POS_A) \ 118 | (cast(Instruction, b)<<POS_B) \ 119 | (cast(Instruction, c)<<POS_C)) 121 #define CREATE_ABx(o,a,bc) ((cast(Instruction, o)<<POS_OP) \ 122 | (cast(Instruction, a)<<POS_A) \ 123 | (cast(Instruction, bc)<<POS_Bx)) 125 #define CREATE_Ax(o,a) ((cast(Instruction, o)<<POS_OP) \ 126 | (cast(Instruction, a)<<POS_Ax)) 134 #define BITRK (1 << (SIZE_B - 1)) 137 #define ISK(x) ((x) & BITRK) 140 #define INDEXK(r) ((int)(r) & ~BITRK) 142 #if !defined(MAXINDEXRK) 143 #define MAXINDEXRK (BITRK - 1) 147 #define RKASK(x) ((x) | BITRK) 153 #define NO_REG MAXARG_A 237 #define NUM_OPCODES (cast(int, OP_EXTRAARG) + 1) 283 #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) 284 #define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) 285 #define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3)) 286 #define testAMode(m) (luaP_opmodes[m] & (1 << 6)) 287 #define testTMode(m) (luaP_opmodes[m] & (1 << 7)) 294 #define LFIELDS_PER_FLUSH 50 Definition: lopcodes.h:198
Definition: lopcodes.h:32
Definition: lopcodes.h:173
Definition: lopcodes.h:206
Definition: lopcodes.h:183
Definition: lopcodes.h:278
Definition: lopcodes.h:275
Definition: lopcodes.h:227
Definition: lopcodes.h:193
Definition: lopcodes.h:220
Definition: lopcodes.h:211
Definition: lopcodes.h:196
Definition: lopcodes.h:204
Definition: lopcodes.h:171
Definition: lopcodes.h:194
Definition: lopcodes.h:214
Definition: lopcodes.h:181
Definition: lopcodes.h:199
Definition: lopcodes.h:202
Definition: lopcodes.h:190
Definition: lopcodes.h:213
Definition: lopcodes.h:210
Definition: lopcodes.h:222
Definition: lopcodes.h:178
Definition: lopcodes.h:233
Definition: lopcodes.h:32
Definition: lopcodes.h:277
Definition: lopcodes.h:217
Definition: lopcodes.h:218
OpCode
Definition: lopcodes.h:167
Definition: lopcodes.h:203
OpArgMask
Definition: lopcodes.h:274
Definition: lopcodes.h:216
Definition: lopcodes.h:225
unsigned char lu_byte
Definition: llimits.h:35
Definition: lopcodes.h:32
LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]
Definition: lopcodes.h:281
Definition: lopcodes.h:200
OpMode
Definition: lopcodes.h:32
Definition: lopcodes.h:191
LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]
Definition: lopcodes.h:290
#define LUAI_DDEC
Definition: luaconf.h:285
Definition: lopcodes.h:185
Definition: lopcodes.h:175
Definition: lopcodes.h:195
Definition: lopcodes.h:276
Definition: lopcodes.h:197
Definition: lopcodes.h:187
Definition: lopcodes.h:201
Definition: lopcodes.h:172
Definition: lopcodes.h:208
Definition: lopcodes.h:179
#define NUM_OPCODES
Definition: lopcodes.h:237
Definition: lopcodes.h:231
Definition: lopcodes.h:176
Definition: lopcodes.h:229
Definition: lopcodes.h:174
Definition: lopcodes.h:192
Definition: lopcodes.h:224
Definition: lopcodes.h:189
Definition: lopcodes.h:32
Definition: lopcodes.h:209
Definition: lopcodes.h:182