Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/*
32
$Log: regmacs.h,v $
33
 * Revision 1.1.1.1  1998/01/17  15:56:03  release
34
 * First version to be checked into rolling release.
35
 *
36
 * Revision 1.3  1996/01/10  17:18:57  wfs
37
 * Corrected definition of "IS_TREG" macro + cosmetic changes to needscan.c
38
 *
39
 * Revision 1.2  1995/12/18  13:12:32  wfs
40
 * Put hppatrans uder cvs control. Major Changes made since last release
41
 * include:
42
 * (i) PIC code generation.
43
 * (ii) Profiling.
44
 * (iii) Dynamic Initialization.
45
 * (iv) Debugging of Exception Handling and Diagnostics.
46
 *
47
 * Revision 5.0  1995/08/25  14:00:27  wfs
48
 * Preperation for August 95 Glue release
49
 *
50
 * Revision 4.0  1995/08/25  13:34:00  wfs
51
 * ..
52
 *
53
 * Revision 4.0  1995/08/25  13:34:00  wfs
54
 * ..
55
 *
56
 * Revision 3.4  1995/08/25  11:05:02  wfs
57
 * Major revision of internal register synonym's
58
 *
59
 * Revision 3.4  1995/08/25  11:05:02  wfs
60
 * Major revision of internal register synonym's
61
 *
62
 * Revision 3.1  95/04/10  16:28:07  16:28:07  wfs (William Simmonds)
63
 * Apr95 tape version.
64
 * 
65
 * Revision 3.0  95/03/30  11:18:56  11:18:56  wfs (William Simmonds)
66
 * Mar95 tape version with CRCR95_178 bug fix.
67
 * 
68
 * Revision 2.0  95/03/15  15:28:46  15:28:46  wfs (William Simmonds)
69
 * spec 3.1 changes implemented, tests outstanding.
70
 * 
71
 * Revision 1.1  95/01/11  13:43:36  13:43:36  wfs (William Simmonds)
72
 * Initial revision
73
 * 
74
*/
75
 
76
 
77
#ifndef REGMACS_INCLUDED
78
#define REGMACS_INCLUDED
79
 
80
 
81
                /****************************/
82
               /*   HP_PA FIXED REGISTERS  */
83
              /****************************/
84
 
85
#define GR0             0       /* Hard wired to 0           */
86
#define GR1             1      /* First temporary register  */
87
#define GR2             2     
88
#define GR3		16   /*  C  */   
89
#define GR4		17   /*  a  */
90
#define GR5		18   /*  l  */
91
#define GR6		19   /*  l  */
92
#define GR7		20   /*  e  */
93
#define GR8		21   /*  e  */
94
#define GR9		22   /*     */
95
#define GR10		23   /*     */
96
#define GR11		24   /*     */
97
#define GR12		25   /*     */
98
#define GR13		26   /*     */
99
#define GR14		27   /*  S  */
100
#define GR15		28   /*  a  */
101
#define GR16		29   /*  v  */
102
#define GR17		30   /*  e  */
103
#define GR18		31   /*  s  */
104
#define GR19            3
105
#define GR20            4
106
#define GR21            5
107
#define GR22            6
108
#define GR23            10            
109
#define GR24            9
110
#define GR25            8
111
#define GR26            7
112
#define GR27            11
113
#define GR28            12
114
#define GR29            13
115
#define GR30            14
116
#define GR31            15
117
 
118
                /****************************/
119
               /*   HP_PA SPACE REGISTERS  */
120
              /****************************/
121
 
122
#define SR0             0
123
#define SR1             1
124
#define SR2             2
125
#define SR3             3
126
#define SR4             4
127
#define SR5             5
128
#define SR6             6
129
#define SR7             7
130
 
131
                /**************/
132
               /*  Synonyms  */
133
              /**************/
134
 
