aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-10-24 16:21:11 +0200
committerMike Pall <mike>2011-10-24 16:21:11 +0200
commit167f638f91a4ff186ffa6ef8a8915422ea52f38b (patch)
treeaeae9d45e08d3fbea550eb285693a9f9365e0b34 /src
parent826fb377ecbe804a7ae934876b0dc074d93f6c46 (diff)
downloadluajit-167f638f91a4ff186ffa6ef8a8915422ea52f38b.tar.gz
luajit-167f638f91a4ff186ffa6ef8a8915422ea52f38b.tar.bz2
luajit-167f638f91a4ff186ffa6ef8a8915422ea52f38b.zip
PPC: Generalize rematerialization handling.
Diffstat (limited to 'src')
-rw-r--r--src/lj_asm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 0c794ebb..7ee9fd2f 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -460,7 +460,20 @@ static void ra_evictset(ASMState *as, RegSet drop)
460/* Evict (rematerialize) all registers allocated to constants. */ 460/* Evict (rematerialize) all registers allocated to constants. */
461static void ra_evictk(ASMState *as) 461static void ra_evictk(ASMState *as)
462{ 462{
463 RegSet work = ~as->freeset & RSET_ALL; 463 RegSet work;
464#if !LJ_SOFTFP
465 work = ~as->freeset & RSET_FPR;
466 while (work) {
467 Reg r = rset_pickbot(work);
468 IRRef ref = regcost_ref(as->cost[r]);
469 if (emit_canremat(ref) && irref_isk(ref)) {
470 ra_rematk(as, ref);
471 checkmclim(as);
472 }
473 rset_clear(work, r);
474 }
475#endif
476 work = ~as->freeset & RSET_GPR;
464 while (work) { 477 while (work) {
465 Reg r = rset_pickbot(work); 478 Reg r = rset_pickbot(work);
466 IRRef ref = regcost_ref(as->cost[r]); 479 IRRef ref = regcost_ref(as->cost[r]);
@@ -483,7 +496,7 @@ static Reg ra_allock(ASMState *as, int32_t k, RegSet allow)
483 IRRef ref; 496 IRRef ref;
484 r = rset_pickbot(work); 497 r = rset_pickbot(work);
485 ref = regcost_ref(as->cost[r]); 498 ref = regcost_ref(as->cost[r]);
486 if (emit_canremat(ref) && 499 if (ref < ASMREF_L &&
487 k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i)) 500 k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i))
488 return r; 501 return r;
489 rset_clear(work, r); 502 rset_clear(work, r);