2001-10-21 Michael Hope <michaelh@juju.net.nz>
[fw/sdcc] / src / port.h
index e0470a8f45e42aa6f1784809837ae9a9fe7a383c..ef0d45182754487cd1a3f3fdc0e1ff7f9139672a 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef PORT_INCLUDE
 #define PORT_INCLUDE
 
+#include "SDCCicode.h"
+
 #define TARGET_ID_MCS51    1
 #define TARGET_ID_GBZ80    2
 #define TARGET_ID_Z80      3
@@ -55,11 +57,13 @@ typedef struct
     /* assembler related information */
     struct
       {
-/** Command to run and arguments (eg as-z80) */
-       const char **cmd;
-/** Arguments for debug mode.  PENDING: ignored */
+        /** Command to run and arguments (eg as-z80) */
+        const char **cmd;
+        /** Alternate macro based form. */
+        const char *mcmd;
+        /** Arguments for debug mode. */
        const char *debug_opts;
-/** Arguments for normal assembly mode.  PENDING: ignored */
+        /** Arguments for normal assembly mode. */
        const char *plain_opts;
        /* print externs as global */
        int externGlobal;
@@ -71,11 +75,13 @@ typedef struct
     /* linker related info */
     struct
       {
-/** Command to run (eg link-z80) */
+        /** Command to run (eg link-z80) */
        const char **cmd;
-/** If non-null will be used to execute the link. */
+        /** Alternate macro based form. */
+        const char *mcmd;
+        /** If non-null will be used to execute the link. */
        void (*do_link) (void);
-/** Extention for object files (.rel, .obj, ...) */
+        /** Extention for object files (.rel, .obj, ...) */
        const char *rel_ext;
       }
     linker;
@@ -148,13 +154,10 @@ typedef struct
        /** One more than the smallest 
            mul/div operation the processor can do nativley 
            Eg if the processor has an 8 bit mul, nativebelow is 2 */
-       int native_below;
-       /** The mul/div/mod functions will be made to use regparams
-           for sizeof(param) < log2(force_reg)
-           i.e. Use 2 for WORD and BYTE, 0 for none. */
-       int force_reg_param_below;
+       unsigned muldiv;
+        unsigned shift;
       }
-    muldiv;
+    support;
 
 /** Prefix to add to a C function (eg "_") */
     const char *fun_prefix;
@@ -201,6 +204,15 @@ typedef struct
     */
     int (*process_pragma) (const char *sz);
 
+    /** Mangles a support function name to reflect the calling model. 
+     */
+    char *(*getMangledFunctionName) (char *szOrginial);
+
+    /** Returns true if the port can multiply the two types nativly
+        without using support functions.
+    */
+    bool (*hasNativeMulFor) (iCode *ic, sym_link *left, sym_link *right);
+
     /** If TRUE, then tprintf and !dw will be used for some initalisers
      */
     bool use_dw_for_init;
@@ -213,6 +225,8 @@ typedef struct
     bool ne_neq;               /* transform a != b --> ! (a == b)  */
     bool eq_nne;               /* transform a == b --> ! (a != b)  */
 
+    bool arrayInitializerSuppported;  
+      
 #define PORT_MAGIC 0xAC32
 /** Used at runtime to detect if this structure has been completly filled in. */
     int magic;