X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic%2Fralloc.h;h=7835c48fec8d85c84dd0e5169e7472b51840d0cc;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hp=9bf058defdcd1f578373538d00023193dd206d36;hpb=5c2990959f40ee6e532721a99c7f17969b3f6c4c;p=fw%2Fsdcc diff --git a/src/pic/ralloc.h b/src/pic/ralloc.h index 9bf058de..7835c48f 100644 --- a/src/pic/ralloc.h +++ b/src/pic/ralloc.h @@ -23,23 +23,15 @@ You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -#include "SDCCicode.h" -#include "SDCCBBlock.h" + #ifndef SDCCRALLOC_H #define SDCCRALLOC_H 1 +#include "common.h" + #include "pcoderegs.h" -enum -{ - R2_IDX = 0, R3_IDX, R4_IDX, - R5_IDX, R6_IDX, R7_IDX, - R0_IDX, R1_IDX, X8_IDX, - X9_IDX, X10_IDX, X11_IDX, - X12_IDX, CND_IDX -}; - enum { REG_PTR=1, REG_GPR, @@ -48,12 +40,6 @@ enum { REG_STK, REG_TMP }; -//#define REG_PTR 0x01 -//#define REG_GPR 0x02 -//#define REG_CND 0x04 -//#define REG_SFR 0x08 -//#define REG_STK 0x10 /* Use a register as a psuedo stack */ -//#define REG_TMP 0x20 /* definition for the registers */ typedef struct regs @@ -82,7 +68,6 @@ typedef struct regs } regs; extern regs regspic14[]; -extern int pic14_nRegs; extern int Gstack_base_addr; /* @@ -98,16 +83,21 @@ extern set *dynDirectBitRegs; extern set *dynInternalRegs; +void initStack(int base_address, int size, int shared); regs *pic14_regWithIdx (int); regs *dirregWithName (char *name ); -void pic14_freeAllRegs (); -void pic14_deallocateAllRegs (); +void pic14_assignRegisters (ebbIndex *ebbi); regs *pic14_findFreeReg(short type); regs *pic14_allocWithIdx (int idx); regs *typeRegWithIdx (int idx, int type, int fixed); regs *regFindWithName (const char *name); +void pic14_debugLogClose(void); +void writeUsedRegs(FILE *of); + regs *allocDirReg (operand *op ); +regs *allocInternalRegister(int rIdx, char * name, PIC_OPTYPE po_type, int alias); +regs *allocProcessorRegister(int rIdx, char * name, short po_type, int alias); regs *allocRegByName (char *name, int size ); regs *allocNewDirReg (sym_link *symlnk,const char *name); @@ -127,4 +117,6 @@ regs *allocNewDirReg (sym_link *symlnk,const char *name); #define IDX_SSAVE 0x7ffd #define IDX_PSAVE 0x7ffc +#define pic14_nRegs 128 + #endif