2 |
7u83 |
1 |
/*
|
7 |
7u83 |
2 |
* Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
|
|
|
3 |
* 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 are met:
|
|
|
7 |
*
|
|
|
8 |
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
9 |
* this list of conditions and the following disclaimer.
|
|
|
10 |
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
11 |
* this list of conditions and the following disclaimer in the documentation
|
|
|
12 |
* and/or other materials provided with the distribution.
|
|
|
13 |
* 3. Neither the name of The TenDRA Project nor the names of its contributors
|
|
|
14 |
* may be used to endorse or promote products derived from this software
|
|
|
15 |
* without specific, prior written permission.
|
|
|
16 |
*
|
|
|
17 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
|
|
18 |
* IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
|
19 |
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
20 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
|
|
21 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
22 |
* EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
23 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
24 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
25 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
26 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
27 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
28 |
*
|
|
|
29 |
* $Id$
|
|
|
30 |
*/
|
|
|
31 |
/*
|
2 |
7u83 |
32 |
Crown Copyright (c) 1996
|
7 |
7u83 |
33 |
|
2 |
7u83 |
34 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
35 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
36 |
acting through the Defence Evaluation and Research Agency
|
|
|
37 |
(DERA). It is made available to Recipients with a
|
|
|
38 |
royalty-free licence for its use, reproduction, transfer
|
|
|
39 |
to other parties and amendment for any purpose not excluding
|
|
|
40 |
product development provided that any such use et cetera
|
|
|
41 |
shall be deemed to be acceptance of the following conditions:-
|
7 |
7u83 |
42 |
|
2 |
7u83 |
43 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
44 |
reproduced upon any copies or amended versions of it;
|
7 |
7u83 |
45 |
|
2 |
7u83 |
46 |
(2) Any amended version of it shall be clearly marked to
|
|
|
47 |
show both the nature of and the organisation responsible
|
|
|
48 |
for the relevant amendment or amendments;
|
7 |
7u83 |
49 |
|
2 |
7u83 |
50 |
(3) Its onward transfer from a recipient to another
|
|
|
51 |
party shall be deemed to be that party's acceptance of
|
|
|
52 |
these conditions;
|
7 |
7u83 |
53 |
|
2 |
7u83 |
54 |
(4) DERA gives no warranty or assurance as to its
|
|
|
55 |
quality or suitability for any purpose and DERA accepts
|
|
|
56 |
no liability whatsoever in relation to any use to which
|
|
|
57 |
it may be put.
|
|
|
58 |
*/
|
|
|
59 |
/*
|
|
|
60 |
VERSION INFORMATION
|
|
|
61 |
===================
|
|
|
62 |
|
|
|
63 |
--------------------------------------------------------------------------
|
|
|
64 |
$Header: /u/g/release/CVSROOT/Source/src/installers/680x0/common/where.h,v 1.1.1.1 1998/01/17 15:55:50 release Exp $
|
|
|
65 |
--------------------------------------------------------------------------
|
|
|
66 |
$Log: where.h,v $
|
|
|
67 |
* Revision 1.1.1.1 1998/01/17 15:55:50 release
|
|
|
68 |
* First version to be checked into rolling release.
|
|
|
69 |
*
|
|
|
70 |
Revision 1.2 1997/10/29 10:22:33 ma
|
|
|
71 |
Replaced use_alloca with has_alloca.
|
|
|
72 |
|
|
|
73 |
Revision 1.1.1.1 1997/10/13 12:43:01 ma
|
|
|
74 |
First version.
|
|
|
75 |
|
|
|
76 |
Revision 1.3 1997/10/13 08:50:22 ma
|
|
|
77 |
Made all pl_tests for general proc & exception handling pass.
|
|
|
78 |
|
|
|
79 |
Revision 1.2 1997/09/25 06:45:43 ma
|
|
|
80 |
All general_proc tests passed
|
|
|
81 |
|
|
|
82 |
Revision 1.1.1.1 1997/03/14 07:50:21 ma
|
|
|
83 |
Imported from DRA
|
|
|
84 |
|
|
|
85 |
* Revision 1.1.1.1 1996/09/20 10:57:00 john
|
|
|
86 |
*
|
|
|
87 |
* Revision 1.2 1996/07/05 14:30:26 john
|
|
|
88 |
* Changes for spec 3.1
|
|
|
89 |
*
|
|
|
90 |
* Revision 1.1.1.1 1996/03/26 15:45:19 john
|
|
|
91 |
*
|
|
|
92 |
* Revision 1.2 94/02/21 16:07:24 16:07:24 ra (Robert Andrews)
|
|
|
93 |
* Declare functions with no arguments with ( void ). Make 0 into a long
|
|
|
94 |
* in the definition of zw.
|
7 |
7u83 |
95 |
*
|
2 |
7u83 |
96 |
* Revision 1.1 93/02/22 17:17:07 17:17:07 ra (Robert Andrews)
|
|
|
97 |
* Initial revision
|
7 |
7u83 |
98 |
*
|
2 |
7u83 |
99 |
--------------------------------------------------------------------------
|
|
|
100 |
*/
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
#ifndef WHERE_INCLUDED
|
|
|
104 |
#define WHERE_INCLUDED
|
|
|
105 |
|
|
|
106 |
/*
|
|
|
107 |
STRUCTURE REPRESENTING ALLOCATED EXPRESSIONS
|
|
|
108 |
|
|
|
109 |
A where consists of an expression, wh_exp, and an offset wh_off.
|
|
|
110 |
The wh_is field gives information on where the expression is
|
|
|
111 |
stored (see below). The wh_regs field gives the register mask
|
|
|
112 |
of all the registers involved in storing the expression.
|
|
|
113 |
*/
|
|
|
114 |
|
|
|
115 |
typedef struct {
|
7 |
7u83 |
116 |
exp wh_exp;
|
|
|
117 |
long wh_off;
|
|
|
118 |
int wh_is;
|
|
|
119 |
bitpattern wh_regs;
|
|
|
120 |
} where;
|
2 |
7u83 |
121 |
|
|
|
122 |
|
|
|
123 |
/*
|
|
|
124 |
POSSIBLE VALUES FOR THE wh_is FIELD OF A WHERE
|
|
|
125 |
*/
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
#define Dreg 0 /* In a D-register */
|
|
|
129 |
#define Areg 1 /* In an A-register */
|
|
|
130 |
#define Freg 2 /* In an F-register */
|
|
|
131 |
#define Value 3 /* Constant value */
|
|
|
132 |
#define Parameter 4 /* On the stack (procedure argument) */
|
|
|
133 |
#define Variable 5 /* On the stack (allocated variable) */
|
|
|
134 |
#define RegInd 6 /* Indirect relative to a register */
|
|
|
135 |
#define EffAddr 7 /* In a valid 68020 effective address */
|
|
|
136 |
#define External 8 /* External data */
|
|
|
137 |
#define RegPair 9 /* In a register pair */
|
|
|
138 |
#define Other 10 /* All other cases */
|
|
|
139 |
|
|
|
140 |
/*
|
|
|
141 |
PROCEDURES INVOLVING WHERE'S
|
|
|
142 |
*/
|
|
|
143 |
|
7 |
7u83 |
144 |
extern void init_wheres(void);
|
|
|
145 |
extern int shtype(shape);
|
|
|
146 |
extern where mw(exp, long);
|
|
|
147 |
extern where mnw(long);
|
|
|
148 |
extern bool eq_where_a(where, where, int);
|
|
|
149 |
extern where where_operand(mach_op*);
|
2 |
7u83 |
150 |
|
|
|
151 |
|
|
|
152 |
/*
|
|
|
153 |
MACROS INVOLVING WHERE'S
|
|
|
154 |
*/
|
|
|
155 |
|
7 |
7u83 |
156 |
#define whereis(X) ((X).wh_is)
|
|
|
157 |
#define interfere(X, Y) ((X).wh_regs & (Y).wh_regs)
|
|
|
158 |
#define last_use(X) ((X).wh_regs & reuseables)
|
|
|
159 |
#define nw(X) (no((X).wh_exp) + (X).wh_off)
|
|
|
160 |
#define zw(X) mw(X, L0)
|
|
|
161 |
#define eq_where(X, Y) eq_where_a(X, Y, 1)
|
2 |
7u83 |
162 |
|
|
|
163 |
|
|
|
164 |
/*
|
|
|
165 |
CONSTANT EXP'S AND WHERE'S
|
|
|
166 |
*/
|
|
|
167 |
|
7 |
7u83 |
168 |
extern exp zeroe;
|
|
|
169 |
extern where zero, fzero;
|
|
|
170 |
extern where A6_4, A0_p, A1_p, SP_p, A6_4_p, D0_D1;
|
|
|
171 |
extern where RW[];
|
2 |
7u83 |
172 |
|
|
|
173 |
extern where dummy_double_dest ; /* used to force floating-point overflow */
|
|
|
174 |
extern where firstlocal ; /* represents first local on the stack */
|
|
|
175 |
|
|
|
176 |
/*
|
|
|
177 |
DEFINITION OF REGISTER WHERE'S
|
|
|
178 |
*/
|
|
|
179 |
|
7 |
7u83 |
180 |
#define D0 (RW[REG_D0])
|
|
|
181 |
#define D1 (RW[REG_D1])
|
|
|
182 |
#define D2 (RW[REG_D2])
|
|
|
183 |
#define D3 (RW[REG_D3])
|
|
|
184 |
#define D4 (RW[REG_D4])
|
|
|
185 |
#define D5 (RW[REG_D5])
|
|
|
186 |
#define D6 (RW[REG_D6])
|
|
|
187 |
#define D7 (RW[REG_D7])
|
|
|
188 |
#define A0 (RW[REG_A0])
|
|
|
189 |
#define A1 (RW[REG_A1])
|
|
|
190 |
#define A2 (RW[REG_A2])
|
|
|
191 |
#define A3 (RW[REG_A3])
|
|
|
192 |
#define A4 (RW[REG_A4])
|
|
|
193 |
#define A5 (RW[REG_A5])
|
|
|
194 |
#define AP (RW[REG_AP])
|
|
|
195 |
#define SP (RW[REG_SP])
|
|
|
196 |
#define FP0 (RW[REG_FP0])
|
|
|
197 |
#define FP1 (RW[REG_FP1])
|
|
|
198 |
#define FP2 (RW[REG_FP2])
|
|
|
199 |
#define FP3 (RW[REG_FP3])
|
|
|
200 |
#define FP4 (RW[REG_FP4])
|
|
|
201 |
#define FP5 (RW[REG_FP5])
|
|
|
202 |
#define FP6 (RW[REG_FP6])
|
|
|
203 |
#define FP7 (RW[REG_FP7])
|
|
|
204 |
#define register(X) (RW[(X)])
|
2 |
7u83 |
205 |
|
|
|
206 |
#endif
|