Debian Codegraph @

arch/vax/macdefs.h

raw symbols SCIP
1 /* $Id: macdefs.h,v 1.24 2021/10/08 15:59:07 ragge Exp $ */
2 /*
3 * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code and documentation must retain the above
10 * copyright notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditionsand the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed or owned by Caldera
17 * International, Inc.
18 * Neither the name of Caldera International, Inc. nor the names of other
19 * contributors may be used to endorse or promote products derived from
20 * this software without specific prior written permission.
21 *
22 * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
23 * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
27 * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT,
31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36 # define makecc(val,i) lastcon = (lastcon<<8)|((val<<24)>>24);
37
38 # define ARGINIT 32
39 # define AUTOINIT 0
40 # define SZCHAR 8
41 # define SZBOOL 8
42 # define SZINT 32
43 # define SZFLOAT 32
44 # define SZDOUBLE 64
45 # define SZLDOUBLE 64 /* XXX use longer? */
46 # define SZLONG 32
47 # define SZLONGLONG 64
48 # define SZSHORT 16
49 # define SZPOINT(t) 32
50 # define ALCHAR 8
51 # define ALBOOL 8
52 # define ALINT 32
53 # define ALFLOAT 32
54 # define ALDOUBLE 32
55 # define ALLDOUBLE 32
56 # define ALLONG 32
57 # define ALLONGLONG 32
58 # define ALSHORT 16
59 # define ALPOINT 32
60 # define ALSTRUCT 8
61 # define ALSTACK 32
62 #define MYVAARGSZ SZINT
63
64 /*
65 * Min/max values.
66 */
67 #define MIN_CHAR -128
68 #define MAX_CHAR 127
69 #define MAX_UCHAR 255
70 #define MIN_SHORT -32768
71 #define MAX_SHORT 32767
72 #define MAX_USHORT 65535
73 #define MIN_INT (-0x7fffffff-1)
74 #define MAX_INT 0x7fffffff
75 #define MAX_UNSIGNED 0xffffffff
76 #define MIN_LONG MIN_INT
77 #define MAX_LONG MAX_INT
78 #define MAX_ULONG MAX_UNSIGNED
79 #define MIN_LONGLONG 0x8000000000000000LL
80 #define MAX_LONGLONG 0x7fffffffffffffffLL
81 #define MAX_ULONGLONG 0xffffffffffffffffULL
82
83 /* Default char is signed */
84 #undef CHAR_UNSIGNED
85 #define BOOL_TYPE CHAR /* what used to store _Bool */
86 #define HASP2ALIGN
87 /* size in which constants are converted */
88 /* should be long if feasable */
89
90 typedef long long CONSZ;
91 typedef unsigned long long U_CONSZ;
92
93 # define CONFMT "%lld"
94 # define LABFMT ".L%d"
95 # define STABLBL ".LL%d"
96
97 /* size in which offsets are kept
98 * should be large enough to cover address space in bits
99 */
100 typedef long long OFFSZ;
101
102 /* register cookie for stack poINTer */
103
104
105 /* show stack grows negatively */
106 #define STACK_DOWN
107
108 /* show field hardware support on VAX */
109 /* XXX notyet */
110 #undef FIELDOPS
111
112 /* bytes are numbered from right to left */
113 #define TARGET_ENDIAN TARGET_LE
114 #define UNALIGNED_ACCESS
115
116 /* we want prtree included */
117 # define STDPRTREE
118
119 /* VAX-11/780 Registers */
120
121 /* scratch registers */
122 # define R0 0
123 # define R1 1
124 # define R2 2
125 # define R3 3
126 # define R4 4
127 # define R5 5
128
129 /* register variables */
130 # define R6 6
131 # define R7 7
132 # define R8 8
133 # define R9 9
134 # define R10 10
135 # define R11 11
136
137 /* special purpose */
138 # define AP 12 /* argument pointer */
139 # define FP 13 /* frame pointer */
140 # define SP 14 /* stack pointer */
141 # define PC 15 /* program counter */
142
143 /* floating registers */
144
145 /* there are no floating point registers on the VAX */
146 /* but there are concatenated regs */
147 /* we call them XR? */
148 #define XR0 16
149 #define XR1 17
150 #define XR2 18
151 #define XR3 19
152 #define XR4 20
153 #define XR5 21
154 #define XR6 22
155 #define XR7 23
156 #define XR8 24
157 #define XR9 25
158 #define XR10 26
159
160
161
162
163 extern int fregs;
164 extern int maxargs;
165
166 # define BYTEOFF(x) ((x)&03)
167 # define wdal(k) (BYTEOFF(k)==0)
168
169 # define REGSZ 16
170
171 # define TMPREG FP
172
173 //# define R2REGS /* permit double indexing */
174
175 # define STOARG(p) /* just evaluate the arguments, and be done with it... */
176 # define STOFARG(p)
177 # define STOSTARG(p)
178 # define genfcall(a,b) gencall(a,b)
179
180 # define NESTCALL
181
182 /*
183 * Register allocator stuff.
184 * The register allocator sees this as 16 general regs (AREGs)
185 * and 11 64-bit concatenated regs. (BREGs)
186 */
187 #define MAXREGS 033 /* 27 registers */
188
189 #define RSTATUS \
190 SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, \
191 SAREG|TEMPREG, SAREG|TEMPREG, SAREG|PERMREG, SAREG|PERMREG, \
192 SAREG|PERMREG, SAREG|PERMREG, SAREG|PERMREG, SAREG|PERMREG, \
193 0, 0, 0, 0, /* do not care about ap, fp, sp or pc */ \
194 SBREG, SBREG, SBREG, SBREG, SBREG, SBREG, SBREG, SBREG, \
195 SBREG, SBREG, SBREG,
196
197 #define ROVERLAP \
198 { XR0, -1 }, \
199 { XR0, XR1, -1 }, \
200 { XR1, XR2, -1 }, \
201 { XR2, XR3, -1 }, \
202 { XR3, XR4, -1 }, \
203 { XR4, XR5, -1 }, \
204 { XR5, XR6, -1 }, \
205 { XR6, XR7, -1 }, \
206 { XR7, XR8, -1 }, \
207 { XR8, XR9, -1 }, \
208 { XR9, XR10, -1 }, \
209 { XR10, -1 }, \
210 { -1 }, \
211 { -1 }, \
212 { -1 }, \
213 { -1 }, \
214 { R0, R1, XR1, -1 }, \
215 { R1, R2, XR0, XR2, -1 }, \
216 { R2, R3, XR1, XR3, -1 }, \
217 { R3, R4, XR2, XR4, -1 }, \
218 { R4, R5, XR3, XR5, -1 }, \
219 { R5, R6, XR4, XR6, -1 }, \
220 { R6, R7, XR5, XR7, -1 }, \
221 { R7, R8, XR6, XR8, -1 }, \
222 { R8, R9, XR7, XR9, -1 }, \
223 { R9, R10, XR8, XR10, -1 }, \
224 { R10, R11, XR9, -1 },
225
226 #define NUMCLASS 2 /* highest number of reg classes used */
227
228 /* size, in registers, needed to hold thing of type t */
229 #define szty(t) (((t) == DOUBLE || (t) == LONGLONG || (t) == ULONGLONG) ? 2 : 1)
230 #define FPREG FP /* frame pointer */
231 #define STKREG SP
232 #define ARGREG AP
233
234 #define DECRA(x,y) (((x) >> (y*6)) & 63) /* decode encoded regs */
235 #define ENCRD(x) (x) /* Encode dest reg in n_reg */
236 #define ENCRA1(x) ((x) << 6) /* A1 */
237 #define ENCRA2(x) ((x) << 12) /* A2 */
238 #define ENCRA(x,y) ((x) << (6+y*6)) /* encode regs in int */
239
240 #define PCLASS(p) (szty(p->n_type) == 2 ? SBREG : SAREG)
241 #define RETREG(x) (szty(x) == 2 ? XR0 : R0)
242 #define GCLASS(x) (x < XR0 ? CLASSA : CLASSB)
243 int xasmconstregs(char *s);
244 #define XASMCONSTREGS(x) xasmconstregs(x)
245 int COLORMAP(int c, int *r);
246
247 #define SNCON (MAXSPECIAL+1) /* named constand */
248
249 #define TARGET_FLT_EVAL_METHOD 0 /* all as their type */
250 /*
251 * Builtins.
252 */
253 #ifdef LANG_CXX
254 #define P1ND struct node
255 #else
256 #define P1ND struct p1node
257 #endif
258 struct p1node;
259 struct bitable;
260
261 #define TARGET_FFS /* target-specific ffs */
262 P1ND *builtin_ffs(const struct bitable *, P1ND *a);
263 P1ND *builtin_ffsl(const struct bitable *, P1ND *a);
264 P1ND *builtin_ffsll(const struct bitable *, P1ND *a);
265 #undef P1ND