diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-09-11 10:20:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-09-11 10:20:10 -0300 |
commit | 40d8832ee05096f9aea8eb54d1cdccf2646aecd0 (patch) | |
tree | a36e3995afcdbddb9d584bad7c1f3c5516135618 /lcode.h | |
parent | 91dad09f65984048ae43c8894d18acb785c7092b (diff) | |
download | lua-40d8832ee05096f9aea8eb54d1cdccf2646aecd0.tar.gz lua-40d8832ee05096f9aea8eb54d1cdccf2646aecd0.tar.bz2 lua-40d8832ee05096f9aea8eb54d1cdccf2646aecd0.zip |
Simplification in the call to 'constfolding'
Diffstat (limited to 'lcode.h')
-rw-r--r-- | lcode.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -24,19 +24,27 @@ | |||
24 | ** grep "ORDER OPR" if you change these enums (ORDER OP) | 24 | ** grep "ORDER OPR" if you change these enums (ORDER OP) |
25 | */ | 25 | */ |
26 | typedef enum BinOpr { | 26 | typedef enum BinOpr { |
27 | /* arithmetic operators */ | ||
27 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, | 28 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, |
28 | OPR_DIV, | 29 | OPR_DIV, OPR_IDIV, |
29 | OPR_IDIV, | 30 | /* bitwise operators */ |
30 | OPR_BAND, OPR_BOR, OPR_BXOR, | 31 | OPR_BAND, OPR_BOR, OPR_BXOR, |
31 | OPR_SHL, OPR_SHR, | 32 | OPR_SHL, OPR_SHR, |
33 | /* string operator */ | ||
32 | OPR_CONCAT, | 34 | OPR_CONCAT, |
35 | /* comparison operators */ | ||
33 | OPR_EQ, OPR_LT, OPR_LE, | 36 | OPR_EQ, OPR_LT, OPR_LE, |
34 | OPR_NE, OPR_GT, OPR_GE, | 37 | OPR_NE, OPR_GT, OPR_GE, |
38 | /* logical operators */ | ||
35 | OPR_AND, OPR_OR, | 39 | OPR_AND, OPR_OR, |
36 | OPR_NOBINOPR | 40 | OPR_NOBINOPR |
37 | } BinOpr; | 41 | } BinOpr; |
38 | 42 | ||
39 | 43 | ||
44 | /* true if operation is foldable (that is, it is arithmetic or bitwise) */ | ||
45 | #define foldbinop(op) ((op) <= OPR_SHR) | ||
46 | |||
47 | |||
40 | #define luaK_codeABC(fs,o,a,b,c) luaK_codeABCk(fs,o,a,b,c,0) | 48 | #define luaK_codeABC(fs,o,a,b,c) luaK_codeABCk(fs,o,a,b,c,0) |
41 | 49 | ||
42 | 50 | ||