issue #157 more renaming of op codes

pull/159/head
Dibyendu Majumdar 6 years ago
parent 31f4e178ee
commit 21028d833b

@ -228,8 +228,8 @@ OP_RAVI_TOTYPE,
OP_RAVI_MOVEI, /* A B R(A) := R(B), check R(B) is int */ OP_RAVI_MOVEI, /* A B R(A) := R(B), check R(B) is int */
OP_RAVI_MOVEF, /* A B R(A) := R(B), check R(B) is float */ OP_RAVI_MOVEF, /* A B R(A) := R(B), check R(B) is float */
OP_RAVI_MOVEAI, /* A B R(A) := R(B), check R(B) is array of int */ OP_RAVI_MOVEIARRAY, /* A B R(A) := R(B), check R(B) is array of int */
OP_RAVI_MOVEAF, /* A B R(A) := R(B), check R(B) is array of floats */ OP_RAVI_MOVEFARRAY, /* A B R(A) := R(B), check R(B) is array of floats */
OP_RAVI_MOVETAB, /* A B R(A) := R(B), check R(B) is a table */ OP_RAVI_MOVETAB, /* A B R(A) := R(B), check R(B) is a table */
OP_RAVI_IARRAY_GET,/* A B C R(A) := R(B)[RK(C)] where R(B) is array of integers and RK(C) is int */ OP_RAVI_IARRAY_GET,/* A B C R(A) := R(B)[RK(C)] where R(B) is array of integers and RK(C) is int */
@ -247,8 +247,8 @@ OP_RAVI_FORPREP_I1,
OP_RAVI_SETUPVALI, /* A B UpValue[B] := tointeger(R(A)) */ OP_RAVI_SETUPVALI, /* A B UpValue[B] := tointeger(R(A)) */
OP_RAVI_SETUPVALF, /* A B UpValue[B] := tonumber(R(A)) */ OP_RAVI_SETUPVALF, /* A B UpValue[B] := tonumber(R(A)) */
OP_RAVI_SETUPVALAI, /* A B UpValue[B] := toarrayint(R(A)) */ OP_RAVI_SETUPVAL_IARRAY, /* A B UpValue[B] := toarrayint(R(A)) */
OP_RAVI_SETUPVALAF, /* A B UpValue[B] := toarrayflt(R(A)) */ OP_RAVI_SETUPVAL_FARRAY, /* A B UpValue[B] := toarrayflt(R(A)) */
OP_RAVI_SETUPVALT,/* A B UpValue[B] := to_table(R(A)) */ OP_RAVI_SETUPVALT,/* A B UpValue[B] := to_table(R(A)) */
OP_RAVI_BAND_II,/* A B C R(A) := RK(B) & RK(C) */ OP_RAVI_BAND_II,/* A B C R(A) := RK(B) & RK(C) */

