]> git.gag.com Git - fw/sdcc/commitdiff
* as/hc08/asm.h,
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 28 Oct 2003 05:15:01 +0000 (05:15 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 28 Oct 2003 05:15:01 +0000 (05:15 +0000)
* as/hc08/lkrloc.c,
* src/hc08/gen.c,
* src/hc08/ralloc.c: Fix various warnings related to the hc08
* src/SDCCicode.c (geniCodePreInc, geniCodePreDec): Fixed bug #829717
(tweaked fix for bug #818696)

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

ChangeLog
as/hc08/asm.h
as/hc08/lkrloc.c
src/SDCCicode.c
src/hc08/gen.c
src/hc08/ralloc.c

index b2ea2977480b37baf88bb30d56f46abef5f6ead3..eb11a4c68695e1f747f3e5538df4841e505bc309 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-10-28 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * as/hc08/asm.h,
+       * as/hc08/lkrloc.c,
+       * src/hc08/gen.c,
+       * src/hc08/ralloc.c: Fix various warnings related to the hc08
+       * src/SDCCicode.c (geniCodePreInc, geniCodePreDec): Fixed bug #829717
+       (tweaked fix for bug #818696)
+
 2003-10-23 Erik Petrich <epetrich@ivorytower.norman.ok.us>
 
        * src/z80/ralloc.c (joinPushes): Fixed bug #828742
index c81374ab30bee16c685a78f5332698509a3df183..c145aae46c3f44834002cf7dbb758aa2848464ea 100644 (file)
@@ -658,6 +658,7 @@ extern      VOID            out_tw();
 extern VOID            out_t24(int);
 extern VOID            outr11();       /* JLH */
 extern VOID            outr19(struct expr *, int, int);
+extern  VOID           outdp(struct area *, struct expr *);
 
 /* asstore.c */
 extern char *StoreString( char *str );
index cf761024fd7b888e4376ef54b4da72b435e502b4..8ff6ce5f4a8e0e8dfd6fbf3665ca0b261690c239 100644 (file)
@@ -515,6 +515,7 @@ relr()
 
        /* JLH: output only if data (beyond two byte address) */
        if ((oflag == 1) && (rtcnt > 2)) {
+#if 0
                int extendedAddress = (a[aindex]->a_addr >> 16) & 0xffff;
                
                /* Boy, is this a hack: for ABS sections, the
@@ -542,7 +543,6 @@ relr()
                        newArea();
                }
                
-#if 0
                if (extendedAddress != lastExtendedAddress)
                {
                
index 82199b508d676ffe84bfa90c71380d42533915c0..ad97a2a841362c9501e43bcede858128dcac233d 100644 (file)
@@ -2402,7 +2402,7 @@ geniCodePreInc (operand * op, bool lvalue)
   ADDTOCHAIN (ic);
 
   (void) geniCodeAssign (op, result, 0);
-  if (lvalue)
+  if (lvalue || IS_TRUE_SYMOP (op))
     return op;
   else
     return result;
@@ -2485,7 +2485,7 @@ geniCodePreDec (operand * op, bool lvalue)
   ADDTOCHAIN (ic);
 
   (void) geniCodeAssign (op, result, 0);
-  if (lvalue)
+  if (lvalue || IS_TRUE_SYMOP (op))
     return op;
   else
     return result;
index 2bcb3ca5087fb83f28c1e898100e36cd3b8b8cac..04dafb2e6a94a6cd2fa08cdd33593f6bdcbb6114 100644 (file)
@@ -5277,7 +5277,7 @@ XAccRsh (int shCount, bool sign)
       return;
     }
   
-  shCount &= 0x000f;           // shCount : 0..7
+  shCount &= 0x000f;           // shCount : 0..f
 
   /* if we can beat 2n cycles or bytes for some special case, do it here */
   switch (shCount)
@@ -5415,87 +5415,6 @@ movLeft2Result (operand * left, int offl,
 }
 
 
-/*-----------------------------------------------------------------*/
-/* AccAXRsh1 - right shift 0->a:x->c by 1                         */
-/*-----------------------------------------------------------------*/
-static void
-AccAXRsh1 (char *x)
-{
-  emitcode ("lsra", "");
-  emitcode ("ror", "%s", x);
-}
-
-
-/*-----------------------------------------------------------------*/
-/* AccAXRshS1 - signed right shift s->a:x->c by 1                         */
-/*-----------------------------------------------------------------*/
-static void
-AccAXRshS1 (char *x)
-{
-  emitcode ("asra", "");
-  emitcode ("ror", "%s", x);
-}
-
-/*-----------------------------------------------------------------*/
-/* AccAXLrl1 - left rotate c<-a:x<-c by 1                          */
-/*-----------------------------------------------------------------*/
-static void
-AccAXLrl1 (char *x)
-{
-  emitcode ("rol", "%s", x);
-  emitcode ("rola", "");
-}
-
-/*-----------------------------------------------------------------*/
-/* AccAXLsh1 - left shift a:x<-0 by 1                              */
-/*-----------------------------------------------------------------*/
-static void
-AccAXLsh1 (char *x)
-{
-  emitcode ("lsl", "%s", x);
-  emitcode ("rola", "");
-}
-
-/*-----------------------------------------------------------------*/
-/* AccAXLsh - left shift a:x by known count (0..7)                 */
-/*-----------------------------------------------------------------*/
-static void
-AccAXLsh (char *x, int shCount)
-{
-  int i;
-
-  for (i=0;i<shCount;i++) {
-    AccAXLsh1 (x);
-  }
-}
-
-/*-----------------------------------------------------------------*/
-/* AccAXRsh - right shift a:x known count (0..7)                   */
-/*-----------------------------------------------------------------*/
-static void
-AccAXRsh (char *x, int shCount)
-{
-  int i;
-
-  for (i=0;i<shCount;i++) {
-    AccAXRsh1 (x);
-  }
-  
-}
-
-/*-----------------------------------------------------------------*/
-/* AccAXRshS - right shift signed a:x known count (0..7)           */
-/*-----------------------------------------------------------------*/
-static void
-AccAXRshS (char *x, int shCount)
-{
-  int i;
-
-  for (i=0;i<shCount;i++) {
-    AccAXRshS1 (x);
-  }
-}
-
 /*-----------------------------------------------------------------*/
 /* shiftL2Left2Result - shift left two bytes from left to result   */
 /*-----------------------------------------------------------------*/
@@ -5625,6 +5544,7 @@ genlshTwo (operand * result, operand * left, int shCount)
 
   D(emitcode (";     genlshTwo",""));
 
+  
   size = getDataSize (result);
 
   /* if shCount >= 8 */
@@ -5634,10 +5554,9 @@ genlshTwo (operand * result, operand * left, int shCount)
 
       if (size > 1)
        {
-         if (shCount)
-           shiftL1Left2Result (left, LSB, result, MSB16, shCount);
-         else
-           movLeft2Result (left, LSB, result, MSB16, 0);
+          loadRegFromAop (hc08_reg_a, AOP (left), 0);
+          AccLsh (shCount);
+         storeRegToAop (hc08_reg_a, AOP (result), 1);
        }
       storeConstToAop(zero, AOP (result), LSB);
     }
@@ -5645,10 +5564,9 @@ genlshTwo (operand * result, operand * left, int shCount)
   /*  1 <= shCount <= 7 */
   else
     {
-      if (size == 1)
-       shiftL1Left2Result (left, LSB, result, LSB, shCount);
-      else
-       shiftL2Left2Result (left, LSB, result, LSB, shCount);
+      loadRegFromAop (hc08_reg_xa, AOP (left), 0);
+      XAccLsh (shCount);
+      storeRegToFullAop (hc08_reg_xa, AOP (result), 0);
     }
 }
 
@@ -6343,6 +6261,7 @@ genDataPointerGet (operand * left,
   freeAsmop (result, NULL, ic, TRUE);
 }
 
+#if 0
 /*-----------------------------------------------------------------*/
 /* genNearPointerGet - emitcode for near pointer fetch             */
 /*-----------------------------------------------------------------*/
@@ -6415,9 +6334,8 @@ genNearPointerGet (operand * left,
   }
 
   hc08_freeReg (hc08_reg_hx);
-  
 }
-
+#endif
 
 /*-----------------------------------------------------------------*/
 /* genFarPointerGet - get value from far space                     */
@@ -6699,6 +6617,7 @@ genDataPointerSet (operand * right,
   freeAsmop (NULL, derefaop, ic, TRUE);
 }
 
+#if 0
 /*-----------------------------------------------------------------*/
 /* genNearPointerSet - emitcode for near pointer put                */
 /*-----------------------------------------------------------------*/
@@ -6770,7 +6689,7 @@ genNearPointerSet (operand * right,
   hc08_freeReg (hc08_reg_hx);
   
 }
-
+#endif
 
 /*-----------------------------------------------------------------*/
 /* genFarPointerSet - set value from far space                     */
index cbd8b8282f5afb2bb6205c584adeb1d8187b2aa6..f70c369b36420e7232c2d8ee5d43ac937fa667e2 100644 (file)
@@ -1768,6 +1768,7 @@ DEFSETFUNC (deallocStackSpil)
   return 0;
 }
 
