]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
PPC: Generalize rematerialization handling.
authorMike Pall <mike>
Mon, 24 Oct 2011 14:21:11 +0000 (16:21 +0200)
committerMike Pall <mike>
Mon, 24 Oct 2011 14:21:11 +0000 (16:21 +0200)
src/lj_asm.c

index 0c794ebbb5cc3748cc2ae176eb79fc6277d72f8f..7ee9fd2f21634b78382ff4c35c4baec05c5422f7 100644 (file)
@@ -460,7 +460,20 @@ static void ra_evictset(ASMState *as, RegSet drop)
 /* Evict (rematerialize) all registers allocated to constants. */
 static void ra_evictk(ASMState *as)
 {
-  RegSet work = ~as->freeset & RSET_ALL;
+  RegSet work;
+#if !LJ_SOFTFP
+  work = ~as->freeset & RSET_FPR;
+  while (work) {
+    Reg r = rset_pickbot(work);
+    IRRef ref = regcost_ref(as->cost[r]);
+    if (emit_canremat(ref) && irref_isk(ref)) {
+      ra_rematk(as, ref);
+      checkmclim(as);
+    }
+    rset_clear(work, r);
+  }
+#endif
+  work = ~as->freeset & RSET_GPR;
   while (work) {
     Reg r = rset_pickbot(work);
     IRRef ref = regcost_ref(as->cost[r]);
@@ -483,7 +496,7 @@ static Reg ra_allock(ASMState *as, int32_t k, RegSet allow)
     IRRef ref;
     r = rset_pickbot(work);
     ref = regcost_ref(as->cost[r]);
-    if (emit_canremat(ref) &&
+    if (ref < ASMREF_L &&
        k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i))
       return r;
     rset_clear(work, r);