@ -1340,9 +1340,9 @@ class RaviCodeGenerator {
void emit_IARRAY_SET(RaviFunctionDef *def, int A, int B, int C, void emit_IARRAY_SET(RaviFunctionDef *def, int A, int B, int C,
bool known_float, int pc); bool known_float, int pc);
void emit_MOVEAI(RaviFunctionDef *def, int A, int B, int pc); void emit_MOVEIARRAY(RaviFunctionDef *def, int A, int B, int pc);
void emit_MOVEAF(RaviFunctionDef *def, int A, int B, int pc); void emit_MOVEFARRAY(RaviFunctionDef *def, int A, int B, int pc);
void emit_MOVETAB(RaviFunctionDef *def, int A, int B, int pc); void emit_MOVETAB(RaviFunctionDef *def, int A, int B, int pc);

@ -79,8 +79,8 @@ opcodes_coverage.TOIARRAY = 0
opcodes_coverage.TOFARRAY = 0 opcodes_coverage.TOFARRAY = 0
opcodes_coverage.MOVEI = 0 opcodes_coverage.MOVEI = 0
opcodes_coverage.MOVEF = 0 opcodes_coverage.MOVEF = 0
opcodes_coverage.MOVEAI = 0 opcodes_coverage.MOVEIARRAY = 0
opcodes_coverage.MOVEAF = 0 opcodes_coverage.MOVEFARRAY = 0
opcodes_coverage.IARRAY_GET = 0 opcodes_coverage.IARRAY_GET = 0
opcodes_coverage.FARRAY_GET = 0 opcodes_coverage.FARRAY_GET = 0
opcodes_coverage.IARRAY_SET = 0 opcodes_coverage.IARRAY_SET = 0
@ -91,8 +91,8 @@ opcodes_coverage.FORPREP_IP = 0
opcodes_coverage.FORPREP_I1 = 0 opcodes_coverage.FORPREP_I1 = 0
opcodes_coverage.SETUPVALI = 0 opcodes_coverage.SETUPVALI = 0
opcodes_coverage.SETUPVALF = 0 opcodes_coverage.SETUPVALF = 0
opcodes_coverage.SETUPVALAI = 0 opcodes_coverage.SETUPVAL_IARRAY = 0
opcodes_coverage.SETUPVALAF = 0 opcodes_coverage.SETUPVAL_FARRAY = 0
opcodes_coverage.IARRAY_SETI = 0 opcodes_coverage.IARRAY_SETI = 0
opcodes_coverage.FARRAY_SETF = 0 opcodes_coverage.FARRAY_SETF = 0
opcodes_coverage.BAND_II = 0 opcodes_coverage.BAND_II = 0

@ -81,8 +81,8 @@ opcodes_coverage.TOIARRAY = 0
opcodes_coverage.TOFARRAY = 0 opcodes_coverage.TOFARRAY = 0
opcodes_coverage.MOVEI = 0 opcodes_coverage.MOVEI = 0
opcodes_coverage.MOVEF = 0 opcodes_coverage.MOVEF = 0
opcodes_coverage.MOVEAI = 0 opcodes_coverage.MOVEIARRAY = 0
opcodes_coverage.MOVEAF = 0 opcodes_coverage.MOVEFARRAY = 0
opcodes_coverage.IARRAY_GET = 0 opcodes_coverage.IARRAY_GET = 0
opcodes_coverage.FARRAY_GET = 0 opcodes_coverage.FARRAY_GET = 0
opcodes_coverage.IARRAY_SET = 0 opcodes_coverage.IARRAY_SET = 0
@ -93,8 +93,8 @@ opcodes_coverage.FORPREP_IP = 0
opcodes_coverage.FORPREP_I1 = 0 opcodes_coverage.FORPREP_I1 = 0
opcodes_coverage.SETUPVALI = 0 opcodes_coverage.SETUPVALI = 0
opcodes_coverage.SETUPVALF = 0 opcodes_coverage.SETUPVALF = 0
opcodes_coverage.SETUPVALAI = 0 opcodes_coverage.SETUPVAL_IARRAY = 0
opcodes_coverage.SETUPVALAF = 0 opcodes_coverage.SETUPVAL_FARRAY = 0
opcodes_coverage.IARRAY_SETI = 0 opcodes_coverage.IARRAY_SETI = 0
opcodes_coverage.FARRAY_SETF = 0 opcodes_coverage.FARRAY_SETF = 0
opcodes_coverage.BAND_II = 0 opcodes_coverage.BAND_II = 0

@ -679,10 +679,10 @@ Any ``MOVE`` instructions must be modified so that if the target is register tha
luaK_codeABC(fs, OP_RAVI_MOVEF, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVEF, reg, e->u.info, 0);
break; break;
case RAVI_TARRAYINT: case RAVI_TARRAYINT:
luaK_codeABC(fs, OP_RAVI_MOVEAI, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVEIARRAY, reg, e->u.info, 0);
break; break;
case RAVI_TARRAYFLT: case RAVI_TARRAYFLT:
luaK_codeABC(fs, OP_RAVI_MOVEAF, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVEFARRAY, reg, e->u.info, 0);
break; break;
default: default:
luaK_codeABC(fs, OP_MOVE, reg, e->u.info, 0); luaK_codeABC(fs, OP_MOVE, reg, e->u.info, 0);
@ -1045,9 +1045,9 @@ When we need to generate assignments to an upvalue (OP_SETUPVAL) we need to use
else if (var->ravi_type == RAVI_TNUMFLT) else if (var->ravi_type == RAVI_TNUMFLT)
op = OP_RAVI_SETUPVALF; op = OP_RAVI_SETUPVALF;
else if (var->ravi_type == RAVI_TARRAYINT) else if (var->ravi_type == RAVI_TARRAYINT)
op = OP_RAVI_SETUPVALAI; op = OP_RAVI_SETUPVAL_IARRAY;
else if (var->ravi_type == RAVI_TARRAYFLT) else if (var->ravi_type == RAVI_TARRAYFLT)
op = OP_RAVI_SETUPVALAF; op = OP_RAVI_SETUPVAL_FARRAY;
else else
luaX_syntaxerror(fs->ls, luaX_syntaxerror(fs->ls,
luaO_pushfstring(fs->ls->L, "Invalid assignment of " luaO_pushfstring(fs->ls->L, "Invalid assignment of "

@ -202,9 +202,9 @@ Note that if a Lua functions contains a bytecode that cannot be be JITed then th
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_MOVEF | YES | R(A) := R(B), check R(B) is number | | OP_RAVI_MOVEF | YES | R(A) := R(B), check R(B) is number |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_MOVEAI | YES | R(A) := R(B), check R(B) is array of integer | | OP_RAVI_MOVEIARRAY | YES | R(A) := R(B), check R(B) is array of integer |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_MOVEAF | YES | R(A) := R(B), check R(B) is array of numbers | | OP_RAVI_MOVEFARRAY | YES | R(A) := R(B), check R(B) is array of numbers |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_IARRAY_GET | YES | R(A) := R(B)[RK(C)] where R(B) is array of | | OP_RAVI_IARRAY_GET | YES | R(A) := R(B)[RK(C)] where R(B) is array of |
| | | integers and RK(C) is integer | | | | integers and RK(C) is integer |
@ -236,15 +236,15 @@ Note that if a Lua functions contains a bytecode that cannot be be JITed then th
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_SETUPVALF | YES (1) | UpValue[B] := tonumber(R(A)) | | OP_RAVI_SETUPVALF | YES (1) | UpValue[B] := tonumber(R(A)) |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_SETUPVALAI | YES (1) | UpValue[B] := toarrayint(R(A)) | | OP_RAVI_SETUPVAL_IARRAY | YES (1) | UpValue[B] := toarrayint(R(A)) |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_SETUPVALAF | YES (1) | UpValue[B] := toarrayflt(R(A)) | | OP_RAVI_SETUPVAL_FARRAY | YES (1) | UpValue[B] := toarrayflt(R(A)) |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_IARRAY_SETI | YES | R(A)[RK(B)] := RK(C) where RK(B) is an integer | | OP_RAVI_IARRAY_SETI | YES | R(A)[RK(B)] := RK(C) where RK(B) is an integer |
| | | R(A) is array of integers, and RK(C) is an int | | | | R(A) is array of integers, and RK(C) is an int |
| | | No conversion as input is known to be int | | | | No conversion as input is known to be int |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+
| OP_RAVI_FARRAY_SETF | YES | R(A)[RK(B)] := RK(C) where RK(B) is an integer | | OP_RAVI_FARRAY_SETF | YES | R(A)[RK(B)] := RK(C) where RK(B) is an integer |
| | | R(A) is array of numbers, and RK(C) is a number | | | | R(A) is array of numbers, and RK(C) is a number |
| | | No conversion as input is known to be float | | | | No conversion as input is known to be float |
+-------------------------+----------+--------------------------------------------------+ +-------------------------+----------+--------------------------------------------------+

@ -687,10 +687,10 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
luaK_codeABC(fs, OP_RAVI_MOVEF, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVEF, reg, e->u.info, 0);
break; break;
case RAVI_TARRAYINT: case RAVI_TARRAYINT:
luaK_codeABC(fs, OP_RAVI_MOVEAI, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVEIARRAY, reg, e->u.info, 0);
break; break;
case RAVI_TARRAYFLT: case RAVI_TARRAYFLT:
luaK_codeABC(fs, OP_RAVI_MOVEAF, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVEFARRAY, reg, e->u.info, 0);
break; break;
case RAVI_TTABLE: case RAVI_TTABLE:
luaK_codeABC(fs, OP_RAVI_MOVETAB, reg, e->u.info, 0); luaK_codeABC(fs, OP_RAVI_MOVETAB, reg, e->u.info, 0);
@ -869,7 +869,7 @@ static void check_valid_store(FuncState *fs, expdesc *var, expdesc *ex) {
var->ravi_type == RAVI_TSTRING || var->ravi_type == RAVI_TSTRING ||
var->ravi_type == RAVI_TFUNCTION || var->ravi_type == RAVI_TFUNCTION ||
var->ravi_type == RAVI_TUSERDATA)) { var->ravi_type == RAVI_TUSERDATA)) {
/* handled by MOVEI, MOVEF, MOVEAI, MOVEAF at runtime */ /* handled by MOVEI, MOVEF, MOVEIARRAY, MOVEFARRAY at runtime */
return; return;
} }
if (var->ravi_type == RAVI_TNUMFLT) { if (var->ravi_type == RAVI_TNUMFLT) {
@ -951,9 +951,9 @@ static OpCode check_valid_setupval(FuncState *fs, expdesc *var, expdesc *ex,
else if (var->ravi_type == RAVI_TNUMFLT) else if (var->ravi_type == RAVI_TNUMFLT)
op = OP_RAVI_SETUPVALF; op = OP_RAVI_SETUPVALF;
else if (var->ravi_type == RAVI_TARRAYINT) else if (var->ravi_type == RAVI_TARRAYINT)
op = OP_RAVI_SETUPVALAI; op = OP_RAVI_SETUPVAL_IARRAY;
else if (var->ravi_type == RAVI_TARRAYFLT) else if (var->ravi_type == RAVI_TARRAYFLT)
op = OP_RAVI_SETUPVALAF; op = OP_RAVI_SETUPVAL_FARRAY;
else if (var->ravi_type == RAVI_TTABLE) else if (var->ravi_type == RAVI_TTABLE)
op = OP_RAVI_SETUPVALT; op = OP_RAVI_SETUPVALT;
else if (var->ravi_type == RAVI_TSTRING) else if (var->ravi_type == RAVI_TSTRING)

@ -468,8 +468,8 @@ static const char *getobjname (Proto *p, int lastpc, int reg,
switch (op) { switch (op) {
case OP_RAVI_MOVEI: case OP_RAVI_MOVEI:
case OP_RAVI_MOVEF: case OP_RAVI_MOVEF:
case OP_RAVI_MOVEAF: case OP_RAVI_MOVEFARRAY:
case OP_RAVI_MOVEAI: case OP_RAVI_MOVEIARRAY:
case OP_RAVI_MOVETAB: case OP_RAVI_MOVETAB:
case OP_MOVE: { case OP_MOVE: {
int b = GETARG_B(i); /* move from 'b' to 'a' */ int b = GETARG_B(i); /* move from 'b' to 'a' */

@ -116,8 +116,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
"MOVEI", /* A B R(A) := R(B) */ "MOVEI", /* A B R(A) := R(B) */
"MOVEF", /* A B R(A) := R(B) */ "MOVEF", /* A B R(A) := R(B) */
"MOVEAI", /* A B R(A) := R(B), check R(B) is array of int */ "MOVEIARRAY", /* A B R(A) := R(B), check R(B) is array of int */
"MOVEAF", /* A B R(A) := R(B), check R(B) is array of floats */ "MOVEFARRAY", /* A B R(A) := R(B), check R(B) is array of floats */
"MOVETAB", /* A B R(A) := R(B), check R(B) is a table */ "MOVETAB", /* A B R(A) := R(B), check R(B) is a table */
"IARRAY_GET",/* A B C R(A) := R(B)[RK(C)] where R(B) is array of integers and RK(C) is int */ "IARRAY_GET",/* A B C R(A) := R(B)[RK(C)] where R(B) is array of integers and RK(C) is int */
@ -135,8 +135,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
"SETUPVALI", /* A B UpValue[B] := tointeger(R(A)) */ "SETUPVALI", /* A B UpValue[B] := tointeger(R(A)) */
"SETUPVALF", /* A B UpValue[B] := tonumber(R(A)) */ "SETUPVALF", /* A B UpValue[B] := tonumber(R(A)) */
"SETUPVALAI", /* A B UpValue[B] := toarrayint(R(A)) */ "SETUPVAL_IARRAY", /* A B UpValue[B] := toarrayint(R(A)) */
"SETUPVALAF", /* A B UpValue[B] := toarrayflt(R(A)) */ "SETUPVAL_FARRAY", /* A B UpValue[B] := toarrayflt(R(A)) */
"SETUPVALT", /* A B UpValue[B] := to_table(R(A)) */ "SETUPVALT", /* A B UpValue[B] := to_table(R(A)) */
"BAND_II",/* A B C R(A) := RK(B) & RK(C) */ "BAND_II",/* A B C R(A) := RK(B) & RK(C) */
@ -257,8 +257,8 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEI A B R(A) := tointeger(R(B)) */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEI A B R(A) := tointeger(R(B)) */
,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEF A B R(A) := tonumber(R(B)) */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEF A B R(A) := tonumber(R(B)) */
,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEAI A B R(A) := R(B), check R(B) is array of int */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEIARRAY A B R(A) := R(B), check R(B) is array of int */
,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEAF A B R(A) := R(B), check R(B) is array of floats */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVEFARRAY A B R(A) := R(B), check R(B) is array of floats */
,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVETAB A B R(A) := R(B), check R(B) is a table */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_RAVI_MOVETAB A B R(A) := R(B), check R(B) is a table */
,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_RAVI_IARRAY_GET A B C R(A) := R(B)[RK(C)] where R(B) is array of integers and RK(C) is int */ ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_RAVI_IARRAY_GET A B C R(A) := R(B)[RK(C)] where R(B) is array of integers and RK(C) is int */
@ -276,8 +276,8 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALI */ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALI */
,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALF */ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALF */
,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALAI */ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVAL_IARRAY */
,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALAF */ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVAL_FARRAY */
,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALT */ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALT */
,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_RAVI_BAND_II */ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_RAVI_BAND_II */
@ -449,8 +449,8 @@ static void PrintCode(const Proto* f)
case OP_GETUPVAL: case OP_GETUPVAL:
case OP_RAVI_SETUPVALI: case OP_RAVI_SETUPVALI:
case OP_RAVI_SETUPVALF: case OP_RAVI_SETUPVALF:
case OP_RAVI_SETUPVALAI: case OP_RAVI_SETUPVAL_IARRAY:
case OP_RAVI_SETUPVALAF: case OP_RAVI_SETUPVAL_FARRAY:
case OP_RAVI_SETUPVALT: case OP_RAVI_SETUPVALT:
case OP_SETUPVAL: case OP_SETUPVAL:
printf("\t; %s",UPVALNAME(b)); printf("\t; %s",UPVALNAME(b));

@ -1219,8 +1219,8 @@ int luaV_execute (lua_State *L) {
&&vmlabel(OP_RAVI_TOTYPE), &&vmlabel(OP_RAVI_TOTYPE),
&&vmlabel(OP_RAVI_MOVEI), &&vmlabel(OP_RAVI_MOVEI),
&&vmlabel(OP_RAVI_MOVEF), &&vmlabel(OP_RAVI_MOVEF),
&&vmlabel(OP_RAVI_MOVEAI), &&vmlabel(OP_RAVI_MOVEIARRAY),
&&vmlabel(OP_RAVI_MOVEAF), &&vmlabel(OP_RAVI_MOVEFARRAY),
&&vmlabel(OP_RAVI_MOVETAB), &&vmlabel(OP_RAVI_MOVETAB),
&&vmlabel(OP_RAVI_IARRAY_GET), &&vmlabel(OP_RAVI_IARRAY_GET),
&&vmlabel(OP_RAVI_FARRAY_GET), &&vmlabel(OP_RAVI_FARRAY_GET),
@ -1234,8 +1234,8 @@ int luaV_execute (lua_State *L) {
&&vmlabel(OP_RAVI_FORPREP_I1), &&vmlabel(OP_RAVI_FORPREP_I1),
&&vmlabel(OP_RAVI_SETUPVALI), &&vmlabel(OP_RAVI_SETUPVALI),
&&vmlabel(OP_RAVI_SETUPVALF), &&vmlabel(OP_RAVI_SETUPVALF),
&&vmlabel(OP_RAVI_SETUPVALAI), &&vmlabel(OP_RAVI_SETUPVAL_IARRAY),
&&vmlabel(OP_RAVI_SETUPVALAF), &&vmlabel(OP_RAVI_SETUPVAL_FARRAY),
&&vmlabel(OP_RAVI_SETUPVALT), &&vmlabel(OP_RAVI_SETUPVALT),
&&vmlabel(OP_RAVI_BAND_II), &&vmlabel(OP_RAVI_BAND_II),
&&vmlabel(OP_RAVI_BOR_II), &&vmlabel(OP_RAVI_BOR_II),
@ -2218,7 +2218,7 @@ int luaV_execute (lua_State *L) {
L, "upvalue of number type, cannot be set to non number value"); L, "upvalue of number type, cannot be set to non number value");
vmbreak; vmbreak;
} }
vmcase(OP_RAVI_SETUPVALAI) { vmcase(OP_RAVI_SETUPVAL_IARRAY) {
if (!ttisiarray(ra)) if (!ttisiarray(ra))
luaG_runerror(L, luaG_runerror(L,
"upvalue of integer[] type, cannot be set to non " "upvalue of integer[] type, cannot be set to non "
@ -2228,7 +2228,7 @@ int luaV_execute (lua_State *L) {
luaC_upvalbarrier(L, uv); luaC_upvalbarrier(L, uv);
vmbreak; vmbreak;
} }
vmcase(OP_RAVI_SETUPVALAF) { vmcase(OP_RAVI_SETUPVAL_FARRAY) {
if (!ttisfarray(ra)) if (!ttisfarray(ra))
luaG_runerror( luaG_runerror(
L, L,
@ -2367,7 +2367,7 @@ int luaV_execute (lua_State *L) {
luaG_runerror(L, "MOVEF: number expected"); luaG_runerror(L, "MOVEF: number expected");
vmbreak; vmbreak;
} }
vmcase(OP_RAVI_MOVEAI) { vmcase(OP_RAVI_MOVEIARRAY) {
TValue *rb = RB(i); TValue *rb = RB(i);
if (RAVI_LIKELY(ttisiarray(rb))) { if (RAVI_LIKELY(ttisiarray(rb))) {
setobjs2s(L, ra, rb); setobjs2s(L, ra, rb);
@ -2376,7 +2376,7 @@ int luaV_execute (lua_State *L) {
luaG_runerror(L, "integer[] expected"); luaG_runerror(L, "integer[] expected");
vmbreak; vmbreak;
} }
vmcase(OP_RAVI_MOVEAF) { vmcase(OP_RAVI_MOVEFARRAY) {
TValue *rb = RB(i); TValue *rb = RB(i);
if (RAVI_LIKELY(ttisfarray(rb))) { if (RAVI_LIKELY(ttisfarray(rb))) {
setobjs2s(L, ra, rb); setobjs2s(L, ra, rb);

@ -624,8 +624,8 @@ bool raviJ_cancompile(Proto *p) {
case OP_SETUPVAL: case OP_SETUPVAL:
case OP_RAVI_SETUPVALI: case OP_RAVI_SETUPVALI:
case OP_RAVI_SETUPVALF: case OP_RAVI_SETUPVALF:
case OP_RAVI_SETUPVALAI: case OP_RAVI_SETUPVAL_IARRAY:
case OP_RAVI_SETUPVALAF: case OP_RAVI_SETUPVAL_FARRAY:
case OP_RAVI_SETUPVALT: case OP_RAVI_SETUPVALT:
case OP_RAVI_GETTABLE_S: case OP_RAVI_GETTABLE_S:
case OP_RAVI_IARRAY_GET: case OP_RAVI_IARRAY_GET:
@ -676,8 +676,8 @@ bool raviJ_cancompile(Proto *p) {
case OP_RAVI_LOADFZ: case OP_RAVI_LOADFZ:
case OP_RAVI_MOVEI: case OP_RAVI_MOVEI:
case OP_RAVI_MOVEF: case OP_RAVI_MOVEF:
case OP_RAVI_MOVEAI: case OP_RAVI_MOVEIARRAY:
case OP_RAVI_MOVEAF: case OP_RAVI_MOVEFARRAY:
case OP_RAVI_MOVETAB: case OP_RAVI_MOVETAB:
case OP_RAVI_TOINT: case OP_RAVI_TOINT:
case OP_RAVI_TOFLT: case OP_RAVI_TOFLT:
@ -1369,7 +1369,7 @@ static void emit_op_movef(struct function *fn, int A, int B, int pc) {
membuff_add_string(&fn->body, "}\n"); membuff_add_string(&fn->body, "}\n");
} }
static void emit_op_moveai(struct function *fn, int A, int B, int pc) { static void emit_op_MOVEIARRAY(struct function *fn, int A, int B, int pc) {
(void)pc; (void)pc;
emit_reg(fn, "ra", A); emit_reg(fn, "ra", A);
emit_reg(fn, "rb", B); emit_reg(fn, "rb", B);
@ -1384,7 +1384,7 @@ static void emit_op_moveai(struct function *fn, int A, int B, int pc) {
membuff_add_string(&fn->body, "}\n"); membuff_add_string(&fn->body, "}\n");
} }
static void emit_op_moveaf(struct function *fn, int A, int B, int pc) { static void emit_op_MOVEFARRAY(struct function *fn, int A, int B, int pc) {
(void)pc; (void)pc;
emit_reg(fn, "ra", A); emit_reg(fn, "ra", A);
emit_reg(fn, "rb", B); emit_reg(fn, "rb", B);
@ -1962,11 +1962,11 @@ bool raviJ_codegen(struct lua_State *L, struct Proto *p,
int B = GETARG_B(i); int B = GETARG_B(i);
emit_op_setupval(&fn, A, B, pc, "f"); emit_op_setupval(&fn, A, B, pc, "f");
} break; } break;
case OP_RAVI_SETUPVALAI: { case OP_RAVI_SETUPVAL_IARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_op_setupval(&fn, A, B, pc, "ai"); emit_op_setupval(&fn, A, B, pc, "ai");
} break; } break;
case OP_RAVI_SETUPVALAF: { case OP_RAVI_SETUPVAL_FARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_op_setupval(&fn, A, B, pc, "af"); emit_op_setupval(&fn, A, B, pc, "af");
} break; } break;
@ -2143,13 +2143,13 @@ bool raviJ_codegen(struct lua_State *L, struct Proto *p,
int B = GETARG_B(i); int B = GETARG_B(i);
emit_op_movef(&fn, A, B, pc); emit_op_movef(&fn, A, B, pc);
} break; } break;
case OP_RAVI_MOVEAI: { case OP_RAVI_MOVEIARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_op_moveai(&fn, A, B, pc); emit_op_MOVEIARRAY(&fn, A, B, pc);
} break; } break;
case OP_RAVI_MOVEAF: { case OP_RAVI_MOVEFARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_op_moveaf(&fn, A, B, pc); emit_op_MOVEFARRAY(&fn, A, B, pc);
} break; } break;
case OP_RAVI_MOVETAB: { case OP_RAVI_MOVETAB: {
int B = GETARG_B(i); int B = GETARG_B(i);

@ -1726,13 +1726,13 @@ bool RaviCodeGenerator::compile(lua_State *L, Proto *p,
emit_TOTYPE(def, A, Bx, pc); emit_TOTYPE(def, A, Bx, pc);
break; break;
} }
case OP_RAVI_MOVEAI: { case OP_RAVI_MOVEIARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_MOVEAI(def, A, B, pc); emit_MOVEIARRAY(def, A, B, pc);
} break; } break;
case OP_RAVI_MOVEAF: { case OP_RAVI_MOVEFARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_MOVEAF(def, A, B, pc); emit_MOVEFARRAY(def, A, B, pc);
} break; } break;
case OP_RAVI_MOVETAB: { case OP_RAVI_MOVETAB: {
int B = GETARG_B(i); int B = GETARG_B(i);
@ -1773,14 +1773,14 @@ bool RaviCodeGenerator::compile(lua_State *L, Proto *p,
emit_SETUPVAL_Specific(def, A, B, pc, OP_RAVI_SETUPVALF, emit_SETUPVAL_Specific(def, A, B, pc, OP_RAVI_SETUPVALF,
def->raviV_op_setupvalfF); def->raviV_op_setupvalfF);
} break; } break;
case OP_RAVI_SETUPVALAI: { case OP_RAVI_SETUPVAL_IARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_SETUPVAL_Specific(def, A, B, pc, OP_RAVI_SETUPVALAI, emit_SETUPVAL_Specific(def, A, B, pc, OP_RAVI_SETUPVAL_IARRAY,
def->raviV_op_setupvalaiF); def->raviV_op_setupvalaiF);
} break; } break;
case OP_RAVI_SETUPVALAF: { case OP_RAVI_SETUPVAL_FARRAY: {
int B = GETARG_B(i); int B = GETARG_B(i);
emit_SETUPVAL_Specific(def, A, B, pc, OP_RAVI_SETUPVALAF, emit_SETUPVAL_Specific(def, A, B, pc, OP_RAVI_SETUPVAL_FARRAY,
def->raviV_op_setupvalafF); def->raviV_op_setupvalafF);
} break; } break;
case OP_RAVI_SETUPVALT: { case OP_RAVI_SETUPVALT: {

@ -952,18 +952,18 @@ void RaviCodeGenerator::emit_TOARRAY(RaviFunctionDef *def, int A,
def->builder->SetInsertPoint(done); def->builder->SetInsertPoint(done);
} }
void RaviCodeGenerator::emit_MOVEAI(RaviFunctionDef *def, int A, int B, void RaviCodeGenerator::emit_MOVEIARRAY(RaviFunctionDef *def, int A, int B,
int pc) { int pc) {
emit_debug_trace(def, OP_RAVI_MOVEAI, pc); emit_debug_trace(def, OP_RAVI_MOVEIARRAY, pc);
emit_TOARRAY(def, B, RAVI_TARRAYINT, "integer[] expected", pc); emit_TOARRAY(def, B, RAVI_TARRAYINT, "integer[] expected", pc);
llvm::Value *src = emit_gep_register(def, B); llvm::Value *src = emit_gep_register(def, B);
llvm::Value *dest = emit_gep_register(def, A); llvm::Value *dest = emit_gep_register(def, A);
emit_assign(def, dest, src); emit_assign(def, dest, src);
} }
void RaviCodeGenerator::emit_MOVEAF(RaviFunctionDef *def, int A, int B, void RaviCodeGenerator::emit_MOVEFARRAY(RaviFunctionDef *def, int A, int B,
int pc) { int pc) {
emit_debug_trace(def, OP_RAVI_MOVEAF, pc); emit_debug_trace(def, OP_RAVI_MOVEFARRAY, pc);
emit_TOARRAY(def, B, RAVI_TARRAYFLT, "number[] expected", pc); emit_TOARRAY(def, B, RAVI_TARRAYFLT, "number[] expected", pc);
llvm::Value *src = emit_gep_register(def, B); llvm::Value *src = emit_gep_register(def, B);
llvm::Value *dest = emit_gep_register(def, A); llvm::Value *dest = emit_gep_register(def, A);

@ -494,8 +494,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES + 1] =
"MOVEI", /* A B R(A) := R(B) */ "MOVEI", /* A B R(A) := R(B) */
"MOVEF", /* A B R(A) := R(B) */ "MOVEF", /* A B R(A) := R(B) */
"MOVEAI", /* A B R(A) := R(B), check R(B) is array of int */ "MOVEIARRAY", /* A B R(A) := R(B), check R(B) is array of int */
"MOVEAF", /* A B R(A) := R(B), check R(B) is array of floats */ "MOVEFARRAY", /* A B R(A) := R(B), check R(B) is array of floats */
"MOVETAB", /* A B R(A) := R(B), check R(B) is a table */ "MOVETAB", /* A B R(A) := R(B), check R(B) is a table */
"IARRAY_GET", /* A B C R(A) := R(B)[RK(C)] where R(B) is array of "IARRAY_GET", /* A B C R(A) := R(B)[RK(C)] where R(B) is array of
@ -519,8 +519,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES + 1] =
"SETUPVALI", /* A B UpValue[B] := tointeger(R(A)) */ "SETUPVALI", /* A B UpValue[B] := tointeger(R(A)) */
"SETUPVALF", /* A B UpValue[B] := tonumber(R(A)) */ "SETUPVALF", /* A B UpValue[B] := tonumber(R(A)) */
"SETUPVALAI", /* A B UpValue[B] := toarrayint(R(A)) */ "SETUPVAL_IARRAY", /* A B UpValue[B] := toarrayint(R(A)) */
"SETUPVALAF", /* A B UpValue[B] := toarrayflt(R(A)) */ "SETUPVAL_FARRAY", /* A B UpValue[B] := toarrayflt(R(A)) */
"SETUPVALT", /* A B UpValue[B] := to_table(R(A)) */ "SETUPVALT", /* A B UpValue[B] := to_table(R(A)) */
"BAND_II", /* A B C R(A) := RK(B) & RK(C) */ "BAND_II", /* A B C R(A) := RK(B) & RK(C) */

Loading…
Cancel
Save