Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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