Quick Search:

View

Revision:
Expand:  
Changeset: MAIN:gmcgarry:20071122181036

Diff

Diff from 1.4 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/pcc/pcc/arch/mips/macdefs.h

Annotated File View

gmcgarry
1.4
1 /*      $Id: macdefs.h,v 1.4 2007/11/22 18:10:36 gmcgarry Exp $ */
ragge
1.1
2 /*
3  * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. The name of the author may not be used to endorse or promote products
15  *    derived from this software without specific prior written permission
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 /*
30  * MIPS port by Jan Enoksson (janeno-1@student.ltu.se) and
31  * Simon Olsson (simols-1@student.ltu.se) 2005.
32  */
33
34 /*
35  * Machine-dependent defines for both passes.
36  */
37
gmcgarry
1.3
38 #if TARGOS == netbsd
39 #define USE_GAS
40 #endif
41
ragge
1.1
42 /*
43  * Convert (multi-)character constant to integer.
44  * Assume: If only one value; store at left side (char size), otherwise 
45  * treat it as an integer.
46  */
47 #define makecc(val,i)   lastcon = (lastcon<<8)|((val<<24)>>24);
48
gmcgarry
1.3
49 #define ARGINIT         (12*8)  /* # bits above fp where arguments start */
50 #define AUTOINIT        (0)     /* # bits below fp where automatics start */
ragge
1.1
51
52 /*
53  * Storage space requirements
54  */
55 #define SZCHAR          8
gmcgarry
1.2
56 #define SZBOOL          32
ragge
1.1
57 #define SZINT           32
58 #define SZFLOAT         32
59 #define SZDOUBLE        64
gmcgarry
1.3
60 #define SZLDOUBLE       128
ragge
1.1
61 #define SZLONG          32
62 #define SZSHORT         16
63 #define SZLONGLONG      64
64 #define SZPOINT(t)      32
65
66 /*
67  * Alignment constraints
68  */
69 #define ALCHAR          8
gmcgarry
1.2
70 #define ALBOOL          32
ragge
1.1
71 #define ALINT           32
72 #define ALFLOAT         32
73 #define ALDOUBLE        32
74 #define ALLDOUBLE       32
75 #define ALLONG          32
76 #define ALLONGLONG      32
77 #define ALSHORT         16
78 #define ALPOINT         32
79 #define ALSTRUCT        32
80 #define ALSTACK         32 
81
82 /*
83  * Min/max values.
84  */
85 #define MIN_CHAR        -128
86 #define MAX_CHAR        127
87 #define MAX_UCHAR       255
88 #define MIN_SHORT       -32768
89 #define MAX_SHORT       32767
90 #define MAX_USHORT      65535
91 #define MIN_INT         -1
92 #define MAX_INT         0x7fffffff
93 #define MAX_UNSIGNED    0xffffffff
94 #define MIN_LONG        MIN_INT
95 #define MAX_LONG        MAX_INT
96 #define MAX_ULONG       MAX_UNSIGNED
97 #define MIN_LONGLONG    0x8000000000000000LL
98 #define MAX_LONGLONG    0x7fffffffffffffffLL
99 #define MAX_ULONGLONG   0xffffffffffffffffULL
100
101 #undef  CHAR_UNSIGNED
gmcgarry
1.2
102 #define TARGET_STDARGS
103 #define BOOL_TYPE       INT
104 #define WCHAR_TYPE      INT
ragge
1.1
105
106 /*
107  * Use large-enough types.
108  */
109 typedef long long CONSZ;
110 typedef unsigned long long U_CONSZ;
111 typedef long long OFFSZ;
112
113 #define CONFMT  "%lld"          /* format for printing constants */
gmcgarry
1.3
114 #ifdef USE_GAS
115 #define LABFMT  "$L%d"          /* format for printing labels */
116 #define STABLBL "$LL%d"         /* format for stab (debugging) labels */
117 #else
gmcgarry
1.2
118 #define LABFMT  "L%d"           /* format for printing labels */
119 #define STABLBL "LL%d"          /* format for stab (debugging) labels */
ragge
1.1
120 #endif
121
122 #define BACKAUTO                /* stack grows negatively for automatics */
123 #define BACKTEMP                /* stack grows negatively for temporaries */
124
125 #undef  FIELDOPS                /* no bit-field instructions */
126 #define RTOLBYTES               /* bytes are numbered right to left */
127
128 #define ENUMSIZE(high,low) INT  /* enums are always stored in full int */
129
130 /* Definitions mostly used in pass2 */
131
132 #define BYTEOFF(x)      ((x)&03)
gmcgarry
1.3
133 #define BITOOR(x)       (x)     /* bit offset to oreg offset */
ragge
1.1
134
135 #define szty(t) (((t) == DOUBLE || (t) == FLOAT || \
136         (t) == LONGLONG || (t) == ULONGLONG) ? 2 : 1)
137
138 /*
139  * Register names.  These must match rnames[] and rstatus[] in local2.c.
140  */
gmcgarry
1.3
141 #define ZERO    0
142 #define AT      1
143 #define V0      2
144 #define V1      3
145 #define A0      4
146 #define A1      5
147 #define A2      6
148 #define A3      7
149 #if defined(MIPS_N32) || defined(MIPS_N64)
150 #define A4      8
151 #define A5      9
152 #define A6      10
153 #define A7      11
154 #define T0      12
155 #define T1      13
156 #define T2      14
157 #define T3      15
158 #else
159 #define T0      8
160 #define T1      9
161 #define T2      10
162 #define T3      11
163 #define T4      12
164 #define T5      13
165 #define T6      14
166 #define T7      15
167 #endif
168 #define S0      16
169 #define S1      17
170 #define S2      18
171 #define S3      19
172 #define S4      20
173 #define S5      21
174 #define S6      22
175 #define S7      23
176 #define T8      24
177 #define T9      25
178 #define K0      26
179 #define K1      27
180 #define GP      28
181 #define SP      29
182 #define FP      30
183 #define RA      31
184
185 #define V0V1    32
186 #define A0A1    33
187 #define A1A2    34
188 #define A2A3    35
189 #if defined(MIPS_N32) || defined(MIPS_N64)
190 #define A3A4    36
191 #define A4A5    37
192 #define A5A6    38
193 #define A6A7    39
194 #define T0T1    41
195 #define T1T2    42
196 #define T2T3    43
197 #else
198 #define T0T1    37
199 #define T1T2    38
200 #define T2T3    39
201 #define T3T4    40
202 #define T4T5    41
203 #define T5T6    42
204 #define T6T7    43
205 #endif
206 #define T8T9    44
207 #define S0S1    45
208 #define S1S2    46
209 #define S2S3    47
210 #define S3S4    48
211 #define S4S5    49
212 #define S5S6    50
213 #define S6S7    51
214
215 #define F0      52
216 #define F1      53
217 #define F2      54
gmcgarry
1.4
218 #define F3      55
219 #define F4      56
220 #define F5      57
221 #define F6      58
222 #define F7      59
223 #define F8      60
224 #define F9      61
225 #define F10     62
226 #define F11     63
227 /* and the reset for later */
228 #define F12     64
229 #define F13     65
230 #define F14     66
231 #define F15     67
232 #define F16     68
233 #define F17     69
234 #define F18     70
235 #define F19     71
236 #define F20     72
237 #define F21     73
238 #define F22     74
239 #define F23     75
240 #define F24     76
241 #define F25     77
242 #define F26     78
243 #define F27     79
244 #define F28     80
245 #define F29     81
246 #define F30     82
247 #define F31     83
gmcgarry
1.2
248
gmcgarry
1.4
249 #define MAXREGS 64
gmcgarry
1.3
250 #define NUMCLASS 3
251
252 #define RETREG(x)       ((x) == ULONGLONG || (x) == LONGLONG ? V0V1 : V0)
ragge
1.1
253 #define FPREG   FP      /* frame pointer */
gmcgarry
1.2
254 #define STKREG  SP
255
gmcgarry
1.3
256 #if defined(MIPS_N32) || defined(MIPS_N64)
257 #define MIPS_NARGREGS   8
258 #else
259 #define MIPS_NARGREGS   4
260 #endif
ragge
1.1
261
gmcgarry
1.2
262 #define RSTATUS \
gmcgarry
1.3
263         00,                                                           \
264         SAREG|TEMPREGSAREG|TEMPREG,                                   \
gmcgarry
1.2
265         SAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREG,     \
266         SAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREG,     \
267         SAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREG,     \
268         SAREG|PERMREGSAREG|PERMREGSAREG|PERMREGSAREG|PERMREG,     \
269         SAREG|PERMREGSAREG|PERMREGSAREG|PERMREGSAREG|PERMREG,     \
gmcgarry
1.3
270         SAREG|TEMPREGSAREG|TEMPREG,                                   \
gmcgarry
1.2
271         00,                                                           \
gmcgarry
1.3
272         0000,                                                     \
273         \
274         SBREG|TEMPREG,                                                  \
275         SBREG|TEMPREGSBREG|TEMPREGSBREG|TEMPREG,                    \
276         SBREG|TEMPREG/* only available on n32/n64 */                  \
277         SBREG|TEMPREGSBREG|TEMPREGSBREG|TEMPREG,                    \
278         SBREG|TEMPREG/* only available on o32 */                      \
279         SBREG|TEMPREG,                                                  \
280         SBREG|TEMPREGSBREG|TEMPREGSBREG|TEMPREG,                    \
281         SBREGSBREGSBREGSBREG,                                     \
282         SBREGSBREGSBREG,                                            \
283         SCREGSCREGSCREG
gmcgarry
1.2
284
285 #define ROVERLAP \
gmcgarry
1.3
286         { -1 }, { -1 },                                                 \
287         { V0V1, -1 }, { V0V1, -1 },                                     \
288         { A0A1, -1 },                                                   \
289         { A0A1A1A2, -1 },                                             \
290         { A1A2A2A3, -1 },                                             \
291         { A2A3, -1 },                                                   \
292         \
293         { T0T1, -1 },                                                   \
294         { T0T1T1T2, -1 },                                             \
295         { T1T2T2T3, -1 },                                             \
296         { T2T3T3T4, -1 },                                             \
297         { T3T4T4T5, -1 },                                             \
298         { T4T5T5T6, -1 },                                             \
299         { T5T6T6T7, -1 },                                             \
300         { T6T7, -1 },                                                   \
301         \
302         { S0S1, -1 },                                                   \
303         { S0S1S1S2, -1 },                                             \
304         { S1S2S2S3, -1 },                                             \
305         { S2S3S3S4, -1 },                                             \
306         { S3S4S4S5, -1 },                                             \
307         { S4S5S5S6, -1 },                                             \
308         { S5S6S6S7, -1 },                                             \
309         { S6S7, -1 },                                                   \
310         \
311         { T8T9, -1 },                                                   \
312         { T8T9, -1 },                                                   \
313         \
314         { -1 }, { -1 },                                                 \
gmcgarry
1.2
315         { -1 }, { -1 }, { -1 }, { -1 },                                 \
gmcgarry
1.3
316         \
317         { V0V1, -1 },                                                 \
318         \
319         { A0A1, -1 },                                                 \
320         { A1A2, -1 },                                                 \
321         { A2A3, -1 },                                                 \
322         \
323         { -1 }, /* only useful on n32/n64 */                            \
324         { T0T1T1T2, -1 },                                           \
325         { T1T2T0T1T2T3, -1 },                                     \
326         { T2T3T1T2T3T4, -1 },                                     \
327         { T3T4T2T3T4T5, -1 }, /* only useful on o32 */            \
328         { T4T5T3T4T5T6, -1 },                                     \
329         { T5T6T4T5T6T7, -1 },                                     \
330         { T6T7T5T6, -1 },                                           \
331         \
332         { T8T9, -1 },                                                 \
333         \
334         { S0S1S1S2, -1 },                                           \
335         { S1S2S0S1S2S3, -1 },                                     \
336         { S2S3S1S2S3S4, -1 },                                     \
337         { S3S4S2S3S4S5, -1 },                                     \
338         { S4S5S3S4S5S6, -1 },                                     \
339         { S5S6S4S5S6S7, -1 },                                     \
340         { S6S7S5S6, -1 },                                           \
341         \
342         { -1 },                                                         \
343         { -1 },                                                         \
344         { -1 },
345
346
347 #define GCLASS(x)       (x < 32 ? CLASSA : (x < 52 ? CLASSB : CLASSC))
gmcgarry
1.4
348 #define PCLASS(p)       (1 << gclass((p)->n_type))
gmcgarry
1.2
349 #define DECRA(x,y)      (((x) >> (y*6)) & 63)   /* decode encoded regs */
350 #define ENCRA(x,y)      ((x) << (6+y*6))        /* encode regs in int */
ragge
1.1
351
gmcgarry
1.2
352 int COLORMAP(int cint *r);
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-07-11 06:38 +0200