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.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lopcodes.h') 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 */ OP_DIVI,/* A B sC R(A) := R(B) / C */ OP_IDIVI,/* A B sC R(A) := R(B) // C */ +OP_ADDK,/* A B C R(A) := R(B) + K(C) */ +OP_SUBK,/* A B C R(A) := R(B) - K(C) */ +OP_MULK,/* A B C R(A) := R(B) * K(C) */ +OP_MODK,/* A B C R(A) := R(B) % K(C) */ +OP_POWK,/* A B C R(A) := R(B) ^ K(C) */ +OP_DIVK,/* A B C R(A) := R(B) / K(C) */ +OP_IDIVK,/* A B C R(A) := R(B) // K(C) */ + OP_BANDK,/* A B C R(A) := R(B) & K(C):integer */ OP_BORK,/* A B C R(A) := R(B) | K(C):integer */ OP_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) */ OP_POW,/* A B C R(A) := R(B) ^ R(C) */ OP_DIV,/* A B C R(A) := R(B) / R(C) */ OP_IDIV,/* A B C R(A) := R(B) // R(C) */ + OP_BAND,/* A B C R(A) := R(B) & R(C) */ OP_BOR,/* A B C R(A) := R(B) | R(C) */ OP_BXOR,/* A B C R(A) := R(B) ~ R(C) */ OP_SHL,/* A B C R(A) := R(B) << R(C) */ OP_SHR,/* A B C R(A) := R(B) >> R(C) */ + OP_UNM,/* A B R(A) := -R(B) */ OP_BNOT,/* A B R(A) := ~R(B) */ OP_NOT,/* A B R(A) := not R(B) */ -- cgit v1.2.3-55-g6feb