135
#define SP	   GR30               /*  Stack Pointer              */
136
#define DP         GR27              /*  Global Data Pointer        */
137
#define RP         GR2              /*  Return Pointer             */
138
#define T4         GR19            /*  Fourth Temporary Register  */
139
#define T3         GR20           /*  Third Temporary Register   */
140
#define T2         GR21          /*  Second Temporary Register  */
141
#define T1         GR22         /*  First Temporary Register   */
142
#define MRP        GR31        /*  Millicode Return Pointer   */
143
#define ARG3       GR23       /*  Argument Word 3            */
144
#define ARG2       GR24      /*  Argument Word 2            */
145
#define ARG1       GR25     /*  Argument Word 1            */
146
#define ARG0       GR26    /*  Argument Word 0            */
147
#define RET0       GR28   /*  Return value               */
148
#define RET1       GR29  /*  Return Value               */
149
 
150
 
151
#define FP         GR3  /* Frame Pointer. GR3 is reserved for use as a
152
                           frame pointer iff Has_fp==1 (cf. frames.c).  */
153
 
154
int EP;  /*  EP is a register which holds the frames original stack pointer.
155
             EP=GR3, if has_vsp==1, or SP otherwise (c.f. frames.c).  */
156
 
157
 
158
/* Range of all fixed registers */
159
#define R_FIRST		0
160
#define R_LAST		31
161
 
162
 
163
/*
164
    HP_PA FLOATING POINT REGISTERS
165
 
166
    Two representations are used in hppatrans, 0...15 to represent 16
167
    register-pairs for doubles at the higher (e.g. fregalloc) levels, and
168
    0...31 at the lower (assembler) levels.  This is somewhat confusing,
169
    conversion is one way using a 'frg << 1'-like expression, often in
170
    the parameter position of a ???_ins () function call.
171
*/
172
 
173
/* Floating point registers */
174
#define R_FR0		0	/* floating point zero */
175
#define R_FR4		4	/* procedure float result register */
176
 
177
/* Range of all floating point registers */
178
#define R_FLT_FIRST	0
179
#define R_FLT_LAST	31
180
 
181
 
182
/*
183
    PSEUDO-REGISTER CODES
184
*/
185
 
186
#define R_NO_REG	100	/* code for no register allocated */
187
#define R_USE_RES_REG	101	/* code to indicate result register */
188
#define R_DEFER_FR4	16	/* code to indicate %fr4 to be used */
189
 
190
 
191
/*
192
    REGISTER MASKS
193
    A register mask, with one bit per register, is used in 'space' etc.
194
    A set bit indicates that the register is not available for allocation.
195
*/
196
 
197
#define	RMASK( r )	( ( ( long ) 1 ) << ( r ) )
198
 
199
 
200
/*
201
    REGISTER SETS
202
 
203
    IS_FIXREG tests for fixed registers, IS_SREG for s-registers (those
204
    preserved over procedure calls), and IS_TREG for t-registers (those
205
    not so preserved).  PARAM_TREGS gives all the procedure parameter
206
    registers (ARG0-ARG3)
207
*/
208
 
209
#define IS_FIXREG(r)  ( (r)>=R_FIRST && (r)<=R_LAST)
210
#define IS_SREG(r)    ( (r)>=GR3 && (r)<=GR18 )
211
#define IS_TREG(r)    ( ( (r)>GR0 && (r)<=GR2 ) || ( (r)>=GR19 && (r)<= GR31 ) )
212
 
213
#define PARAM_TREGS   RMASK(ARG0)|RMASK(ARG1)|RMASK(ARG2)|RMASK(ARG3)
214
#define PROC_TREGS    -65536 /*  i.e. 11111111111111110000000000000000  */
215
 
216
#define IS_FLT_SREG( r )	0
217
/*#define IS_FLT_TREG( r )	( ( r ) >= 0 && ( r ) <= 15 )  */
218
#define IS_FLT_TREG( r )	( ((r)>7 && (r)<12) || ((r)>21 && (r)<32 ) )
219
#define PARAM_FLT_TREGS		0x0000
220
#define PROC_FLT_TREGS		0x0000
221
#define MAXFLOAT_TREGS		14
222
 
223
 
224
#endif /* REGMACS_INCLUDED */
225
 
226
 
227
 
228
 
229
 
230
 
231
 
232
 
233
 
234
 
235
 
236
 
237
 
238
 
239
 
240
 
241
 
242
 
243
 
244
 
245
 
246