Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
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
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1996
32
    		 Crown Copyright (c) 1996
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 46... Line 76...
46
Revision 1.3  1997/10/13 08:50:22  ma
76
Revision 1.3  1997/10/13 08:50:22  ma
47
Made all pl_tests for general proc & exception handling pass.
77
Made all pl_tests for general proc & exception handling pass.
48
 
78
 
49
Revision 1.2  1997/09/25 06:45:43  ma
79
Revision 1.2  1997/09/25 06:45:43  ma
50
All general_proc tests passed
80
All general_proc tests passed
51
 
81
 
52
Revision 1.1.1.1  1997/03/14 07:50:21  ma
82
Revision 1.1.1.1  1997/03/14 07:50:21  ma
53
Imported from DRA
83
Imported from DRA
54
 
84
 
55
 * Revision 1.1.1.1  1996/09/20  10:57:00  john
85
 * Revision 1.1.1.1  1996/09/20  10:57:00  john
56
 *
86
 *
57
 * Revision 1.2  1996/07/05  14:30:26  john
87
 * Revision 1.2  1996/07/05  14:30:26  john
58
 * Changes for spec 3.1
88
 * Changes for spec 3.1
59
 *
89
 *
60
 * Revision 1.1.1.1  1996/03/26  15:45:19  john
90
 * Revision 1.1.1.1  1996/03/26  15:45:19  john
61
 *
91
 *
62
 * Revision 1.2  94/02/21  16:07:24  16:07:24  ra (Robert Andrews)
92
 * Revision 1.2  94/02/21  16:07:24  16:07:24  ra (Robert Andrews)
63
 * Declare functions with no arguments with ( void ).  Make 0 into a long
93
 * Declare functions with no arguments with ( void ).  Make 0 into a long
64
 * in the definition of zw.
94
 * in the definition of zw.
65
 * 
95
 *
66
 * Revision 1.1  93/02/22  17:17:07  17:17:07  ra (Robert Andrews)
96
 * Revision 1.1  93/02/22  17:17:07  17:17:07  ra (Robert Andrews)
67
 * Initial revision
97
 * Initial revision
68
 * 
98
 *
69
--------------------------------------------------------------------------
99
--------------------------------------------------------------------------
70
*/
100
*/
71
 
101
 
72
 
102
 
73
#ifndef WHERE_INCLUDED
103
#ifndef WHERE_INCLUDED
Line 81... Line 111...
81
    stored (see below).  The wh_regs field gives the register mask
111
    stored (see below).  The wh_regs field gives the register mask
82
    of all the registers involved in storing the expression.
112
    of all the registers involved in storing the expression.
83
*/
113
*/
84
 
114
 
85
typedef struct {
115
typedef struct {
86
    exp wh_exp ;
116
    exp wh_exp;
87
    long wh_off ;
117
    long wh_off;
88
    int wh_is ;
118
    int wh_is;
89
    bitpattern wh_regs ;
119
    bitpattern wh_regs;
90
} where ;
120
} where;
91
 
121
 
92
 
122
 
93
/*
123
/*
94
    POSSIBLE VALUES FOR THE wh_is FIELD OF A WHERE
124
    POSSIBLE VALUES FOR THE wh_is FIELD OF A WHERE
95
*/
125
*/
Line 109... Line 139...
109
 
139
 
110
/*
140
/*
111
    PROCEDURES INVOLVING WHERE'S
141
    PROCEDURES INVOLVING WHERE'S
112
*/
142
*/
113
 
143
 
114
extern void init_wheres PROTO_S ( ( void ) ) ;
144
extern void init_wheres(void);
115
extern int shtype PROTO_S ( ( shape ) ) ;
145
extern int shtype(shape);
116
extern where mw PROTO_S ( ( exp, long ) ) ;
146
extern where mw(exp, long);
117
extern where mnw PROTO_S ( ( long ) ) ;
147
extern where mnw(long);
118
extern bool eq_where_a PROTO_S ( ( where, where, int ) ) ;
148
extern bool eq_where_a(where, where, int);
119
extern where where_operand PROTO_S ( (mach_op*) ) ;
149
extern where where_operand(mach_op*);
120
 
150
 
121
 
151
 
122
/*
152
/*
123
    MACROS INVOLVING WHERE'S
153
    MACROS INVOLVING WHERE'S
124
*/
154
*/
125
 
155
 
