diff options
author | Mike Pall <mike> | 2011-05-27 01:56:25 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-05-27 01:56:25 +0200 |
commit | 46955be1e2cbd3406bbc8209dbece7238a984835 (patch) | |
tree | dba6dc92268c81a1313aeb2b890be324752d838d /src/lj_opt_split.c | |
parent | 840a067d4e3538ab7887d128a817be44333684d6 (diff) | |
download | luajit-46955be1e2cbd3406bbc8209dbece7238a984835.tar.gz luajit-46955be1e2cbd3406bbc8209dbece7238a984835.tar.bz2 luajit-46955be1e2cbd3406bbc8209dbece7238a984835.zip |
Fix handling of number constants in snapshots in SPLIT pass.
Diffstat (limited to 'src/lj_opt_split.c')
-rw-r--r-- | src/lj_opt_split.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lj_opt_split.c b/src/lj_opt_split.c index b9fae10f..07c52564 100644 --- a/src/lj_opt_split.c +++ b/src/lj_opt_split.c | |||
@@ -255,8 +255,10 @@ static void split_ir(jit_State *J) | |||
255 | if (irm12->op1 > J->loopref && irl1->o == IR_CALLN && | 255 | if (irm12->op1 > J->loopref && irl1->o == IR_CALLN && |
256 | irl1->op2 == IRCALL_log2) { | 256 | irl1->op2 == IRCALL_log2) { |
257 | IRRef tmp = irl1->op1; /* Recycle first two args from LOG2. */ | 257 | IRRef tmp = irl1->op1; /* Recycle first two args from LOG2. */ |
258 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, irm3->op2); | 258 | IRRef arg3 = irm3->op2, arg4 = irm4->op2; |
259 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, irm4->op2); | 259 | J->cur.nins--; |
260 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg3); | ||
261 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg4); | ||
260 | ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_pow); | 262 | ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_pow); |
261 | hi = split_emit(J, IRT(IR_HIOP, LJ_SOFTFP), tmp, tmp); | 263 | hi = split_emit(J, IRT(IR_HIOP, LJ_SOFTFP), tmp, tmp); |
262 | break; | 264 | break; |
@@ -278,7 +280,7 @@ static void split_ir(jit_State *J) | |||
278 | hisubst[ir->op1], hisubst[ir->op2]); | 280 | hisubst[ir->op1], hisubst[ir->op2]); |
279 | break; | 281 | break; |
280 | case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: | 282 | case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: |
281 | case IR_MIN: case IR_MAX: | 283 | case IR_MIN: case IR_MAX: case IR_STRTO: |
282 | hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); | 284 | hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); |
283 | break; | 285 | break; |
284 | case IR_XLOAD: | 286 | case IR_XLOAD: |
@@ -581,7 +583,12 @@ static void split_ir(jit_State *J) | |||
581 | snap->ref = oir[snap->ref].prev; | 583 | snap->ref = oir[snap->ref].prev; |
582 | for (n = 0; n < nent; n++) { | 584 | for (n = 0; n < nent; n++) { |
583 | SnapEntry sn = map[n]; | 585 | SnapEntry sn = map[n]; |
584 | map[n] = ((sn & 0xffff0000) | oir[snap_ref(sn)].prev); | 586 | IRIns *ir = &oir[snap_ref(sn)]; |
587 | if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && irref_isk(snap_ref(sn))) | ||
588 | map[n] = ((sn & 0xffff0000) | | ||
589 | (IRRef1)lj_ir_k64(J, IR_KNUM, ir_knum(ir))); | ||
590 | else | ||
591 | map[n] = ((sn & 0xffff0000) | ir->prev); | ||
585 | } | 592 | } |
586 | } | 593 | } |
587 | } | 594 | } |