Quick Search:

View

Revision:
Expand:  
Changeset: MAIN:gmcgarry:20071128022353

Diff

Diff from 1.6 to:

Annotations

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

Annotated File View

gmcgarry
1.6
1 /*      $Id: macdefs.h,v 1.6 2007/11/28 02:23:53 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 BOOL_TYPE       INT
103 #define WCHAR_TYPE      INT
ragge
1.1
104
105 /*
106  * Use large-enough types.
107  */
108 typedef long long CONSZ;
109 typedef unsigned long long U_CONSZ;
110 typedef long long OFFSZ;
111
112 #define CONFMT  "%lld"          /* format for printing constants */
gmcgarry
1.3
113 #ifdef USE_GAS
114 #define LABFMT  "$L%d"          /* format for printing labels */
115 #define STABLBL "$LL%d"         /* format for stab (debugging) labels */
116 #else
gmcgarry
1.2
117 #define LABFMT  "L%d"           /* format for printing labels */
118 #define STABLBL "LL%d"          /* format for stab (debugging) labels */
ragge
1.1
119 #endif
120
121 #define BACKAUTO                /* stack grows negatively for automatics */
122 #define BACKTEMP                /* stack grows negatively for temporaries */
123
124 #undef  FIELDOPS                /* no bit-field instructions */
125 #define RTOLBYTES               /* bytes are numbered right to left */
126
127 #define ENUMSIZE(high,low) INT  /* enums are always stored in full int */
128
129 /* Definitions mostly used in pass2 */
130
131 #define BYTEOFF(x)      ((x)&03)
gmcgarry
1.3
132 #define BITOOR(x)       (x)     /* bit offset to oreg offset */
ragge
1.1
133
134 #define szty(t) (((t) == DOUBLE || (t) == FLOAT || \
135         (t) == LONGLONG || (t) == ULONGLONG) ? 2 : 1)
136
137 /*
138  * Register names.  These must match rnames[] and rstatus[] in local2.c.
139  */
gmcgarry
1.3
140 #define ZERO    0
141 #define AT      1
142 #define V0      2
143 #define V1      3
144 #define A0      4
145 #define A1      5
146 #define A2      6
147 #define A3      7
148 #if defined(MIPS_N32) || defined(MIPS_N64)
149 #define A4      8
150 #define A5      9
151 #define A6      10
152 #define A7      11
153 #define T0      12
154 #define T1      13
155 #define T2      14
156 #define T3      15
157 #else
158 #define T0      8
159 #define T1      9
160 #define T2      10
161 #define T3      11
162 #define T4      12
163 #define T5      13
164 #define T6      14
165 #define T7      15
166 #endif
167 #define S0      16
168 #define S1      17
169 #define S2      18
170 #define S3      19
171 #define S4      20
172 #define S5      21
173 #define S6      22
174 #define S7      23
175 #define T8      24
176 #define T9      25
177 #define K0      26
178 #define K1      27
179 #define GP      28
180 #define SP      29
181 #define FP      30
182 #define RA      31
183
184 #define V0V1    32
185 #define A0A1    33
186 #define A1A2    34
187 #define A2A3    35
188 #if defined(MIPS_N32) || defined(MIPS_N64)
189 #define A3A4    36
190 #define A4A5    37
191 #define A5A6    38
192 #define A6A7    39
193 #define T0T1    41
194 #define T1T2    42
195 #define T2T3    43
196 #else
197 #define T0T1    37
198 #define T1T2    38
199 #define T2T3    39
200 #define T3T4    40
201 #define T4T5    41
202 #define T5T6    42
203 #define T6T7    43
204 #endif
205 #define T8T9    44
206 #define S0S1    45
207 #define S1S2    46
208 #define S2S3    47
209 #define S3S4    48
210 #define S4S5    49
211 #define S5S6    50
212 #define S6S7    51
213
214 #define F0      52
gmcgarry
1.6
215 #define F2      53
216 #define F4      54
217 #define F6      55
218 #define F8      56
219 #define F10     57
220 #define F12     58
221 #define F14     59
222 #define F16     68
223 #define F18     61
224 #define F20     62
225 #define F22     63
gmcgarry
1.5
226 /* and the rest for later */
gmcgarry
1.6
227 #define F24     64
228 #define F26     65
229 #define F28     66
230 #define F30     67
gmcgarry
1.2
231
gmcgarry
1.4
232 #define MAXREGS 64
gmcgarry
1.3
233 #define NUMCLASS 3
234
gmcgarry
1.6
235 #define RETREG(x)       (DEUNSIGN(x) == LONGLONG ? V0V1 : \
gmcgarry
1.5
236                             (x) == DOUBLE || (x) == LDOUBLE || (x) == FLOAT ? \
gmcgarry
1.6
237                             F0 : V0)
ragge
1.1
238 #define FPREG   FP      /* frame pointer */
gmcgarry
1.2
239
gmcgarry
1.5
240 #define MIPS_N32_NARGREGS       8
241 #define MIPS_O32_NARGREGS       4
ragge
1.1
242
gmcgarry
1.2
243 #define RSTATUS \
gmcgarry
1.3
244         00,                                                           \
245         SAREG|TEMPREGSAREG|TEMPREG,                                   \
gmcgarry
1.2
246         SAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREG,     \
247         SAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREG,     \
248         SAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREGSAREG|TEMPREG,     \
249         SAREG|PERMREGSAREG|PERMREGSAREG|PERMREGSAREG|PERMREG,     \
250         SAREG|PERMREGSAREG|PERMREGSAREG|PERMREGSAREG|PERMREG,     \
gmcgarry
1.3
251         SAREG|TEMPREGSAREG|TEMPREG,                                   \
gmcgarry
1.2
252         00,                                                           \
gmcgarry
1.3
253         0000,                                                     \
254         \
255         SBREG|TEMPREG,                                                  \
256         SBREG|TEMPREGSBREG|TEMPREGSBREG|TEMPREG,                    \
257         SBREG|TEMPREG/* only available on n32/n64 */                  \
258         SBREG|TEMPREGSBREG|TEMPREGSBREG|TEMPREG,                    \
259         SBREG|TEMPREG/* only available on o32 */                      \
260         SBREG|TEMPREG,                                                  \
261         SBREG|TEMPREGSBREG|TEMPREGSBREG|TEMPREG,                    \
262         SBREGSBREGSBREGSBREG,                                     \
263         SBREGSBREGSBREG,                                            \
gmcgarry
1.5
264         SCREGSCREGSCREGSCREG,                                     \
265         SCREGSCREGSCREGSCREG,                                     \
266         SCREGSCREGSCREGSCREG,                                     \
gmcgarry
1.2
267
268 #define ROVERLAP \
gmcgarry
1.3
269         { -1 }, { -1 },                                                 \
270         { V0V1, -1 }, { V0V1, -1 },                                     \
271         { A0A1, -1 },                                                   \
272         { A0A1A1A2, -1 },                                             \
273         { A1A2A2A3, -1 },                                             \
274         { A2A3, -1 },                                                   \
275         \
276         { T0T1, -1 },                                                   \
277         { T0T1T1T2, -1 },                                             \
278         { T1T2T2T3, -1 },                                             \
279         { T2T3T3T4, -1 },                                             \
280         { T3T4T4T5, -1 },                                             \
281         { T4T5T5T6, -1 },                                             \
282         { T5T6T6T7, -1 },                                             \
283         { T6T7, -1 },                                                   \
284         \
285         { S0S1, -1 },                                                   \
286         { S0S1S1S2, -1 },                                             \
287         { S1S2S2S3, -1 },                                             \
288         { S2S3S3S4, -1 },                                             \
289         { S3S4S4S5, -1 },                                             \
290         { S4S5S5S6, -1 },                                             \
291         { S5S6S6S7, -1 },                                             \
292         { S6S7, -1 },                                                   \
293         \
294         { T8T9, -1 },                                                   \
295         { T8T9, -1 },                                                   \
296         \
297         { -1 }, { -1 },                                                 \
gmcgarry
1.2
298         { -1 }, { -1 }, { -1 }, { -1 },                                 \
gmcgarry
1.3
299         \
300         { V0V1, -1 },                                                 \
301         \
302         { A0A1, -1 },                                                 \
303         { A1A2, -1 },                                                 \
304         { A2A3, -1 },                                                 \
305         \
306         { -1 }, /* only useful on n32/n64 */                            \
307         { T0T1T1T2, -1 },                                           \
308         { T1T2T0T1T2T3, -1 },                                     \
309         { T2T3T1T2T3T4, -1 },                                     \
310         { T3T4T2T3T4T5, -1 }, /* only useful on o32 */            \
311         { T4T5T3T4T5T6, -1 },                                     \
312         { T5T6T4T5T6T7, -1 },                                     \
313         { T6T7T5T6, -1 },                                           \
314         \
315         { T8T9, -1 },                                                 \
316         \
317         { S0S1S1S2, -1 },                                           \
318         { S1S2S0S1S2S3, -1 },                                     \
319         { S2S3S1S2S3S4, -1 },                                     \
320         { S3S4S2S3S4S5, -1 },                                     \
321         { S4S5S3S4S5S6, -1 },                                     \
322         { S5S6S4S5S6S7, -1 },                                     \
323         { S6S7S5S6, -1 },                                           \
324         \
gmcgarry
1.5
325         { -1 }, { -1 }, { -1 }, { -1 },                                 \
326         { -1 }, { -1 }, { -1 }, { -1 },                                 \
327         { -1 }, { -1 }, { -1 }, { -1 },                                 \
gmcgarry
1.3
328
329 #define GCLASS(x)       (x < 32 ? CLASSA : (x < 52 ? CLASSB : CLASSC))
gmcgarry
1.4
330 #define PCLASS(p)       (1 << gclass((p)->n_type))
gmcgarry
1.2
331 #define DECRA(x,y)      (((x) >> (y*6)) & 63)   /* decode encoded regs */
332 #define ENCRA(x,y)      ((x) << (6+y*6))        /* encode regs in int */
ragge
1.1
333
gmcgarry
1.2
334 int COLORMAP(int cint *r);
gmcgarry
1.5
335
336 extern int bigendian;
337 extern int nargregs;
gmcgarry
1.6
338
339 #define TARGET_STDARGS
340 #define TARGET_BUILTINS                                         \
341         { "__builtin_stdarg_start"mips_builtin_stdarg_start },        \
342         { "__builtin_va_arg"mips_builtin_va_arg },            \
343         { "__builtin_va_end"mips_builtin_va_end },            \
344         { "__builtin_va_copy"mips_builtin_va_copy },
345
346 struct node;
347 struct node *mips_builtin_stdarg_start(struct node *fstruct node *a);
348 struct node *mips_builtin_va_arg(struct node *fstruct node *a);
349 struct node *mips_builtin_va_end(struct node *fstruct node *a);
350 struct node *mips_builtin_va_copy(struct node *fstruct node *a);
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-10-30 17:42 +0100