Enabled use of hl as inter-i-code temporary
authorspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 3 Apr 2009 17:40:28 +0000 (17:40 +0000)
committerspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 3 Apr 2009 17:40:28 +0000 (17:40 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5426 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/ralloc.c

index 7faafa69f981646f9b03abab7e32855b5aec3278..dbbc84a71d9a1f90522ac2a7c25c39f1d420327d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-03 Philipp Klaus Krause <pkk AT spth.de>
+
+       * src/z80/ralloc.c:
+         Enabled use of hl as inter-i-code temporary.
+
 2009-04-03 Philipp Klaus Krause <pkk AT spth.de>
 
        * src/z80/peeph-z80.def:
index aebe825eeddc600a167d0fcc6e015b29b6099a22..b738cda597d8c35e7774708fee738e50e43811f8 100644 (file)
@@ -53,7 +53,7 @@ enum
     DISABLE_PACK_ACC = 0,
     DISABLE_PACK_ASSIGN = 0,
     DISABLE_PACK_ONE_USE = 0,
-    DISABLE_PACK_HL = 1,
+    DISABLE_PACK_HL = 0,
     DISABLE_PACK_IY = 0
   };
 
@@ -2478,14 +2478,18 @@ packRegsForHLUse3 (iCode * lic, operand * op, eBBlock * ebp)
       if (ic->op == LEFT_OP && isOperandLiteral (IC_RIGHT (ic)))
         continue;
 
+      if (ic->op == '+' &&
+         (isOperandEqual (op, IC_LEFT (ic)) || isOperandEqual (op, IC_RIGHT (ic))))
+        continue;
+
       if ((ic->op == '=' && !POINTER_SET(ic)) ||
           ic->op == UNARYMINUS ||
-          ic->op == '+' ||
           ic->op == '-' ||
           ic->op == '>' ||
           ic->op == '<' ||
           ic->op == EQ_OP ||
-          0)
+          (ic->op == '+' && getSize (operandType (IC_RESULT (ic))) == 1))
+          /* 16 bit addition uses add hl, rr */
         continue;
 
       if (ic->op == '*' && isOperandEqual (op, IC_LEFT (ic)))