* src/mcs51/ralloc.c (getRegPtr, getRegGpr),
[fw/sdcc] / src / ds390 / main.c
index 4323260488b297d7f1347a86bb43d87f2b62fb0b..cc66e1608fcc116a6c7321e1ddebddacc84aa874 100644 (file)
@@ -314,6 +314,30 @@ bool _ds390_nativeMulCheck(iCode *ic, sym_link *left, sym_link *right)
     return FALSE; // #STUB
 }
 
+/* Indicate which extended bit operations this port supports */
+static bool
+hasExtBitOp (int op, int size)
+{
+  if (op == RRC
+      || op == RLC
+      || op == GETHBIT
+      || (op == SWAP && size <= 2)
+     )
+    return TRUE;
+  else
+    return FALSE;
+}
+
+/* Indicate the expense of an access to an output storage class */
+static int
+oclsExpense (struct memmap *oclass)
+{
+  if (IN_FARSPACE(oclass))
+    return 1;
+    
+  return 0;
+}
+
 
 /** $1 is always the basename.
     $2 is always the output file.
@@ -357,7 +381,8 @@ PORT ds390_port =
     _linkCmd,
     NULL,
     NULL,
-    ".rel"
+    ".rel",
+    1
   },
   {
     _defaultRules
@@ -411,7 +436,10 @@ PORT ds390_port =
   NULL,
   NULL,
   _ds390_nativeMulCheck,
+  hasExtBitOp,                 /* hasExtBitOp */
+  oclsExpense,                 /* oclsExpense */
   FALSE,
+  TRUE,                                /* little endian */
   0,                           /* leave lt */
   0,                           /* leave gt */
   1,                           /* transform <= to ! > */
@@ -630,6 +658,7 @@ PORT tininative_port =
   "DS80C390",                  /* Target name */
        NULL,                   /* processor */
   {
+    glue,
     FALSE,                     /* Emit glue around main */
     MODEL_FLAT24,
     MODEL_FLAT24
@@ -648,6 +677,7 @@ PORT tininative_port =
     NULL,
     NULL,
     ".tlib",
+    1
   },
   {
     _defaultRules
@@ -701,7 +731,10 @@ PORT tininative_port =
   NULL,
   NULL,
   NULL,
+  hasExtBitOp,                 /* hasExtBitOp */
+  oclsExpense,                 /* oclsExpense */
   FALSE,
+  TRUE,                                /* little endian */
   0,                           /* leave lt */
   0,                           /* leave gt */
   1,                           /* transform <= to ! > */
@@ -855,7 +888,8 @@ PORT ds400_port =
     _linkCmd,
     NULL,
     NULL,
-    ".rel"
+    ".rel",
+    1
   },
   {
     _defaultRules
@@ -909,7 +943,10 @@ PORT ds400_port =
   NULL,
   NULL,
   _ds390_nativeMulCheck,
+  hasExtBitOp,                 /* hasExtBitOp */
+  oclsExpense,                 /* oclsExpense */
   FALSE,
+  TRUE,                                /* little endian */
   0,                           /* leave lt */
   0,                           /* leave gt */
   1,                           /* transform <= to ! > */