]> git.gag.com Git - fw/sdcc/commitdiff
* src/ds390/gen.c (genNearPointerGet),
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 10 Feb 2004 07:20:18 +0000 (07:20 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 10 Feb 2004 07:20:18 +0000 (07:20 +0000)
* src/mcs51/gen.c (genNearPointerGet): allow the genDataPointerGet()
optimization with bits, but not bitfields.
* src/ds390/ralloc.c (packRegisters),
* src/mcs51/ralloc.c (packRegisters): fixed bug #884453 & #880832

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3186 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/ds390/gen.c
src/ds390/ralloc.c
src/mcs51/gen.c
src/mcs51/ralloc.c

index cb17b13845bd24e3759c332e5cf7b6bfe9143e46..5c17827ace3d439651a416635c208945c6ec0570 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-02-10 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/ds390/gen.c (genNearPointerGet),
+       * src/mcs51/gen.c (genNearPointerGet): allow the genDataPointerGet()
+       optimization with bits, but not bitfields.
+       * src/ds390/ralloc.c (packRegisters),
+       * src/mcs51/ralloc.c (packRegisters): fixed bug #884453 & #880832
+
 2004-02-09 Bernhard Held <bernhard AT bernhardheld.de>
 
        * src/SDCCcse.c (algebraicOpts): copy operands before modification
index 653fa3fba619743dec39985187581b94fb67d789..1d70bcf3f12f13e1df5d30a9e830189eccab47eb 100644 (file)
@@ -9335,12 +9335,12 @@ genNearPointerGet (operand * left,
   aopOp (left, ic, FALSE, FALSE);
 
   /* if left is rematerialisable and
-     result is not bit variable type and
+     result is not bitfield variable type and
      the left is pointer to data space i.e
      lower 128 bytes of space */
   if (AOP_TYPE (left) == AOP_IMMD &&
-      !IS_BITVAR (retype) &&
-      !IS_BITVAR (letype) &&
+      !IS_BITFIELD (retype) &&
+      !IS_BITFIELD (letype) &&
       DCL_TYPE (ltype) == POINTER)
     {
       genDataPointerGet (left, result, ic);
index 8760bd7b50b06629ff0f87189ccdcdc9ec75594a..008e7e07706af7f836a9a2cc616aff191ae9c631 100644 (file)
@@ -2907,23 +2907,31 @@ packRegisters (eBBlock * ebp)
        {
          /* if we are using a symbol on the stack
             then we should say ds390_ptrRegReq */
+         if (options.useXstack && ic->parmPush
+             && (ic->op == IPUSH || ic->op == IPOP))
+           ds390_ptrRegReq++;
          if (ic->op == IFX && IS_SYMOP (IC_COND (ic)))
                  ds390_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack ? !options.stack10bit : 0) +
-                                     OP_SYMBOL (IC_COND (ic))->iaccess);
+                                     OP_SYMBOL (IC_COND (ic))->iaccess +
+                                     (SPEC_OCLS(OP_SYMBOL (IC_COND (ic))->etype) == idata));
          else if (ic->op == JUMPTABLE && IS_SYMOP (IC_JTCOND (ic)))
                  ds390_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack ? !options.stack10bit : 0) +
-                                     OP_SYMBOL (IC_JTCOND (ic))->iaccess);
+                                     OP_SYMBOL (IC_JTCOND (ic))->iaccess +
+                                     (SPEC_OCLS(OP_SYMBOL (IC_JTCOND (ic))->etype) == idata));
          else
            {
              if (IS_SYMOP (IC_LEFT (ic)))
                      ds390_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack ? !options.stack10bit : 0) +
-                                         OP_SYMBOL (IC_LEFT (ic))->iaccess);
+                                         OP_SYMBOL (IC_LEFT (ic))->iaccess +
+                                         (SPEC_OCLS(OP_SYMBOL (IC_LEFT (ic))->etype) == idata));
              if (IS_SYMOP (IC_RIGHT (ic)))
                      ds390_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack ? !options.stack10bit : 0) +
