diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-23 12:23:45 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-23 12:23:45 -0200 |
commit | 84e32ad2ebd6bd160c1320456743a5b1d8f233e9 (patch) | |
tree | c5a32eaf7577c99e7598e9de1385a6b53522f04b /lopcodes.h | |
parent | 35296e1fde705b3ac8356a4f4ce426497cf7b64c (diff) | |
download | lua-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.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -221,6 +221,14 @@ OP_POWI,/* A B sC R(A) := R(B) ^ C */ | |||
221 | OP_DIVI,/* A B sC R(A) := R(B) / C */ | 221 | OP_DIVI,/* A B sC R(A) := R(B) / C */ |
222 | OP_IDIVI,/* A B sC R(A) := R(B) // C */ | 222 | OP_IDIVI,/* A B sC R(A) := R(B) // C */ |
223 | 223 | ||
224 | OP_ADDK,/* A B C R(A) := R(B) + K(C) */ | ||
225 | OP_SUBK,/* A B C R(A) := R(B) - K(C) */ | ||
226 | OP_MULK,/* A B C R(A) := R(B) * K(C) */ | ||
227 | OP_MODK,/* A B C R(A) := R(B) % K(C) */ | ||
228 | OP_POWK,/* A B C R(A) := R(B) ^ K(C) */ | ||
229 | OP_DIVK,/* A B C R(A) := R(B) / K(C) */ | ||
230 | OP_IDIVK,/* A B C R(A) := R(B) // K(C) */ | ||
231 | |||
224 | OP_BANDK,/* A B C R(A) := R(B) & K(C):integer */ | 232 | OP_BANDK,/* A B C R(A) := R(B) & K(C):integer */ |
225 | OP_BORK,/* A B C R(A) := R(B) | K(C):integer */ | 233 | OP_BORK,/* A B C R(A) := R(B) | K(C):integer */ |
226 | OP_BXORK,/* A B C R(A) := R(B) ~ K(C):integer */ | 234 | 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) */ | |||
235 | OP_POW,/* A B C R(A) := R(B) ^ R(C) */ | 243 | OP_POW,/* A B C R(A) := R(B) ^ R(C) */ |
236 | OP_DIV,/* A B C R(A) := R(B) / R(C) */ | 244 | OP_DIV,/* A B C R(A) := R(B) / R(C) */ |
237 | OP_IDIV,/* A B C R(A) := R(B) // R(C) */ | 245 | OP_IDIV,/* A B C R(A) := R(B) // R(C) */ |
246 | |||
238 | OP_BAND,/* A B C R(A) := R(B) & R(C) */ | 247 | OP_BAND,/* A B C R(A) := R(B) & R(C) */ |
239 | OP_BOR,/* A B C R(A) := R(B) | R(C) */ | 248 | OP_BOR,/* A B C R(A) := R(B) | R(C) */ |
240 | OP_BXOR,/* A B C R(A) := R(B) ~ R(C) */ | 249 | OP_BXOR,/* A B C R(A) := R(B) ~ R(C) */ |
241 | OP_SHL,/* A B C R(A) := R(B) << R(C) */ | 250 | OP_SHL,/* A B C R(A) := R(B) << R(C) */ |
242 | OP_SHR,/* A B C R(A) := R(B) >> R(C) */ | 251 | OP_SHR,/* A B C R(A) := R(B) >> R(C) */ |
252 | |||
243 | OP_UNM,/* A B R(A) := -R(B) */ | 253 | OP_UNM,/* A B R(A) := -R(B) */ |
244 | OP_BNOT,/* A B R(A) := ~R(B) */ | 254 | OP_BNOT,/* A B R(A) := ~R(B) */ |
245 | OP_NOT,/* A B R(A) := not R(B) */ | 255 | OP_NOT,/* A B R(A) := not R(B) */ |