Imported Upstream version 2.9.0
[debian/cc1111] / src / ds390 / 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     R2_IDX = 0, R3_IDX, R4_IDX, R5_IDX,
33     R6_IDX, R7_IDX, R0_IDX, R1_IDX,
34     DPL_IDX, DPH_IDX, DPX_IDX, B_IDX,
35     B0_IDX, B1_IDX, B2_IDX,  B3_IDX,
36     B4_IDX, B5_IDX, B6_IDX,  B7_IDX,
37     X8_IDX, X9_IDX, X10_IDX, X11_IDX,
38     X12_IDX, CND_IDX,
39     A_IDX, DPL1_IDX, DPH1_IDX,
40     DPX1_IDX, DPS_IDX, AP_IDX,
41     END_IDX
42   };
43
44
45 #define REG_PTR 0x01
46 #define REG_GPR 0x02
47 #define REG_CND 0x04
48 #define REG_BIT 0x08
49 /* definition for the registers */
50 typedef struct regs
51   {
52     short type;                 /* can have value 
53                                    REG_GPR, REG_PTR or REG_CND */
54     short rIdx;                 /* index into register table */
55     short otype;
56     char *name;                 /* name */
57     char *dname;                /* name when direct access needed */
58     char *base;                 /* base address */
59     short offset;               /* offset from the base */
60     unsigned isFree:1;          /* is currently unassigned  */
61     int  print;                 /* needs to be printed*/
62   }
63 regs;
64 extern regs regs390[];
65
66 regs *ds390_regWithIdx (int);
67
68 bitVect *ds390_rUmaskForOp (operand * op);
69 bitVect *ds390_allBitregs (void);
70
71 extern int ds390_ptrRegReq;
72 extern int ds390_nRegs;
73 extern int ds390_nBitRegs;
74
75 #endif