126
#define  whereis( X )		( ( X ).wh_is )
156
#define  whereis(X)		((X).wh_is)
127
#define  interfere( X, Y )	( ( X ).wh_regs & ( Y ).wh_regs )
157
#define  interfere(X, Y)	((X).wh_regs & (Y).wh_regs)
128
#define  last_use( X )		( ( X ).wh_regs & reuseables )
158
#define  last_use(X)		((X).wh_regs & reuseables)
129
#define  nw( X )		( no ( ( X ).wh_exp ) + ( X ).wh_off )
159
#define  nw(X)		(no((X).wh_exp) + (X).wh_off)
130
#define  zw( X )		mw ( X, L0 )
160
#define  zw(X)		mw(X, L0)
131
#define  eq_where( X, Y )	eq_where_a ( X, Y, 1 )
161
#define  eq_where(X, Y)	eq_where_a(X, Y, 1)
132
 
162
 
133
 
163
 
134
/*
164
/*
135
    CONSTANT EXP'S AND WHERE'S
165
    CONSTANT EXP'S AND WHERE'S
136
*/
166
*/
137
 
167
 
138
extern exp zeroe ;
168
extern exp zeroe;
139
extern where zero, fzero ;
169
extern where zero, fzero;
140
extern where A6_4, A0_p, A1_p, SP_p, A6_4_p, D0_D1 ;
170
extern where A6_4, A0_p, A1_p, SP_p, A6_4_p, D0_D1;
141
extern where RW [] ;
171
extern where RW[];
142
 
172
 
143
extern where dummy_double_dest ; /* used to force floating-point overflow */
173
extern where dummy_double_dest ; /* used to force floating-point overflow */
144
extern where firstlocal ; /* represents first local on the stack */
174
extern where firstlocal ; /* represents first local on the stack */
145
 
175
 
146
/*
176
/*
147
    DEFINITION OF REGISTER WHERE'S
177
    DEFINITION OF REGISTER WHERE'S
148
*/
178
*/
149
 
179
 
150
#define  D0		( RW [ REG_D0 ] )
180
#define  D0		(RW[REG_D0])
151
#define  D1		( RW [ REG_D1 ] )
181
#define  D1		(RW[REG_D1])
152
#define  D2		( RW [ REG_D2 ] )
182
#define  D2		(RW[REG_D2])
153
#define  D3		( RW [ REG_D3 ] )
183
#define  D3		(RW[REG_D3])
154
#define  D4		( RW [ REG_D4 ] )
184
#define  D4		(RW[REG_D4])
155
#define  D5		( RW [ REG_D5 ] )
185
#define  D5		(RW[REG_D5])
156
#define  D6		( RW [ REG_D6 ] )
186
#define  D6		(RW[REG_D6])
157
#define  D7		( RW [ REG_D7 ] )
187
#define  D7		(RW[REG_D7])
158
#define  A0		( RW [ REG_A0 ] )
188
#define  A0		(RW[REG_A0])
159
#define  A1		( RW [ REG_A1 ] )
189
#define  A1		(RW[REG_A1])
160
#define  A2		( RW [ REG_A2 ] )
190
#define  A2		(RW[REG_A2])
161
#define  A3		( RW [ REG_A3 ] )
191
#define  A3		(RW[REG_A3])
162
#define  A4		( RW [ REG_A4 ] )
192
#define  A4		(RW[REG_A4])
163
#define  A5		( RW [ REG_A5 ] )
193
#define  A5		(RW[REG_A5])
164
#define  AP		( RW [ REG_AP ] )
194
#define  AP		(RW[REG_AP])
165
#define  SP		( RW [ REG_SP ] )
195
#define  SP		(RW[REG_SP])
166
#define  FP0		( RW [ REG_FP0 ] )
196
#define  FP0		(RW[REG_FP0])
167
#define  FP1		( RW [ REG_FP1 ] )
197
#define  FP1		(RW[REG_FP1])
168
#define  FP2		( RW [ REG_FP2 ] )
198
#define  FP2		(RW[REG_FP2])
169
#define  FP3		( RW [ REG_FP3 ] )
199
#define  FP3		(RW[REG_FP3])
170
#define  FP4		( RW [ REG_FP4 ] )
200
#define  FP4		(RW[REG_FP4])
171
#define  FP5		( RW [ REG_FP5 ] )
201
#define  FP5		(RW[REG_FP5])
172
#define  FP6		( RW [ REG_FP6 ] )
202
#define  FP6		(RW[REG_FP6])
173
#define  FP7		( RW [ REG_FP7 ] )
203
#define  FP7		(RW[REG_FP7])
174
#define  register( X )	( RW [ ( X ) ] )
204
#define  register(X)	(RW[(X)])
175
 
205
 
176
#endif
206
#endif