2 |
7u83 |
1 |
/*
|
|
|
2 |
Copyright (c) 1993 Open Software Foundation, Inc.
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
All Rights Reserved
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
Permission to use, copy, modify, and distribute this software
|
|
|
9 |
and its documentation for any purpose and without fee is hereby
|
|
|
10 |
granted, provided that the above copyright notice appears in all
|
|
|
11 |
copies and that both the copyright notice and this permission
|
|
|
12 |
notice appear in supporting documentation.
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
|
|
|
16 |
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
|
17 |
PARTICULAR PURPOSE.
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
|
|
|
21 |
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
22 |
LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
|
|
|
23 |
NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
|
|
24 |
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
25 |
*/
|
|
|
26 |
|
|
|
27 |
/*
|
|
|
28 |
Crown Copyright (c) 1997
|
|
|
29 |
|
|
|
30 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
31 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
32 |
acting through the Defence Evaluation and Research Agency
|
|
|
33 |
(DERA). It is made available to Recipients with a
|
|
|
34 |
royalty-free licence for its use, reproduction, transfer
|
|
|
35 |
to other parties and amendment for any purpose not excluding
|
|
|
36 |
product development provided that any such use et cetera
|
|
|
37 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
38 |
|
|
|
39 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
40 |
reproduced upon any copies or amended versions of it;
|
|
|
41 |
|
|
|
42 |
(2) Any amended version of it shall be clearly marked to
|
|
|
43 |
show both the nature of and the organisation responsible
|
|
|
44 |
for the relevant amendment or amendments;
|
|
|
45 |
|
|
|
46 |
(3) Its onward transfer from a recipient to another
|
|
|
47 |
party shall be deemed to be that party's acceptance of
|
|
|
48 |
these conditions;
|
|
|
49 |
|
|
|
50 |
(4) DERA gives no warranty or assurance as to its
|
|
|
51 |
quality or suitability for any purpose and DERA accepts
|
|
|
52 |
no liability whatsoever in relation to any use to which
|
|
|
53 |
it may be put.
|
|
|
54 |
*/
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
/**********************************************************************
|
|
|
59 |
$Author: release $
|
|
|
60 |
$Date: 1998/02/04 15:48:45 $
|
|
|
61 |
$Revision: 1.2 $
|
|
|
62 |
$Log: expmacs.h,v $
|
|
|
63 |
* Revision 1.2 1998/02/04 15:48:45 release
|
|
|
64 |
* Added OSF copyright message.
|
|
|
65 |
*
|
|
|
66 |
* Revision 1.1.1.1 1998/01/17 15:55:56 release
|
|
|
67 |
* First version to be checked into rolling release.
|
|
|
68 |
*
|
|
|
69 |
* Revision 1.3 1997/08/04 11:56:29 pwe
|
|
|
70 |
* add constovf
|
|
|
71 |
*
|
|
|
72 |
* Revision 1.2 1996/10/04 16:00:38 pwe
|
|
|
73 |
* add banners and mod for PWE ownership
|
|
|
74 |
*
|
|
|
75 |
**********************************************************************/
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
#ifndef expmacs_key
|
|
|
79 |
#define expmacs_key 1
|
|
|
80 |
#include "bitsmacs.h"
|
|
|
81 |
#include "shapemacs.h"
|
|
|
82 |
|
|
|
83 |
#define nilexp (exp)0
|
|
|
84 |
|
|
|
85 |
/* main components of exp */
|
|
|
86 |
|
|
|
87 |
#define son(x) ((x)->sonf.e)
|
|
|
88 |
#define bro(x) ((x)->brof.e)
|
|
|
89 |
#define last(x) (x)->lastf
|
|
|
90 |
#define name(x) (x)->namef
|
|
|
91 |
#define sh(x) (x)->shf
|
|
|
92 |
#define pt(x) ((x)->ptf.e)
|
|
|
93 |
#define props(x) (x)->propsf
|
|
|
94 |
#define no(x) ((x)->numf.l)
|
|
|
95 |
#define parked(x) ((x)->park)
|
|
|
96 |
|
|
|
97 |
/* alternative components of exp */
|
|
|
98 |
|
|
|
99 |
#define brog(x) ((x)->brof.glob)
|
|
|
100 |
#define nostr(x) ((x)->numf.str)
|
|
|
101 |
#define ptno(x) ((x) ->ptf.l)
|
|
|
102 |
#define sonno(x) ((x) ->sonf.l)
|
|
|
103 |
#define fno(x) ((x) -> numf.f)
|
|
|
104 |
#define dno(x) ((x) -> numf.d)
|
|
|
105 |
#define uno(x) ((x) -> numf.ui)
|
|
|
106 |
|
|
|
107 |
/* ntests */
|
|
|
108 |
#define test_number(x) (props(x) & 0xf)
|
|
|
109 |
#define settest_number(x, t) props(x) = ((props(x) & ~0xf)|( t ))
|
|
|
110 |
|
|
|
111 |
/* rounding */
|
|
|
112 |
#define round_number(x) ((x)->propsf >> 3)
|
|
|
113 |
#define setround_number(x,r) (x)->propsf=(((x)->propsf & 0x7) | (r << 3))
|
|
|
114 |
|
|
|
115 |
/* error handling macros */
|
|
|
116 |
#define errhandle(x) ((x)->propsf & 0x7)
|
|
|
117 |
#define optop(x) ((int)errhandle(x) <= 2)
|
|
|
118 |
#define seterrhandle(x,e) (x)->propsf= ((x)->propsf & 0xf8) | (e)
|
|
|
119 |
|
|
|
120 |
/* properties of constructions with EXCEPTIONS */
|
|
|
121 |
#define setjmp_dest(r,d) {(r)->ptf.e = (d); ++no(son(d));}
|
|
|
122 |
#define isov(x) (errhandle(x) == 0x4)
|
|
|
123 |
|
|
|
124 |
/* setting macros for components of exp */
|
|
|
125 |
|
|
|
126 |
#define setbro(x,b) (x)->brof.e = (b)
|
|
|
127 |
#define setsh(x,b) (x)->shf = (b)
|
|
|
128 |
#define setson(x,b) (x)->sonf.e = (b)
|
|
|
129 |
#define setpt(x,b) (x)->ptf.e = (b)
|
|
|
130 |
#define setlast(x) (x)->lastf = 1
|
|
|
131 |
#define clearlast(x) (x)->lastf = 0
|
|
|
132 |
#define setname(x,n) (x)->namef = (n)
|
|
|
133 |
#define setfather(f,s) (s)->brof.e = (f); (s)->lastf = 1
|
|
|
134 |
|
|
|
135 |
/* components of shapes */
|
|
|
136 |
#define shape_size(x) ((x)->numf.l)
|
|
|
137 |
#define shape_align(x) ((unsigned long)((x)->brof.ald->al.al_val.al))
|
|
|
138 |
#define align_of(x) ((x)->brof.ald)
|
|
|
139 |
#define al1(x) ((unsigned long)((x)->sonf.ald->al.al_val.al))
|
|
|
140 |
#define al1_of(x) ((x)->sonf.ald)
|
|
|
141 |
#define al2(x) ((unsigned long)((x)->ptf.ald->al.al_val.al))
|
|
|
142 |
#define al2_of(x) ((x)->ptf.ald)
|
|
|
143 |
#define is_signed( x ) last( x )
|
|
|
144 |
|
|
|
145 |
/*
|
|
|
146 |
* MACROS FOR MANIPULATING PROPERTIES
|
|
|
147 |
*/
|
|
|
148 |
#define pset( x, m ) props ( x ) = ( prop ) ( props ( x ) | ( m ) )
|
|
|
149 |
#define pclr( x, m ) props ( x ) = ( prop ) ( props ( x ) & ~( m ) )
|
|
|
150 |
#define ptst( x, m ) ( ( props ( x ) & ( m ) ) != 0)
|
|
|
151 |
|
|
|
152 |
/*
|
|
|
153 |
* PROPERTIES OF IDENT
|
|
|
154 |
*/
|
|
|
155 |
|
|
|
156 |
#define setvar( x ) pset( x , 0x01 )
|
|
|
157 |
#define clearvar( x ) pclr( x , 0x01 )
|
|
|
158 |
#define isvar( x ) ptst( x , 0x01 )
|
|
|
159 |
#define setid( x ) clearvar( x )
|
|
|
160 |
|
|
|
161 |
#define setvis( x ) pset( x , 0x02 )
|
|
|
162 |
#define clearvis( x ) pclr( x , 0x02 )
|
|
|
163 |
#define isvis( x ) ptst( x , 0x02 )
|
|
|
164 |
|
|
|
165 |
#define setenvoff( x ) pset( x , 0x04 )
|
|
|
166 |
#define clearenvoff( x ) pclr( x , 0x04 )
|
|
|
167 |
#define isenvoff( x ) ptst( x , 0x04 )
|
|
|
168 |
|
|
|
169 |
#define setcaonly( x ) pset( x , 0x08 )
|
|
|
170 |
#define clearcaonly( x ) pclr( x , 0x08 )
|
|
|
171 |
#define iscaonly( x ) ptst( x , 0x08 )
|
|
|
172 |
|
|
|
173 |
#define setusereg( x ) pset( x , 0x10 )
|
|
|
174 |
#define clearusereg( x ) pclr( x , 0x10 )
|
|
|
175 |
#define isusereg( x ) ptst( x , 0x10 )
|
|
|
176 |
|
|
|
177 |
#define setparam( x ) pset( x , 0x20 )
|
|
|
178 |
#define clearparam( x ) pclr( x , 0x20 )
|
|
|
179 |
#define isparam( x ) ptst( x , 0x20 )
|
|
|
180 |
|
|
|
181 |
#define setglob( x ) pset( x , 0x40 )
|
|
|
182 |
#define clearglob( x ) pclr( x , 0x40 )
|
|
|
183 |
#define isglob( x ) ptst( x , 0x40 )
|
|
|
184 |
|
|
|
185 |
#define setcopy( x ) pset( x , 0x80 )
|
|
|
186 |
#define clearcopy( x ) pclr( x , 0x80 )
|
|
|
187 |
#define copying( x ) ptst( x , 0x80 )
|
|
|
188 |
|
|
|
189 |
#define setvarargparam( x ) pset( x, vararg_bit)
|
|
|
190 |
#define isvarargparam( x ) ptst( x ,vararg_bit)
|
|
|
191 |
#define clearvarargparam( x ) pclr( x ,vararg_bit)
|
|
|
192 |
|
|
|
193 |
|
|
|
194 |
#define setinlined( x ) pset( x , inlined ) /* inlined defined in bitsmacs.h */
|
|
|
195 |
#define clearinlined( x ) pclr( x , inlined )
|
|
|
196 |
#define isinlined( x ) ptst( x , inlined )
|
|
|
197 |
|
|
|
198 |
#define setoutpar( x ) pset( x , 0x8000 )
|
|
|
199 |
#define isoutpar( x ) ptst( x , 0x8000 )
|
|
|
200 |
#define clearoutpar( x ) pclr( x , 0x8000 )
|
|
|
201 |
/*
|
|
|
202 |
* PROPERTIES OF MAKE_PROC CONSTRUCTION
|
|
|
203 |
*/
|
|
|
204 |
|
|
|
205 |
#define set_struct_res( x ) pset( x , 0x01 )
|
|
|
206 |
#define has_struct_res( x ) ptst( x , 0x01 )
|
|
|
207 |
|
|
|
208 |
#define set_loc_address( x ) pset( x , 0x02 )
|
|
|
209 |
#define loc_address( x ) ptst( x , 0x02 )
|
|
|
210 |
|
|
|
211 |
#define set_proc_has_setjmp( x ) pset( x , 0x04 )
|
|
|
212 |
#define proc_has_setjmp( x ) ptst( x , 0x04 )
|
|
|
213 |
|
|
|
214 |
#define set_proc_has_alloca( x ) pset( x , 0x08 )
|
|
|
215 |
#define proc_has_alloca( x ) ptst( x , 0x08 )
|
|
|
216 |
|
|
|
217 |
#define set_proc_has_lv( x ) pset( x , 0x10 )
|
|
|
218 |
#define proc_has_lv( x ) ptst( x , 0x10 )
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
#define setrecursive( x ) pset( x , 0x20 )
|
|
|
222 |
#define isrecursive( x ) ptst( x , 0x20 )
|
|
|
223 |
|
|
|
224 |
#define set_proc_uses_crt_env( x ) pset( x , 0x40 )
|
|
|
225 |
#define proc_uses_crt_env( x ) ptst( x , 0x40 )
|
|
|
226 |
|
|
|
227 |
#define set_proc_uses_external( x ) pset( x , 0x80 )
|
|
|
228 |
#define proc_uses_external( x ) ptst( x , 0x80 )
|
|
|
229 |
|
|
|
230 |
/*
|
|
|
231 |
* PROPERTIES OF SOLVE CONSTRUCT
|
|
|
232 |
*/
|
|
|
233 |
|
|
|
234 |
#define setcrtsolve( x ) props( x ) = 0x01
|
|
|
235 |
#define set_copying_solve( x ) pset( x , 0x01 )
|
|
|
236 |
#define clear_copying_solve( x ) pclr( x , 0x01 )
|
|
|
237 |
#define is_copying_solve( x ) ptst( x , 0x01 )
|
|
|
238 |
|
|
|
239 |
/*
|
|
|
240 |
* PROPERTIES OF MOVE SOME CONSTRUCT
|
|
|
241 |
*/
|
|
|
242 |
|
|
|
243 |
#define setnooverlap( x ) pset( x , 0x01 )
|
|
|
244 |
#define isnooverlap( x ) ptst( x , 0x01 )
|
|
|
245 |
|
|
|
246 |
/*
|
|
|
247 |
* PROPERTIES OF CONT CONSTRUCT
|
|
|
248 |
*/
|
|
|
249 |
|
|
|
250 |
#define set_propagate( x ) pset( x , 0x01)
|
|
|
251 |
#define clear_propagate( x ) pclr( x , 0x01 )
|
|
|
252 |
#define to_propagate( x ) ptst( x , 0x01 )
|
|
|
253 |
|
|
|
254 |
/*
|
|
|
255 |
* PROPERTIES OF LABST CONSTRUCTION
|
|
|
256 |
*/
|
|
|
257 |
|
|
|
258 |
#define set_loaded_lv( x ) pset( x , 0x10 )
|
|
|
259 |
#define is_loaded_lv( x ) ptst( x , 0x10 )
|
|
|
260 |
#define setunroll( x ) pset( x , 0x04 )
|
|
|
261 |
#define clearunroll( x ) pclr( x , 0x04 )
|
|
|
262 |
#define isunroll( x ) ptst( x , 0x04 )
|
|
|
263 |
|
|
|
264 |
|
|
|
265 |
/*
|
|
|
266 |
* PROPERTIES OF NAME CONSTRUCT
|
|
|
267 |
*/
|
|
|
268 |
|
|
|
269 |
#define setlastuse( x ) pset( x , 0x01 )
|
|
|
270 |
#define islastuse( x ) ptst( x , 0x01 )
|
|
|
271 |
|
|
|
272 |
#define setloadparam( x ) pset( x , 0x02 )
|
|
|
273 |
#define isloadparam( x ) ptst( x , 0x02 )
|
|
|
274 |
|
|
|
275 |
#define setreallyass( x ) pset( x , 0x04 )
|
|
|
276 |
#define isreallyass( x ) ptst( x , 0x04 )
|
|
|
277 |
|
|
|
278 |
/*
|
|
|
279 |
* PROPERTIES OF STRING CONSTRUCT
|
|
|
280 |
*/
|
|
|
281 |
|
|
|
282 |
#define string_char_size( x ) props( x )
|
|
|
283 |
|
|
|
284 |
/*
|
|
|
285 |
* PROPERTIES OF VAL CONSTRUCT
|
|
|
286 |
*/
|
|
|
287 |
|
|
|
288 |
#define setbigval( x ) pset( x , 0x01 )
|
|
|
289 |
#define clearbigval( x ) pclr( x , 0x01 )
|
|
|
290 |
#define isbigval( x ) ptst( x , 0x01 )
|
|
|
291 |
|
|
|
292 |
#define setconstovf( x ) pset ( x, 0x02 )
|
|
|
293 |
#define constovf( x ) ptst ( x, 0x02 )
|
|
|
294 |
|
|
|
295 |
/*
|
|
|
296 |
* PROPERTIES OF REP CONSTRUCT
|
|
|
297 |
*/
|
|
|
298 |
|
|
|
299 |
#define setunrolled( x ) pset( x , 0x01 )
|
|
|
300 |
#define isunrolled( x ) ptst( x , 0x01 )
|
|
|
301 |
#define setinnermost( x ) pset( x , 0x10 )
|
|
|
302 |
#define isinnermost( x ) ptst( x , 0x10 )
|
|
|
303 |
#define clearinnermost( x ) pclr( x , 0x10 )
|
|
|
304 |
|
|
|
305 |
/*
|
|
|
306 |
* PROPERTIES OF TEST CONSTRUCT
|
|
|
307 |
*/
|
|
|
308 |
#define set_use_count_register( x ) pset( x , 0x100 )
|
|
|
309 |
#define is_use_count_register( x ) ptst( x , 0x100 )
|
|
|
310 |
#define clear_use_count_register( x ) pclr( x , 0x100 )
|
|
|
311 |
/*
|
|
|
312 |
* PROPERTIES OF APPLY CONSTRUCT
|
|
|
313 |
*/
|
|
|
314 |
|
|
|
315 |
#define settoinline( x ) pset( x , 0x01 )
|
|
|
316 |
#define istoinline( x ) ptst( x , 0x01 )
|
|
|
317 |
/*
|
|
|
318 |
* PROPERTIES OF ALLOCA CONSTRUCT
|
|
|
319 |
*/
|
|
|
320 |
#define set_checkalloc(x) props(x) |= 1;
|
|
|
321 |
#define checkalloc(x) (props(x) & 1)
|
|
|
322 |
|
|
|
323 |
|
|
|
324 |
/*
|
|
|
325 |
* PROPERTIES OF JUMP RECORD
|
|
|
326 |
*/
|
|
|
327 |
#define fstack_pos_of( x ) props( x )
|
|
|
328 |
/* PROPERTIES OF CALLER TAGS */
|
|
|
329 |
#define set_coded_caller( x ) pset( x , 0x01 )
|
|
|
330 |
#define is_coded_caller( x ) ptst( x , 0x01 )
|
|
|
331 |
#define clear_coded_caller( x ) pclr( x , 0x01 )
|
|
|
332 |
|
|
|
333 |
|
|
|
334 |
/* PROPERTIES FOR THINGS WHICH CAN HAVE RECORD BIT SET */
|
|
|
335 |
#define setrecordbit( x ) pset( x , 0x8000)
|
|
|
336 |
#define clearrecordbit( x ) pclr( x , 0x8000)
|
|
|
337 |
#define isrecordbit( x ) ptst( x , 0x8000)
|
|
|
338 |
|
|
|
339 |
/*
|
|
|
340 |
* ROUNDING FOR ALIGNMENT
|
|
|
341 |
*/
|
|
|
342 |
|
|
|
343 |
#define rounder( n , a ) ( ( ( n ) + ( a ) - 1 ) / ( a ) ) * ( a )
|
|
|
344 |
|
|
|
345 |
/*
|
|
|
346 |
* USEFUL CONSTANTS
|
|
|
347 |
*/
|
|
|
348 |
|
|
|
349 |
#define align32 ( ( unsigned long ) 32 )
|
|
|
350 |
#define align16 ( ( unsigned long ) 16 )
|
|
|
351 |
#define align8 ( ( unsigned long ) 8 )
|
|
|
352 |
#define align1 ( ( unsigned long ) 1 )
|
|
|
353 |
|
|
|
354 |
#define size64 ( ( long ) 64 )
|
|
|
355 |
#define size32 ( ( long ) 32 )
|
|
|
356 |
#define size16 ( ( long ) 16 )
|
|
|
357 |
#define size8 ( ( long ) 8 )
|
|
|
358 |
#define Z ( long ) 0
|
|
|
359 |
|
|
|
360 |
|
|
|
361 |
|
|
|
362 |
/*
|
|
|
363 |
* A few new macros for powertrans
|
|
|
364 |
*/
|
|
|
365 |
#define is_single_precision( x ) ( name( x ) == shrealhd )
|
|
|
366 |
#define is_double_precision( x ) ( name( x ) != shrealhd )
|
|
|
367 |
|
|
|
368 |
|
|
|
369 |
#define IS_A_PROC( x ) ( name(x)==proc_tag || name(x)==general_proc_tag)
|
|
|
370 |
/* These are used in TDF 3.1 for general_env_offset */
|
|
|
371 |
#define frame_al_of_ptr(x) (x)->sonf.ald->al.al_val.al_frame
|
|
|
372 |
#define frame_al1_of_offset(x) (x)->sonf.ald->al.al_val.al_frame
|
|
|
373 |
#define includes_vcallees(x) (((x) & 16) != 0)
|
|
|
374 |
#define l_or_cees(x) (((x) &25) !=0)
|
|
|
375 |
#define i_reckon_its_a_general_proc(x) ( ((x)&24 )!=0)
|
|
|
376 |
/* extra tags needed */
|
|
|
377 |
#define locptr_tag 249
|
|
|
378 |
#define TEST_LE 1
|
|
|
379 |
#define TEST_LT 2
|
|
|
380 |
#define TEST_GE 3
|
|
|
381 |
#define TEST_GT 4
|
|
|
382 |
#define TEST_NE 5
|
|
|
383 |
#define TEST_EQ 6
|
|
|
384 |
|
|
|
385 |
/* extra_expmacs.h */
|
|
|
386 |
#define set_callee(id) setname(son(id), formal_callee_tag)
|
|
|
387 |
#define set_make_procprops(e, p) props(e) |= ((p)<<8)
|
|
|
388 |
#define proc_has_vcallees(e) ((props(e) & 0x200)!=0)
|
|
|
389 |
#define postlude_has_call(e) (props(e) & 1)
|
|
|
390 |
#define call_has_vcallees(e) ((props(e) & 2) != 0)
|
|
|
391 |
#define proc_has_checkstack(e) ((props(e) & 0x800)!=0)
|
|
|
392 |
#define proc_has_vcallers(e) ((props(e) & 0x100) != 0)
|
|
|
393 |
#define proc_has_nolongj(e) ((props(e) & 0x1000) !=0)
|
|
|
394 |
|
|
|
395 |
#define call_is_untidy(e) ((props(e) & 4) != 0)
|
|
|
396 |
#define IS_AGGREGATE(s) (name(s)==nofhd||name(s)==cpdhd||name(s)==s64hd||name(s)==u64hd)
|
|
|
397 |
|
|
|
398 |
#endif
|
|
|
399 |
|
|
|
400 |
|
|
|
401 |
|