Imported Upstream version 2.9.0
[debian/cc1111] / src / pic16 / pcodeflow.h
1 /*-------------------------------------------------------------------------
2
3   pcode.h - post code generation
4
5    Written By -  Scott Dattalo scott@dattalo.com
6    PIC16 port -  Martin Dubuc m.dubuc@rogers.com
7
8    This program is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published by the
10    Free Software Foundation; either version 2, or (at your option) any
11    later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21    
22 -------------------------------------------------------------------------*/
23
24 #ifndef __PCODEFLOW_H__
25 #define __PCODEFLOW_H__
26
27 /*************************************************
28  * pCode conditions:
29  *
30  * The "conditions" are bit-mapped flags that describe
31  * input and/or output conditions that are affected by
32  * the instructions. For example:
33  *
34  *    MOVF   SOME_REG,W
35  *
36  * This instruction depends upon 'SOME_REG'. Consequently
37  * it has the input condition PCC_REGISTER set to true.
38  *
39  * In addition, this instruction affects the Z bit in the
40  * status register and affects W. Thus the output conditions
41  * are the logical or:
42  *  PCC_ZERO_BIT | PCC_W
43  *
44  * The conditions are intialized when the pCode for an
45  * instruction is created. They're subsequently used
46  * by the pCode optimizer determine state information
47  * in the program flow.
48  *************************************************/
49
50 #define  PCC_NONE          0
51 #define  PCC_REGISTER      (1<<0)
52 #define  PCC_REGISTER2     (1<<1)
53 #define  PCC_C             (1<<2)
54 #define  PCC_Z             (1<<3)
55 #define  PCC_DC            (1<<4)
56 #define  PCC_OV            (1<<5)
57 #define  PCC_N             (1<<6)
58 #define  PCC_W             (1<<7)
59 #define  PCC_EXAMINE_PCOP  (1<<8)
60 #define  PCC_LITERAL       (1<<9)
61 #define  PCC_REL_ADDR      (1<<10)
62
63 #define PCC_STATUS      (PCC_C | PCC_Z | PCC_DC | PCC_OV | PCC_N)
64
65 /*------------------------------------------------------------*/
66
67 void BuildFlowAncestry(pBlock *pb);
68
69 #endif // __PCODEFLOW_H__