* device/include/pic16/pic18f*.h: add bit aliases in INTCONbits_t
[fw/sdcc] / src / hc08 / ralloc.h
1 /*-------------------------------------------------------------------------
2
3   SDCCralloc.h - header file register allocation
4
5                 Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
6
7    This program is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published by the
9    Free Software Foundation; either version 2, or (at your option) any
10    later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20    
21    In other words, you are welcome to use, share and improve this program.
22    You are forbidden to forbid anyone else to use, share and improve
23    what you give them.   Help stamp out software-hoarding!  
24 -------------------------------------------------------------------------*/
25 #include "SDCCicode.h"
26 #include "SDCCBBlock.h"
27 #ifndef SDCCRALLOC_H
28 #define SDCCRALLOC_H 1
29
30 enum
31   {
32     A_IDX,
33     H_IDX,
34     X_IDX,
35     HX_IDX,
36     XA_IDX,
37     CND_IDX,
38     SP_IDX
39   };
40
41
42 #define REG_PTR 0x01
43 #define REG_GPR 0x02
44 #define REG_CND 0x04
45
46 /* definition for the registers */
47 typedef struct regs
48   {
49     short type;                 /* can have value 
50                                    REG_GPR, REG_PTR or REG_CND */
51     short rIdx;                 /* index into register table */
52     char *name;                 /* name */
53     short mask;                 /* bitmask for pair allocation */
54     struct asmop *aop;          /* last operand */
55     int aopofs;                 /* last operand offset */
56     unsigned isFree:1;          /* is currently unassigned  */
57   }
58 regs;
59 extern regs regshc08[];
60 extern regs *hc08_reg_a;
61 extern regs *hc08_reg_x;
62 extern regs *hc08_reg_h;
63 extern regs *hc08_reg_hx;
64 extern regs *hc08_reg_xa;
65 extern regs *hc08_reg_sp;
66
67 regs *hc08_regWithIdx (int);
68 void hc08_useReg (regs * reg);
69 void hc08_freeReg (regs * reg);
70 void hc08_dirtyReg (regs * reg, bool freereg);
71 bitVect *hc08_rUmaskForOp (operand * op);
72
73 #endif