genUminusfloat avoiding 3 pairs of
[fw/sdcc] / src / mcs51 / gen.c
index e40b01115a6527f91a74d61bb40456bf4caaec88..d58f60d6bb7348ea26c5c86c03644f18ff2afce7 100644 (file)
@@ -1444,15 +1444,9 @@ genUminusFloat (operand * op, operand * result)
 
   D(emitcode (";     genUminusFloat",""));
 
-  /* for this we just need to flip the
-     first it then copy the rest in place */
-  size = AOP_SIZE (op) - 1;
-  l = aopGet (AOP (op), 3, FALSE, FALSE);
-
-  MOVA (l);
+  /* for this we just copy and then flip the bit */
 
-  emitcode ("cpl", "acc.7");
-  aopPut (AOP (result), "a", 3);
+  size = AOP_SIZE (op) - 1;
 
   while (size--)
     {
@@ -1461,6 +1455,13 @@ genUminusFloat (operand * op, operand * result)
              offset);
       offset++;
     }
+
+  l = aopGet (AOP (op), offset, FALSE, FALSE);
+
+  MOVA (l);
+
+  emitcode ("cpl", "acc.7");
+  aopPut (AOP (result), "a", offset);
 }
 
 /*-----------------------------------------------------------------*/
@@ -6519,7 +6520,7 @@ genLeftShift (iCode * ic)
   char *l;
   symbol *tlbl, *tlbl1;
 
-  D(emitcode (";    genLeftShift",""));
+  D(emitcode (";     genLeftShift",""));
 
   right = IC_RIGHT (ic);
   left = IC_LEFT (ic);
@@ -6831,8 +6832,6 @@ genRightShiftLiteral (operand * left,
        MOVA (aopGet (AOP (left), size - 1, FALSE, FALSE));
       }
       addSign (result, LSB, sign);
-      freeAsmop (left, NULL, ic, TRUE);
-      freeAsmop (result, NULL, ic, TRUE);
     }
   else
     {
@@ -6852,10 +6851,9 @@ genRightShiftLiteral (operand * left,
        default:
          break;
        }
-
-      freeAsmop (left, NULL, ic, TRUE);
-      freeAsmop (result, NULL, ic, TRUE);
     }
+  freeAsmop (left, NULL, ic, TRUE);
+  freeAsmop (result, NULL, ic, TRUE);
 }
 
 /*-----------------------------------------------------------------*/