-                                         OP_SYMBOL (IC_RIGHT (ic))->iaccess);
+                                         OP_SYMBOL (IC_RIGHT (ic))->iaccess +
+                                         (SPEC_OCLS(OP_SYMBOL (IC_RIGHT (ic))->etype) == idata));
              if (IS_SYMOP (IC_RESULT (ic)))
                      ds390_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack ? !options.stack10bit : 0) +
-                                         OP_SYMBOL (IC_RESULT (ic))->iaccess);
+                                         OP_SYMBOL (IC_RESULT (ic))->iaccess +
+                                         (SPEC_OCLS(OP_SYMBOL (IC_RESULT (ic))->etype) == idata));
            }
        }
 
index bd7049bce631df05fe6bdb68c40105530ec525f6..cb4dea5cee49e8d5ff38142b7302c4cda1b0a5ec 100644 (file)
@@ -135,7 +135,7 @@ emitcode (char *inst, const char *fmt,...)
   while (isspace (*lbp))
     lbp++;
 
-  //printf ("%s\n", lb);
+  // printf ("%s\n", lb);
   
   if (lbp && *lbp)
     lineCurr = (lineCurr ?
@@ -7572,11 +7572,11 @@ genNearPointerGet (operand * left,
   aopOp (left, ic, FALSE);
 
   /* if left is rematerialisable and
-     result is not bit variable type and
+     result is not bitfield variable type and
      the left is pointer to data space i.e
      lower 128 bytes of space */
   if (AOP_TYPE (left) == AOP_IMMD &&
-      !IS_BITVAR (retype) &&
+      !IS_BITFIELD (retype) &&
       DCL_TYPE (ltype) == POINTER)
     {
       genDataPointerGet (left, result, ic);
index a8273950f562f4dfcd33482d0421589523601acf..0666ff528428a5c0510f44283878250f166075c7 100644 (file)
@@ -2791,23 +2791,31 @@ packRegisters (eBBlock ** ebpp, int blockno)
        {
          /* if we are using a symbol on the stack
             then we should say mcs51_ptrRegReq */
+         if (options.useXstack && ic->parmPush
+             && (ic->op == IPUSH || ic->op == IPOP))
+           mcs51_ptrRegReq++;
          if (ic->op == IFX && IS_SYMOP (IC_COND (ic)))
            mcs51_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack ||
-                                OP_SYMBOL (IC_COND (ic))->iaccess) ? 1 : 0);
+                                OP_SYMBOL (IC_COND (ic))->iaccess ||
+                                SPEC_OCLS(OP_SYMBOL (IC_COND (ic))->etype) == idata) ? 1 : 0);
          else if (ic->op == JUMPTABLE && IS_SYMOP (IC_JTCOND (ic)))
            mcs51_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack ||
-                             OP_SYMBOL (IC_JTCOND (ic))->iaccess) ? 1 : 0);
+                             OP_SYMBOL (IC_JTCOND (ic))->iaccess ||
+                             SPEC_OCLS(OP_SYMBOL (IC_JTCOND (ic))->etype) == idata) ? 1 : 0);
          else
            {
              if (IS_SYMOP (IC_LEFT (ic)))
                mcs51_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack ||
-                               OP_SYMBOL (IC_LEFT (ic))->iaccess) ? 1 : 0);
+                               OP_SYMBOL (IC_LEFT (ic))->iaccess ||
+                               SPEC_OCLS(OP_SYMBOL (IC_LEFT (ic))->etype) == idata) ? 1 : 0);
              if (IS_SYMOP (IC_RIGHT (ic)))
                mcs51_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack ||
-                              OP_SYMBOL (IC_RIGHT (ic))->iaccess) ? 1 : 0);
+                              OP_SYMBOL (IC_RIGHT (ic))->iaccess ||
+                              SPEC_OCLS(OP_SYMBOL (IC_RIGHT (ic))->etype) == idata) ? 1 : 0);
              if (IS_SYMOP (IC_RESULT (ic)))
                mcs51_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack ||
-                             OP_SYMBOL (IC_RESULT (ic))->iaccess) ? 1 : 0);
+                             OP_SYMBOL (IC_RESULT (ic))->iaccess ||
+                             SPEC_OCLS(OP_SYMBOL (IC_RESULT (ic))->etype) == idata) ? 1 : 0);
            }
        }