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').
This commit is contained in:
Roberto Ierusalimschy
2018-11-23 12:23:45 -02:00
parent 35296e1fde
commit 84e32ad2eb
11 changed files with 234 additions and 93 deletions

View File

@@ -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 */