diff --git a/include/lopcodes.h b/include/lopcodes.h index 9a792da..e6040fd 100644 --- a/include/lopcodes.h +++ b/include/lopcodes.h @@ -228,8 +228,8 @@ OP_RAVI_TOTYPE, 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_MOVEAI, /* 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_MOVEIARRAY, /* A B R(A) := R(B), check R(B) is array of int */ +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_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_SETUPVALF, /* A B UpValue[B] := tonumber(R(A)) */ -OP_RAVI_SETUPVALAI, /* A B UpValue[B] := toarrayint(R(A)) */ -OP_RAVI_SETUPVALAF, /* A B UpValue[B] := toarrayflt(R(A)) */ +OP_RAVI_SETUPVAL_IARRAY, /* A B UpValue[B] := toarrayint(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_BAND_II,/* A B C R(A) := RK(B) & RK(C) */ diff --git a/include/ravi_llvmcodegen.h b/include/ravi_llvmcodegen.h index 493c10e..dad7c56 100644 --- a/include/ravi_llvmcodegen.h +++ b/include/ravi_llvmcodegen.h @@ -1340,9 +1340,9 @@ class RaviCodeGenerator { void emit_IARRAY_SET(RaviFunctionDef *def, int A, int B, int C, 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); diff --git a/ravi-tests/ravi_tests1.ravi b/ravi-tests/ravi_tests1.ravi index d268a9c..830c086 100644 --- a/ravi-tests/ravi_tests1.ravi +++ b/ravi-tests/ravi_tests1.ravi @@ -79,8 +79,8 @@ opcodes_coverage.TOIARRAY = 0 opcodes_coverage.TOFARRAY = 0 opcodes_coverage.MOVEI = 0 opcodes_coverage.MOVEF = 0 -opcodes_coverage.MOVEAI = 0 -opcodes_coverage.MOVEAF = 0 +opcodes_coverage.MOVEIARRAY = 0 +opcodes_coverage.MOVEFARRAY = 0 opcodes_coverage.IARRAY_GET = 0 opcodes_coverage.FARRAY_GET = 0 opcodes_coverage.IARRAY_SET = 0 @@ -91,8 +91,8 @@ opcodes_coverage.FORPREP_IP = 0 opcodes_coverage.FORPREP_I1 = 0 opcodes_coverage.SETUPVALI = 0 opcodes_coverage.SETUPVALF = 0 -opcodes_coverage.SETUPVALAI = 0 -opcodes_coverage.SETUPVALAF = 0 +opcodes_coverage.SETUPVAL_IARRAY = 0 +opcodes_coverage.SETUPVAL_FARRAY = 0 opcodes_coverage.IARRAY_SETI = 0 opcodes_coverage.FARRAY_SETF = 0 opcodes_coverage.BAND_II = 0 diff --git a/ravi-tests/ravi_tests2.ravi b/ravi-tests/ravi_tests2.ravi index 4d72a62..2fac4b3 100644 --- a/ravi-tests/ravi_tests2.ravi +++ b/ravi-tests/ravi_tests2.ravi @@ -81,8 +81,8 @@ opcodes_coverage.TOIARRAY = 0 opcodes_coverage.TOFARRAY = 0 opcodes_coverage.MOVEI = 0 opcodes_coverage.MOVEF = 0 -opcodes_coverage.MOVEAI = 0 -opcodes_coverage.MOVEAF = 0 +opcodes_coverage.MOVEIARRAY = 0 +opcodes_coverage.MOVEFARRAY = 0 opcodes_coverage.IARRAY_GET = 0 opcodes_coverage.FARRAY_GET = 0 opcodes_coverage.IARRAY_SET = 0 @@ -93,8 +93,8 @@ opcodes_coverage.FORPREP_IP = 0 opcodes_coverage.FORPREP_I1 = 0 opcodes_coverage.SETUPVALI = 0 opcodes_coverage.SETUPVALF = 0 -opcodes_coverage.SETUPVALAI = 0 -opcodes_coverage.SETUPVALAF = 0 +opcodes_coverage.SETUPVAL_IARRAY = 0 +opcodes_coverage.SETUPVAL_FARRAY = 0 opcodes_coverage.IARRAY_SETI = 0 opcodes_coverage.FARRAY_SETF = 0 opcodes_coverage.BAND_II = 0 diff --git a/readthedocs/ravi-internals.rst b/readthedocs/ravi-internals.rst index eb40389..25a2ab4 100644 --- a/readthedocs/ravi-internals.rst +++ b/readthedocs/ravi-internals.rst @@ -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); break; 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; 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; default: 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) op = OP_RAVI_SETUPVALF; else if (var->ravi_type == RAVI_TARRAYINT) - op = OP_RAVI_SETUPVALAI; + op = OP_RAVI_SETUPVAL_IARRAY; else if (var->ravi_type == RAVI_TARRAYFLT) - op = OP_RAVI_SETUPVALAF; + op = OP_RAVI_SETUPVAL_FARRAY; else luaX_syntaxerror(fs->ls, luaO_pushfstring(fs->ls->L, "Invalid assignment of " diff --git a/readthedocs/ravi-jit-status.rst b/readthedocs/ravi-jit-status.rst index 9e86bd6..080db3f 100644 --- a/readthedocs/ravi-jit-status.rst +++ b/readthedocs/ravi-jit-status.rst @@ -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_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 | | | | 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_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 | | | | 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 | | | | No conversion as input is known to be float | +-------------------------+----------+--------------------------------------------------+ diff --git a/src/lcode.c b/src/lcode.c index 99fce79..d35d756 100644 --- a/src/lcode.c +++ b/src/lcode.c @@ -687,10 +687,10 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) { luaK_codeABC(fs, OP_RAVI_MOVEF, reg, e->u.info, 0); break; 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; 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; case RAVI_TTABLE: 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_TFUNCTION || var->ravi_type == RAVI_TUSERDATA)) { - /* handled by MOVEI, MOVEF, MOVEAI, MOVEAF at runtime */ + /* handled by MOVEI, MOVEF, MOVEIARRAY, MOVEFARRAY at runtime */ return; } 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) op = OP_RAVI_SETUPVALF; else if (var->ravi_type == RAVI_TARRAYINT) - op = OP_RAVI_SETUPVALAI; + op = OP_RAVI_SETUPVAL_IARRAY; else if (var->ravi_type == RAVI_TARRAYFLT) - op = OP_RAVI_SETUPVALAF; + op = OP_RAVI_SETUPVAL_FARRAY; else if (var->ravi_type == RAVI_TTABLE) op = OP_RAVI_SETUPVALT; else if (var->ravi_type == RAVI_TSTRING) diff --git a/src/ldebug.c b/src/ldebug.c index 0bc0d9b..e3ed85c 100644 --- a/src/ldebug.c +++ b/src/ldebug.c @@ -468,8 +468,8 @@ static const char *getobjname (Proto *p, int lastpc, int reg, switch (op) { case OP_RAVI_MOVEI: case OP_RAVI_MOVEF: - case OP_RAVI_MOVEAF: - case OP_RAVI_MOVEAI: + case OP_RAVI_MOVEFARRAY: + case OP_RAVI_MOVEIARRAY: case OP_RAVI_MOVETAB: case OP_MOVE: { int b = GETARG_B(i); /* move from 'b' to 'a' */ diff --git a/src/lopcodes.c b/src/lopcodes.c index aad7ae7..16f738e 100644 --- a/src/lopcodes.c +++ b/src/lopcodes.c @@ -116,8 +116,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { "MOVEI", /* 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 */ - "MOVEAF", /* A B R(A) := R(B), check R(B) is array of floats */ + "MOVEIARRAY", /* A B R(A) := R(B), check R(B) is array of int */ + "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 */ "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)) */ "SETUPVALF", /* A B UpValue[B] := tonumber(R(A)) */ - "SETUPVALAI", /* A B UpValue[B] := toarrayint(R(A)) */ - "SETUPVALAF", /* A B UpValue[B] := toarrayflt(R(A)) */ + "SETUPVAL_IARRAY", /* A B UpValue[B] := toarrayint(R(A)) */ + "SETUPVAL_FARRAY", /* A B UpValue[B] := toarrayflt(R(A)) */ "SETUPVALT", /* A B UpValue[B] := to_table(R(A)) */ "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_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_MOVEAF A B R(A) := R(B), check R(B) is array of floats */ + ,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_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, 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_SETUPVALF */ - ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALAI */ - ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALAF */ + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVAL_IARRAY */ + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVAL_FARRAY */ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RAVI_SETUPVALT */ ,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_RAVI_SETUPVALI: case OP_RAVI_SETUPVALF: - case OP_RAVI_SETUPVALAI: - case OP_RAVI_SETUPVALAF: + case OP_RAVI_SETUPVAL_IARRAY: + case OP_RAVI_SETUPVAL_FARRAY: case OP_RAVI_SETUPVALT: case OP_SETUPVAL: printf("\t; %s",UPVALNAME(b)); diff --git a/src/lvm.c b/src/lvm.c index f75ed29..98c3ac2 100644 --- a/src/lvm.c +++ b/src/lvm.c @@ -1219,8 +1219,8 @@ int luaV_execute (lua_State *L) { &&vmlabel(OP_RAVI_TOTYPE), &&vmlabel(OP_RAVI_MOVEI), &&vmlabel(OP_RAVI_MOVEF), - &&vmlabel(OP_RAVI_MOVEAI), - &&vmlabel(OP_RAVI_MOVEAF), + &&vmlabel(OP_RAVI_MOVEIARRAY), + &&vmlabel(OP_RAVI_MOVEFARRAY), &&vmlabel(OP_RAVI_MOVETAB), &&vmlabel(OP_RAVI_IARRAY_GET), &&vmlabel(OP_RAVI_FARRAY_GET), @@ -1234,8 +1234,8 @@ int luaV_execute (lua_State *L) { &&vmlabel(OP_RAVI_FORPREP_I1), &&vmlabel(OP_RAVI_SETUPVALI), &&vmlabel(OP_RAVI_SETUPVALF), - &&vmlabel(OP_RAVI_SETUPVALAI), - &&vmlabel(OP_RAVI_SETUPVALAF), + &&vmlabel(OP_RAVI_SETUPVAL_IARRAY), + &&vmlabel(OP_RAVI_SETUPVAL_FARRAY), &&vmlabel(OP_RAVI_SETUPVALT), &&vmlabel(OP_RAVI_BAND_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"); vmbreak; } - vmcase(OP_RAVI_SETUPVALAI) { + vmcase(OP_RAVI_SETUPVAL_IARRAY) { if (!ttisiarray(ra)) luaG_runerror(L, "upvalue of integer[] type, cannot be set to non " @@ -2228,7 +2228,7 @@ int luaV_execute (lua_State *L) { luaC_upvalbarrier(L, uv); vmbreak; } - vmcase(OP_RAVI_SETUPVALAF) { + vmcase(OP_RAVI_SETUPVAL_FARRAY) { if (!ttisfarray(ra)) luaG_runerror( L, @@ -2367,7 +2367,7 @@ int luaV_execute (lua_State *L) { luaG_runerror(L, "MOVEF: number expected"); vmbreak; } - vmcase(OP_RAVI_MOVEAI) { + vmcase(OP_RAVI_MOVEIARRAY) { TValue *rb = RB(i); if (RAVI_LIKELY(ttisiarray(rb))) { setobjs2s(L, ra, rb); @@ -2376,7 +2376,7 @@ int luaV_execute (lua_State *L) { luaG_runerror(L, "integer[] expected"); vmbreak; } - vmcase(OP_RAVI_MOVEAF) { + vmcase(OP_RAVI_MOVEFARRAY) { TValue *rb = RB(i); if (RAVI_LIKELY(ttisfarray(rb))) { setobjs2s(L, ra, rb); diff --git a/src/ravi_jitshared.c b/src/ravi_jitshared.c index 755c97f..950b257 100644 --- a/src/ravi_jitshared.c +++ b/src/ravi_jitshared.c @@ -624,8 +624,8 @@ bool raviJ_cancompile(Proto *p) { case OP_SETUPVAL: case OP_RAVI_SETUPVALI: case OP_RAVI_SETUPVALF: - case OP_RAVI_SETUPVALAI: - case OP_RAVI_SETUPVALAF: + case OP_RAVI_SETUPVAL_IARRAY: + case OP_RAVI_SETUPVAL_FARRAY: case OP_RAVI_SETUPVALT: case OP_RAVI_GETTABLE_S: case OP_RAVI_IARRAY_GET: @@ -676,8 +676,8 @@ bool raviJ_cancompile(Proto *p) { case OP_RAVI_LOADFZ: case OP_RAVI_MOVEI: case OP_RAVI_MOVEF: - case OP_RAVI_MOVEAI: - case OP_RAVI_MOVEAF: + case OP_RAVI_MOVEIARRAY: + case OP_RAVI_MOVEFARRAY: case OP_RAVI_MOVETAB: case OP_RAVI_TOINT: 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"); } -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; emit_reg(fn, "ra", A); 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"); } -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; emit_reg(fn, "ra", A); emit_reg(fn, "rb", B); @@ -1962,11 +1962,11 @@ bool raviJ_codegen(struct lua_State *L, struct Proto *p, int B = GETARG_B(i); emit_op_setupval(&fn, A, B, pc, "f"); } break; - case OP_RAVI_SETUPVALAI: { + case OP_RAVI_SETUPVAL_IARRAY: { int B = GETARG_B(i); emit_op_setupval(&fn, A, B, pc, "ai"); } break; - case OP_RAVI_SETUPVALAF: { + case OP_RAVI_SETUPVAL_FARRAY: { int B = GETARG_B(i); emit_op_setupval(&fn, A, B, pc, "af"); } break; @@ -2143,13 +2143,13 @@ bool raviJ_codegen(struct lua_State *L, struct Proto *p, int B = GETARG_B(i); emit_op_movef(&fn, A, B, pc); } break; - case OP_RAVI_MOVEAI: { + case OP_RAVI_MOVEIARRAY: { int B = GETARG_B(i); - emit_op_moveai(&fn, A, B, pc); + emit_op_MOVEIARRAY(&fn, A, B, pc); } break; - case OP_RAVI_MOVEAF: { + case OP_RAVI_MOVEFARRAY: { int B = GETARG_B(i); - emit_op_moveaf(&fn, A, B, pc); + emit_op_MOVEFARRAY(&fn, A, B, pc); } break; case OP_RAVI_MOVETAB: { int B = GETARG_B(i); diff --git a/src/ravi_llvmcodegen.cpp b/src/ravi_llvmcodegen.cpp index f0bbcc2..2649605 100644 --- a/src/ravi_llvmcodegen.cpp +++ b/src/ravi_llvmcodegen.cpp @@ -1726,13 +1726,13 @@ bool RaviCodeGenerator::compile(lua_State *L, Proto *p, emit_TOTYPE(def, A, Bx, pc); break; } - case OP_RAVI_MOVEAI: { + case OP_RAVI_MOVEIARRAY: { int B = GETARG_B(i); - emit_MOVEAI(def, A, B, pc); + emit_MOVEIARRAY(def, A, B, pc); } break; - case OP_RAVI_MOVEAF: { + case OP_RAVI_MOVEFARRAY: { int B = GETARG_B(i); - emit_MOVEAF(def, A, B, pc); + emit_MOVEFARRAY(def, A, B, pc); } break; case OP_RAVI_MOVETAB: { 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, def->raviV_op_setupvalfF); } break; - case OP_RAVI_SETUPVALAI: { + case OP_RAVI_SETUPVAL_IARRAY: { 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); } break; - case OP_RAVI_SETUPVALAF: { + case OP_RAVI_SETUPVAL_FARRAY: { 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); } break; case OP_RAVI_SETUPVALT: { diff --git a/src/ravi_llvmtable.cpp b/src/ravi_llvmtable.cpp index 6bd37b4..227a3c9 100644 --- a/src/ravi_llvmtable.cpp +++ b/src/ravi_llvmtable.cpp @@ -952,18 +952,18 @@ void RaviCodeGenerator::emit_TOARRAY(RaviFunctionDef *def, int A, 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) { - 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); llvm::Value *src = emit_gep_register(def, B); llvm::Value *dest = emit_gep_register(def, A); 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) { - 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); llvm::Value *src = emit_gep_register(def, B); llvm::Value *dest = emit_gep_register(def, A); diff --git a/vmbuilder/src/buildvm.c b/vmbuilder/src/buildvm.c index c1bc931..1535032 100644 --- a/vmbuilder/src/buildvm.c +++ b/vmbuilder/src/buildvm.c @@ -494,8 +494,8 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES + 1] = "MOVEI", /* 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 */ - "MOVEAF", /* A B R(A) := R(B), check R(B) is array of floats */ + "MOVEIARRAY", /* A B R(A) := R(B), check R(B) is array of int */ + "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 */ "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)) */ "SETUPVALF", /* A B UpValue[B] := tonumber(R(A)) */ - "SETUPVALAI", /* A B UpValue[B] := toarrayint(R(A)) */ - "SETUPVALAF", /* A B UpValue[B] := toarrayflt(R(A)) */ + "SETUPVAL_IARRAY", /* A B UpValue[B] := toarrayint(R(A)) */ + "SETUPVAL_FARRAY", /* A B UpValue[B] := toarrayflt(R(A)) */ "SETUPVALT", /* A B UpValue[B] := to_table(R(A)) */ "BAND_II", /* A B C R(A) := RK(B) & RK(C) */