aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_fold.c
diff options
context:
space:
mode:
authorMike Pall <mike>2016-05-23 00:25:29 +0200
committerMike Pall <mike>2016-05-23 00:25:29 +0200
commit7fb75ccc4cf17825c1c8fe9f44ebfb0668a1b033 (patch)
tree7317a542402fa2a135b6789c7c4868089d31fd2f /src/lj_opt_fold.c
parenta4067978b6d1c2a25d91d82b1b0d384d98abdbe5 (diff)
downloadluajit-7fb75ccc4cf17825c1c8fe9f44ebfb0668a1b033.tar.gz
luajit-7fb75ccc4cf17825c1c8fe9f44ebfb0668a1b033.tar.bz2
luajit-7fb75ccc4cf17825c1c8fe9f44ebfb0668a1b033.zip
Embed 64 bit constants directly in the IR, using two slots.
Contributed by Peter Cawley.
Diffstat (limited to 'src/lj_opt_fold.c')
-rw-r--r--src/lj_opt_fold.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index c102f2db..73a368ed 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -136,8 +136,8 @@
136/* Some local macros to save typing. Undef'd at the end. */ 136/* Some local macros to save typing. Undef'd at the end. */
137#define IR(ref) (&J->cur.ir[(ref)]) 137#define IR(ref) (&J->cur.ir[(ref)])
138#define fins (&J->fold.ins) 138#define fins (&J->fold.ins)
139#define fleft (&J->fold.left) 139#define fleft (J->fold.left)
140#define fright (&J->fold.right) 140#define fright (J->fold.right)
141#define knumleft (ir_knum(fleft)->n) 141#define knumleft (ir_knum(fleft)->n)
142#define knumright (ir_knum(fright)->n) 142#define knumright (ir_knum(fright)->n)
143 143
@@ -2393,10 +2393,14 @@ retry:
2393 if (fins->op1 >= J->cur.nk) { 2393 if (fins->op1 >= J->cur.nk) {
2394 key += (uint32_t)IR(fins->op1)->o << 10; 2394 key += (uint32_t)IR(fins->op1)->o << 10;
2395 *fleft = *IR(fins->op1); 2395 *fleft = *IR(fins->op1);
2396 if (fins->op1 < REF_TRUE)
2397 fleft[1] = IR(fins->op1)[1];
2396 } 2398 }
2397 if (fins->op2 >= J->cur.nk) { 2399 if (fins->op2 >= J->cur.nk) {
2398 key += (uint32_t)IR(fins->op2)->o; 2400 key += (uint32_t)IR(fins->op2)->o;
2399 *fright = *IR(fins->op2); 2401 *fright = *IR(fins->op2);
2402 if (fins->op2 < REF_TRUE)
2403 fright[1] = IR(fins->op2)[1];
2400 } else { 2404 } else {
2401 key += (fins->op2 & 0x3ffu); /* Literal mask. Must include IRCONV_*MASK. */ 2405 key += (fins->op2 & 0x3ffu); /* Literal mask. Must include IRCONV_*MASK. */
2402 } 2406 }