* Added support for doing shifts by helper functions
[fw/sdcc] / src / SDCCicode.c
index ea4f48d5cab440e51eddf7a1b91bce73fdc8d5fd..4e93c888ce17805e5b38e4ade37243139f6c8165 100644 (file)
@@ -1632,7 +1632,7 @@ geniCodeMultiply (operand * left, operand * right,int resultIsInt)
      if port has 1 byte muldiv */
   if (p2 && !IS_FLOAT (letype) &&
       !((resultIsInt) && (getSize (resType) != getSize (ltype)) && 
-       (port->muldiv.native_below == 1)))
+       (port->support.muldiv == 1)))
     {
       if ((resultIsInt) && (getSize (resType) != getSize (ltype)))
        {
@@ -2394,7 +2394,7 @@ geniCodeLogic (operand * left, operand * right, int op)
       int nbits = bitsForType (ltype);
       long v = (long) operandLitValue (right);
 
-      if (v > ((LONG_LONG) 1 << nbits) && v > 0)
+      if (v >= ((LONG_LONG) 1 << nbits) && v > 0)
        werror (W_CONST_RANGE, " compare operation ");
     }
 
@@ -2490,7 +2490,7 @@ geniCodeAssign (operand * left, operand * right, int nosupdate)
       int nbits = bitsForType (ltype);
       long v = (long) operandLitValue (right);
 
-      if (v > ((LONG_LONG) 1 << nbits) && v > 0)
+      if (v >= ((LONG_LONG) 1 << nbits) && v > 0)
        werror (W_CONST_RANGE, " = operation");
     }