aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-09-10 13:20:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-09-10 13:20:03 -0300
commit91dad09f65984048ae43c8894d18acb785c7092b (patch)
treeea6c23c54d8659677da6259047ddd0c8e0b7e643 /lvm.c
parent4518e5df24600cacdb3bab75d640348d28e8b769 (diff)
downloadlua-91dad09f65984048ae43c8894d18acb785c7092b.tar.gz
lua-91dad09f65984048ae43c8894d18acb785c7092b.tar.bz2
lua-91dad09f65984048ae43c8894d18acb785c7092b.zip
Removed arithmetic opcodes with immediate operand
The difference in performance between immediate operands and K operands does not seem to justify all those extra opcodes. We only keep OP_ADDI, due to its ubiquity and because the difference is a little more relevant. (Later, OP_SUBI will be implemented by OP_ADDI, negating the constant.)
Diffstat (limited to '')
-rw-r--r--lvm.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/lvm.c b/lvm.c
index 46150ef0..e22a0da8 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1271,30 +1271,6 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1271 op_arithI(L, l_addi, luai_numadd, TM_ADD, GETARG_k(i)); 1271 op_arithI(L, l_addi, luai_numadd, TM_ADD, GETARG_k(i));
1272 vmbreak; 1272 vmbreak;
1273 } 1273 }
1274 vmcase(OP_SUBI) {
1275 op_arithI(L, l_subi, luai_numsub, TM_SUB, 0);
1276 vmbreak;
1277 }
1278 vmcase(OP_MULI) {
1279 op_arithI(L, l_muli, luai_nummul, TM_MUL, GETARG_k(i));
1280 vmbreak;
1281 }
1282 vmcase(OP_MODI) {
1283 op_arithI(L, luaV_mod, luaV_modf, TM_MOD, 0);
1284 vmbreak;
1285 }
1286 vmcase(OP_POWI) {
1287 op_arithfI(L, luai_numpow, TM_POW);
1288 vmbreak;
1289 }
1290 vmcase(OP_DIVI) {
1291 op_arithfI(L, luai_numdiv, TM_DIV);
1292 vmbreak;
1293 }
1294 vmcase(OP_IDIVI) {
1295 op_arithI(L, luaV_idiv, luai_numidiv, TM_IDIV, 0);
1296 vmbreak;
1297 }
1298 vmcase(OP_ADDK) { 1274 vmcase(OP_ADDK) {
1299 op_arithK(L, l_addi, luai_numadd, GETARG_k(i)); 1275 op_arithK(L, l_addi, luai_numadd, GETARG_k(i));
1300 vmbreak; 1276 vmbreak;