added peepholes 182.d (return 0.0), 256 (range check), 257 (do while), 258.a-f ...
[fw/sdcc] / src / pic16 / pcode.h
index 3f8a1da3f910647a919d61eb3ac3ce70e1396306..f6ca309a61b3e2445bfa55cbfbf3e5d6ba00afdb 100644 (file)
@@ -439,9 +439,8 @@ typedef struct pCodeOpWild
                           * card will be expanded */
   pCodeOp *matched;       /* When a wild matches, we'll store a pointer to the
                           * opcode we matched */
-  int id2;               /* same as id but for second wild operand */
-  pCodeOp *subtype2;     /* Poiter to the second Operand type */
-  pCodeOp *matched2;     /* same as matched but for second wil operand */
+
+  pCodeOp *pcop2;        /* second operand if exists */
 
 } pCodeOpWild;
 
@@ -648,6 +647,7 @@ typedef struct pCodeLabel
 
   char *label;
   int key;
+  int force;           /* label cannot be optimized out */
 
 } pCodeLabel;
 
@@ -861,7 +861,7 @@ typedef struct peepCommand {
 #define PCOR2(x)  ((pCodeOpReg2 *)(x))
 #define PCORB(x)  ((pCodeOpRegBit *)(x))
 #define PCOW(x)   ((pCodeOpWild *)(x))
-
+#define PCOW2(x)  (PCOW(PCOW(x)->pcop2))
 #define PBR(x)    ((pBranch *)(x))
 
 #define PCWB(x)   ((pCodeWildBlock *)(x))
@@ -900,6 +900,7 @@ pCode *pic16_newpCodeCharP(char *cP);              // Create a new pCode given a
 pCode *pic16_newpCodeInlineP(char *cP);            // Create a new pCode given a char *
 pCode *pic16_newpCodeFunction(char *g, char *f);   // Create a new function
 pCode *pic16_newpCodeLabel(char *name,int key);    // Create a new label given a key
+pCode *pic16_newpCodeLabelFORCE(char *name, int key); // Same as newpCodeLabel but label cannot be optimized out
 pCode *pic16_newpCodeCSource(int ln, char *f, char *l); // Create a new symbol line 
 pBlock *pic16_newpCodeChain(memmap *cm,char c, pCode *pc); // Create a new pBlock
 void pic16_printpBlock(FILE *of, pBlock *pb);      // Write a pBlock to a file
@@ -913,8 +914,10 @@ void pic16_printCallTree(FILE *of);
 void pCodePeepInit(void);
 void pic16_pBlockConvert2ISR(pBlock *pb);
 void pic16_pBlockConvert2Absolute(pBlock *pb);
-void pic16_emitDB(pBlock *pb, char c);           // Add DB directives to a pBlock
-void pic16_flushDB(pBlock *pb);                          // Add pending DB data to a pBlock
+void pic16_initDB(void);
+void pic16_emitDB(char c, char ptype, void *p);                  // Add DB directives to a pBlock
+void pic16_emitDS(char *s, char ptype, void *p);
+void pic16_flushDB(char ptype, void *p);                         // Add pending DB data to a pBlock
 
 pCode *pic16_newpCodeAsmDir(char *asdir, char *argfmt, ...); 
 
@@ -980,6 +983,11 @@ extern pCodeOpReg pic16_pc_plusw2;
 extern pCodeOpReg pic16_pc_prodl;
 extern pCodeOpReg pic16_pc_prodh;
 
+extern pCodeOpReg pic16_pc_eecon1;
+extern pCodeOpReg pic16_pc_eecon2;
+extern pCodeOpReg pic16_pc_eedata;
+extern pCodeOpReg pic16_pc_eeadr;
+
 extern pCodeOpReg pic16_pc_kzero;
 extern pCodeOpReg pic16_pc_wsave;     /* wsave and ssave are used to save W and the Status */
 extern pCodeOpReg pic16_pc_ssave;     /* registers during an interrupt */