* src/ds390/main.c (_ds390_genInitStartup): added
[fw/sdcc] / src / izt / izt.h
index 3a8fc8ce2016672677a3a11ad79e0c4f7335226e..8a76f8457670752c22b86bf85e5db62e9ac50a0c 100644 (file)
@@ -1,51 +1,7 @@
 #include <common.h>
-
-typedef enum {
-    REG_ID_NONE,
-    // Z80
-    REG_ID_A,
-    REG_ID_B,
-    REG_ID_C,
-    REG_ID_D,
-    REG_ID_E,
-    REG_ID_H,
-    REG_ID_L,
-    REG_ID_AF,
-    REG_ID_BC,
-    REG_ID_DE,
-    REG_ID_HL,
-    REG_ID_IX,
-    REG_ID_IY,
-    // TLCS-900H
-    REG_ID_XBC,
-    REG_ID_XDE,
-    // i186
-    REG_ID_CL,
-    REG_ID_CH,
-    REG_ID_CX,
-    REG_ID_DL,
-    REG_ID_DH,
-    REG_ID_DX,
-    REG_ID_MAX
-} REG_ID;
-
-enum {
-    REG_USED = 1,
-    REG_USED_HIDDEN = 2
-};
-
-enum {
-    REG_TYPE_CND = 1,
-    REG_TYPE_GPR = 2
-} REG_TYPE;
-
-typedef struct regs {
-    int size;
-    REG_ID id;
-    const char *name;
-    int used;
-    REG_ID hides[3];
-} REG;
+#include "gen.h"
+#include "regs.h"
+#include "aop.h"
 
 #define TEST(_d, _a) \
        (_a) ? (void)0 : (failures++, printf("Test %s \"%s\" failed.\n", #_a, _d), _dumpRegs())
@@ -54,9 +10,16 @@ typedef struct regs {
 
 typedef struct {
     REG *regs;
-} PORT_DATA;
+    /// One for each size {1, 2, 4}
+    REG *returnRegs[3];
+    REG *scratch;
+    REG *base_ptr;
+} IZT_PORT;
 
-PORT_DATA port_data;
+IZT_PORT *izt_port;
 
-void izt_init(REG *regs);
+void izt_init(IZT_PORT *port);
 void izt_assignRegisters (eBBlock **ebbs, int count);
+void izt_gen(iCode *ic);
+/// Return the base 2 log of i, providing i is a power of 2.
+int izt_util_binLog(int i);