no need to register bitfields
[fw/sdcc] / src / z80 / ralloc.c
index 6dfca4cdf759663e5a65378a88e3b1c307c3a41c..3d964752649cfba41717aa4db79d31c2afad6499 100644 (file)
@@ -66,6 +66,9 @@ enum
 #define D(_a, _s)
 #endif
 
+#define DISABLE_PACKREGSFORSUPPORT     1
+#define DISABLE_PACKREGSFORACCUSE      1
+
 /*-----------------------------------------------------------------*/
 /* At this point we start getting processor specific although      */
 /* some routines are non-processor specific & can be reused when   */
@@ -1094,21 +1097,23 @@ serialRegAssign (eBBlock ** ebbs, int count)
 
              /* if it has a spillocation & is used less than
                 all other live ranges then spill this */
-             if (willCS && sym->usl.spillLoc)
-               {
-
-                 symbol *leastUsed =
-                 leastUsedLR (liveRangesWith (spillable,
-                                              allLRs,
-                                              ebbs[i],
-                                              ic));
-                 if (leastUsed &&
-                     leastUsed->used > sym->used)
-                   {
-                     spillThis (sym);
-                     continue;
-                   }
-               }
+             if (willCS) {
+                     if (sym->usl.spillLoc) {
+                             symbol *leastUsed = leastUsedLR (liveRangesWith (spillable,
+                                                                              allLRs, ebbs[i], ic));
+                             if (leastUsed && leastUsed->used > sym->used) {
+                                     spillThis (sym);
+                                     continue;
+                             }
+                     } else {
+                             /* if none of the liveRanges have a spillLocation then better
+                                to spill this one than anything else already assigned to registers */
+                             if (liveRangesWith(spillable,noSpilLoc,ebbs[i],ic)) {
+                                     spillThis (sym);
+                                     continue;
+                             }
+                     }
+             }
 
              /* else we assign registers to it */
              regAssigned = bitVectSetBit (regAssigned, sym->key);
@@ -1182,6 +1187,12 @@ rUmaskForOp (operand * op)
   return rumask;
 }
 
+bitVect *
+z80_rUmaskForOp (operand * op)
+{
+  return rUmaskForOp (op);
+}
+
 /** Returns bit vector of registers used in iCode.
  */
 bitVect *
@@ -1611,6 +1622,9 @@ findAssignToSym (operand * op, iCode * ic)
 
 }
 
+#if !DISABLE_PACKREGSFORSUPPORT
+// PENDING
+
 /*-----------------------------------------------------------------*/
 /* packRegsForSupport :- reduce some registers for support calls   */
 /*-----------------------------------------------------------------*/
@@ -1670,6 +1684,7 @@ right:
 
   return change;
 }
+#endif
 
 #define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
 
@@ -1824,6 +1839,9 @@ genAssign (ptr)
     ld (iy),(hl)
 */
 
+#if !DISABLE_PACKREGSFORACCUSE
+// PENDING
+
 /** Pack registers for acc use.
     When the result of this operation is small and short lived it may
     be able to be stored in the accumelator.
@@ -1953,6 +1971,7 @@ packRegsForAccUse (iCode * ic)
 accuse:
   OP_SYMBOL (IC_RESULT (ic))->accuse = ACCUSE_A;
 }
+#endif
 
 static void 
 packRegsForHLUse (iCode * ic)
@@ -2061,7 +2080,6 @@ joinPushes (iCode * ic)
        */
       /* First upgrade the size of (first) to int */
       SPEC_NOUN (operandType (IC_LEFT (ic))) = V_INT;
-      SPEC_SHORT (operandType (IC_LEFT (ic))) = 0;
 
       floatFromVal (AOP /* need some sleep ... */ );
       /* Now get and join the values */
@@ -2461,7 +2479,7 @@ z80_assignRegisters (eBBlock ** ebbs, int count)
     packRegisters (ebbs[i]);
 
   if (options.dump_pack)
-    dumpEbbsToFileExt (".dumppack", ebbs, count);
+    dumpEbbsToFileExt (DUMP_PACK, ebbs, count);
 
   /* first determine for each live range the number of 
      registers & the type of registers required for each */
@@ -2486,7 +2504,7 @@ z80_assignRegisters (eBBlock ** ebbs, int count)
     }
 
   if (options.dump_rassgn)
-    dumpEbbsToFileExt (".dumprassgn", ebbs, count);
+    dumpEbbsToFileExt (DUMP_RASSGN, ebbs, count);
 
   /* after that create the register mask
      for each of the instruction */