Added support for gsinit packing.
[fw/sdcc] / src / z80 / main.c
index aa8d569c15f16641d644652b6912a8138f2068db..f60636d7503425672f70761478c0fe0d3f1d60a3 100644 (file)
@@ -284,7 +284,7 @@ _setDefaultOptions (void)
   optimize.label3 = 1;
   optimize.label4 = 1;
   optimize.loopInvariant = 1;
-  optimize.loopInduction = 0;
+  optimize.loopInduction = 1;
 }
 
 /* Mangaling format:
@@ -294,10 +294,11 @@ _setDefaultOptions (void)
       params is the parameter format
 
    policy format:
-    rs
+    rsp
     where:
       r is 'r' for reentrant, 's' for static functions
       s is 'c' for callee saves, 'r' for caller saves
+      p is 'p' for profiling on, 'x' for profiling off
     examples:
       rr - reentrant, caller saves
    params format:
@@ -313,14 +314,10 @@ _mangleSupportFunctionName(char *original)
 
   if (TARGET_IS_Z80) 
     {
-      if (options.noRegParams) 
-        {
-          sprintf(buffer, "%s_rr_s", original);
-        }
-      else 
-        {
-          sprintf(buffer, "%s_rr_bds", original);
-        }
+      sprintf(buffer, "%s_rr%s_%s", original,
+              options.profile ? "f" : "x",
+              options.noRegParams ? "s" : "bds"
+              );
     }
   else 
     {
@@ -511,7 +508,7 @@ PORT z80_port =
   },
     /* Z80 has no native mul/div commands */
   {
-    0, 0
+    0, 2
   },
   "_",
   _z80_init,
@@ -534,6 +531,7 @@ PORT z80_port =
   1,                           /* transform >= to ! < */
   1,                           /* transform != to !(a == b) */
   0,                           /* leave == */
+  TRUE,                         /* Array initializer support. */       
   PORT_MAGIC
 };
 
@@ -612,5 +610,6 @@ PORT gbz80_port =
   1,                           /* transform >= to ! < */
   1,                           /* transform != to !(a == b) */
   0,                           /* leave == */
+  FALSE,                        /* No array initializer support. */
   PORT_MAGIC
 };