+#if 0
 /*-----------------------------------------------------------------*/
 /* farSpacePackable - returns the packable icode for far variables */
 /*-----------------------------------------------------------------*/
@@ -1835,6 +1836,7 @@ farSpacePackable (iCode * ic)
 
   return NULL;
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 /* packRegsForAssign - register reduction for assignment           */
@@ -2172,6 +2174,7 @@ packRegsForSupport (iCode * ic, eBBlock * ebp)
 #define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
 
 
+#if 0
 /*-----------------------------------------------------------------*/
 /* packRegsForOneuse : - will reduce some registers for single Use */
 /*-----------------------------------------------------------------*/
@@ -2185,8 +2188,7 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
   if (!IS_SYMOP (op))
     return NULL;
 
-  /* only upto 2 bytes since we cannot predict
-     the usage of b, & acc */
+  /* only up to 2 bytes */
   if (getSize (operandType (op)) > (fReturnSizeHC08 - 2))
     return NULL;
 
@@ -2328,6 +2330,7 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
   OP_SYMBOL (op)->ruonly = 1;
   return sic;
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 /* isBitwiseOptimizable - requirements of JEAN LOUIS VERN          */
@@ -2889,14 +2892,14 @@ packRegisters (eBBlock ** ebpp, int blockno)
        }
 
 
-      #if 0
+      #if 1
       /* pack registers for accumulator use, when the
          result of an arithmetic or bit wise operation
          has only one use, that use is immediately following
          the defintion and the using iCode has only one
          operand or has two operands but one is literal &
          the result of that operation is not on stack then
-         we can leave the result of this operation in acc:b
+         we can leave the result of this operation in x:a
          combination */
       if ((IS_ARITHMETIC_OP (ic)
           || IS_CONDITIONAL(ic)
@@ -2907,7 +2910,7 @@ packRegisters (eBBlock ** ebpp, int blockno)
           || (ic->op == ADDRESS_OF && isOperandOnStack (IC_LEFT (ic)))
          ) &&
          IS_ITEMP (IC_RESULT (ic)) &&
-         getSize (operandType (IC_RESULT (ic))) <= 2)
+         getSize (operandType (IC_RESULT (ic))) <= 1)
 
        packRegsForAccUse (ic);
       #endif