* src/ds390/main.c (_ds390_genInitStartup): added
[fw/sdcc] / src / izt / izt.h
index 968d278e558010f2eb63579031a4697c1f5d26af..8a76f8457670752c22b86bf85e5db62e9ac50a0c 100644 (file)
@@ -1,52 +1,7 @@
 #include <common.h>
 #include "gen.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 "regs.h"
+#include "aop.h"
 
 #define TEST(_d, _a) \
        (_a) ? (void)0 : (failures++, printf("Test %s \"%s\" failed.\n", #_a, _d), _dumpRegs())
@@ -55,6 +10,10 @@ typedef struct regs {
 
 typedef struct {
     REG *regs;
+    /// One for each size {1, 2, 4}
+    REG *returnRegs[3];
+    REG *scratch;
+    REG *base_ptr;
 } IZT_PORT;
 
 IZT_PORT *izt_port;
@@ -62,3 +21,5 @@ IZT_PORT *izt_port;
 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);