Added header files for Silicon Laboratories (formerly Cygnal) CPUs
[fw/sdcc] / src / SDCCicode.c
index 48cc6eabca252a2b42a071114759de04c8582bce..82aa2cff3a7238d6ffb73ed4d5bba20e4decf576 100644 (file)
@@ -1733,6 +1733,7 @@ getArraySizePtr (operand * op)
 /*-----------------------------------------------------------------*/
 /* perform "usual unary conversions"                               */
 /*-----------------------------------------------------------------*/
+#if 0
 static operand *
 usualUnaryConversions (operand * op)
 {
@@ -1746,6 +1747,7 @@ usualUnaryConversions (operand * op)
     }
   return op;
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 /* perform "usual binary conversions"                              */
@@ -2059,7 +2061,9 @@ geniCodeDivision (operand * left, operand * right)
   sym_link *ltype = operandType (left);
   sym_link *letype = getSpec (ltype);
 
-  resType = usualBinaryConversions (&left, &right, TRUE, FALSE);
+  resType = usualBinaryConversions (&left, &right,
+              (IS_UNSIGNED (retype) && IS_UNSIGNED (letype)) ? FALSE : TRUE,
+             FALSE);
 
   /* if the right is a literal & power of 2
      and left is unsigned then make it a
@@ -2098,7 +2102,9 @@ geniCodeModulus (operand * left, operand * right)
     return operandFromValue (valMod (left->operand.valOperand,
                                     right->operand.valOperand));
 
-  resType = usualBinaryConversions (&left, &right, TRUE, FALSE);
+  resType = usualBinaryConversions (&left, &right,
+              (IS_UNSIGNED (retype) && IS_UNSIGNED (letype)) ? FALSE : TRUE,
+             FALSE);
 
   /* now they are the same size */
   ic = newiCode ('%', left, right);
@@ -2741,7 +2747,6 @@ geniCodeLeftShift (operand * left, operand * right)
 {
   iCode *ic;
 
-  left = usualUnaryConversions (left);
   ic = newiCode (LEFT_OP, left, right);
   IC_RESULT (ic) = newiTempOperand (operandType (left), 0);
   ADDTOCHAIN (ic);