From 84e32ad2ebd6bd160c1320456743a5b1d8f233e9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 23 Nov 2018 12:23:45 -0200 Subject: Added opcodes for arithmetic with K operands Added opcodes for all seven arithmetic operators with K operands (that is, operands that are numbers in the array of constants of the function). They cover the cases of constant float operands (e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g., 'x % 10000'). --- lopcodes.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lopcodes.c') diff --git a/lopcodes.c b/lopcodes.c index 11a73c29..3f0d551a 100644 --- a/lopcodes.c +++ b/lopcodes.c @@ -45,6 +45,13 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { ,opmode(0, 0, 0, 1, iABC) /* OP_POWI */ ,opmode(0, 0, 0, 1, iABC) /* OP_DIVI */ ,opmode(0, 0, 0, 1, iABC) /* OP_IDIVI */ + ,opmode(0, 0, 0, 1, iABC) /* OP_ADDK */ + ,opmode(0, 0, 0, 1, iABC) /* OP_SUBK */ + ,opmode(0, 0, 0, 1, iABC) /* OP_MULK */ + ,opmode(0, 0, 0, 1, iABC) /* OP_MODK */ + ,opmode(0, 0, 0, 1, iABC) /* OP_POWK */ + ,opmode(0, 0, 0, 1, iABC) /* OP_DIVK */ + ,opmode(0, 0, 0, 1, iABC) /* OP_IDIVK */ ,opmode(0, 0, 0, 1, iABC) /* OP_BANDK */ ,opmode(0, 0, 0, 1, iABC) /* OP_BORK */ ,opmode(0, 0, 0, 1, iABC) /* OP_BXORK */ -- cgit v1.2.3-55-g6feb