Applied patch #2762516
[fw/sdcc] / src / pic / gen.c
index 04b5cf9acef4fbb4123d86d2f45c6f1706a07b73..a2482345d8cf644255cb770a7ffb6c44b8de79f4 100644 (file)
@@ -1617,30 +1617,27 @@ release:
 /*-----------------------------------------------------------------*/
 /* genUminusFloat - unary minus for floating points                */
 /*-----------------------------------------------------------------*/
-static void genUminusFloat(operand *op,operand *result)
+static void
+genUminusFloat(operand *op, operand *result)
 {
-    int size ,offset =0 ;
-    char *l;
+  int size;
 
-    FENTRY;
+  FENTRY;
 
-    DEBUGpic14_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* 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);
+  DEBUGpic14_emitcode("; ***", "%s  %d", __FUNCTION__, __LINE__);
+  /* for this we just need to flip the
+     first it then copy the rest in place */
+  size = AOP_SIZE(op) - 1;
 
-    MOVA(l);
+  mov2w_op(op, size);
+  emitpcode(POC_XORLW, popGetLit(0x80));
+  movwf(AOP(result), size);
 
-    pic14_emitcode("cpl","acc.7");
-    aopPut(AOP(result),"a",3);
-
-    while(size--) {
-        aopPut(AOP(result),
-            aopGet(AOP(op),offset,FALSE,FALSE),
-            offset);
-        offset++;
-    }
+  while (size--)
+    {
+      mov2w_op(op, size);
+      movwf(AOP(result), size);
+    } // while
 }
 
 /*-----------------------------------------------------------------*/