aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-11-23 12:23:45 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-11-23 12:23:45 -0200
commit84e32ad2ebd6bd160c1320456743a5b1d8f233e9 (patch)
treec5a32eaf7577c99e7598e9de1385a6b53522f04b /lopcodes.h
parent35296e1fde705b3ac8356a4f4ce426497cf7b64c (diff)
downloadlua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.tar.gz
lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.tar.bz2
lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.zip
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').
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lopcodes.h b/lopcodes.h
index 7bb83a1e..d7403caf 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -221,6 +221,14 @@ OP_POWI,/* A B sC R(A) := R(B) ^ C */
221OP_DIVI,/* A B sC R(A) := R(B) / C */ 221OP_DIVI,/* A B sC R(A) := R(B) / C */
222OP_IDIVI,/* A B sC R(A) := R(B) // C */ 222OP_IDIVI,/* A B sC R(A) := R(B) // C */
223 223
224OP_ADDK,/* A B C R(A) := R(B) + K(C) */
225OP_SUBK,/* A B C R(A) := R(B) - K(C) */
226OP_MULK,/* A B C R(A) := R(B) * K(C) */
227OP_MODK,/* A B C R(A) := R(B) % K(C) */
228OP_POWK,/* A B C R(A) := R(B) ^ K(C) */
229OP_DIVK,/* A B C R(A) := R(B) / K(C) */
230OP_IDIVK,/* A B C R(A) := R(B) // K(C) */
231
224OP_BANDK,/* A B C R(A) := R(B) & K(C):integer */ 232OP_BANDK,/* A B C R(A) := R(B) & K(C):integer */
225OP_BORK,/* A B C R(A) := R(B) | K(C):integer */ 233OP_BORK,/* A B C R(A) := R(B) | K(C):integer */
226OP_BXORK,/* A B C R(A) := R(B) ~ K(C):integer */ 234OP_BXORK,/* A B C R(A) := R(B) ~ K(C):integer */
@@ -235,11 +243,13 @@ OP_MOD,/* A B C R(A) := R(B) % R(C) */
235OP_POW,/* A B C R(A) := R(B) ^ R(C) */ 243OP_POW,/* A B C R(A) := R(B) ^ R(C) */
236OP_DIV,/* A B C R(A) := R(B) / R(C) */ 244OP_DIV,/* A B C R(A) := R(B) / R(C) */
237OP_IDIV,/* A B C R(A) := R(B) // R(C) */ 245OP_IDIV,/* A B C R(A) := R(B) // R(C) */
246
238OP_BAND,/* A B C R(A) := R(B) & R(C) */ 247OP_BAND,/* A B C R(A) := R(B) & R(C) */
239OP_BOR,/* A B C R(A) := R(B) | R(C) */ 248OP_BOR,/* A B C R(A) := R(B) | R(C) */
240OP_BXOR,/* A B C R(A) := R(B) ~ R(C) */ 249OP_BXOR,/* A B C R(A) := R(B) ~ R(C) */
241OP_SHL,/* A B C R(A) := R(B) << R(C) */ 250OP_SHL,/* A B C R(A) := R(B) << R(C) */
242OP_SHR,/* A B C R(A) := R(B) >> R(C) */ 251OP_SHR,/* A B C R(A) := R(B) >> R(C) */
252
243OP_UNM,/* A B R(A) := -R(B) */ 253OP_UNM,/* A B R(A) := -R(B) */
244OP_BNOT,/* A B R(A) := ~R(B) */ 254OP_BNOT,/* A B R(A) := ~R(B) */
245OP_NOT,/* A B R(A) := not R(B) */ 255OP_NOT,/* A B R(A) := not R(B) */