]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCopt.c
2001-10-21 Michael Hope <michaelh@juju.net.nz>
[fw/sdcc] / src / SDCCopt.c
index a884ab9a457aad15cd7dff9ee515485386816b5c..9d39029259c7eb62a2078041f0725e51c376e474 100644 (file)
@@ -464,10 +464,21 @@ convertToFcall (eBBlock ** ebbs, int count)
          /* if long / int mult or divide or mod */
          if (ic->op == '*' || ic->op == '/' || ic->op == '%')
            {
-             sym_link *type = operandType (IC_LEFT (ic));
-             if (IS_INTEGRAL (type) && getSize (type) > port->support.muldiv)
+             sym_link *leftType = operandType (IC_LEFT (ic));
+
+             if (IS_INTEGRAL (leftType) && getSize (leftType) > port->support.muldiv)
                 {
-                  convilong (ic, ebbs[i], type, ic->op);
+                  sym_link *rightType = operandType (IC_RIGHT (ic));
+
+                  if (port->hasNativeMulFor != NULL &&
+                      port->hasNativeMulFor (ic, leftType, rightType))
+                    {
+                      /* Leave as native */
+                    }
+                  else
+                    {
+                      convilong (ic, ebbs[i], leftType, ic->op);
+                    }
                 }
            }
           
@@ -863,14 +874,12 @@ eBBlockFromiCode (iCode * ic)
   if (options.cyclomatic)
     printCyclomatic (ebbs, saveCount);
 
-
   /* convert operations with support routines
      written in C to function calls : Iam doing
      this at this point since I want all the
      operations to be as they are for optimzations */
   convertToFcall (ebbs, count);
 
-
   /* compute the live ranges */
   computeLiveRanges (ebbs, count);
 
@@ -889,7 +898,6 @@ eBBlockFromiCode (iCode * ic)
   setToNull ((void **) &graphEdges);
   ebbs = NULL;
 
-
   return NULL;
 }