yet more work in progress: FarFarAssign optimizations
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 28 Sep 2000 00:15:02 +0000 (00:15 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 28 Sep 2000 00:15:02 +0000 (00:15 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@412 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/ds390/gen.c

index 7ece8206e67934d1a946e32a752ecb6963797c1a..e899101b0f05997153087c3c22431a902998f3b9 100644 (file)
@@ -7723,8 +7723,33 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
 {
     int size = AOP_SIZE(right);
     int offset = 0;
-    char *l ;
+    char *l;
+
+#ifdef LAZY_DPS_OPT
+    if (size > 1)
+    {
+       /* This is a net loss for size == 1, but a big gain
+        * otherwise.
+        */
+       D(emitcode(";", "genFarFarAssign (improved)"););
 
+       aopOp(result,ic,TRUE, TRUE);
+
+       _startLazyDPSEvaluation();
+       while (size--) 
+       {
+           aopPut(AOP(result),
+                  aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
+                  offset);
+           offset++;
+       }
+       _endLazyDPSEvaluation();    
+       freeAsmop(result,NULL,ic,FALSE);
+       freeAsmop(right,NULL,ic,FALSE);
+    }
+    else
+#endif
+    {
     D(emitcode(";", "genFarFarAssign "););
 
     /* first push the right side on to the stack */
@@ -7745,7 +7770,7 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
     }
     freeAsmop(result,NULL,ic,FALSE);
     _endLazyDPSEvaluation();
-       
+    }
 }
 
 /*-----------------------------------------------------------------*/