1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
/* Simulator header for m32r.
This file is machine generated.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef M32R_ARCH_DEFS_H
#define M32R_ARCH_DEFS_H
#define MAX_INSNS 128
#define TARGET_BIG_ENDIAN 1
/* Word and address accesses. */
/* FIXME: Later need to allow runtime selection. */
#define GETTWI(addr) GETTSI (addr)
#define GETTUWI(addr) GETTUSI (addr)
#define GETTAI(addr) GETTSI (addr)
#define SETTWI(addr, val) SETTSI ((addr), (val))
#define SETTUWI(addr, val) SETTUSI ((addr), (val))
#define SETTAI(addr, val) SETTSI ((addr), (val))
#define GETMEMWI(cpu, addr) GETMEMSI ((cpu), (addr))
#define GETMEMUWI(cpu, addr) GETMEMUSI ((cpu), (addr))
#define GETMEMAI(cpu, addr) GETMEMSI ((cpu), (addr))
#define SETMEMWI(cpu, addr, val) SETMEMSI ((cpu), (addr), (val))
#define SETMEMUWI(cpu, addr, val) SETMEMUSI ((cpu), (addr), (val))
#define SETMEMAI(cpu, addr, val) SETMEMSI ((cpu), (addr), (val))
/* FIXME: Used? */
#define SETMEM(addr, val, len) (*STATE_MEM_WRITE (current_state)) (current_state, (addr), (val), (len))
/* FIXME */
typedef SI WI;
typedef USI UWI;
/* CPU state information. */
typedef struct {
/* program counter */
SI pc;
/* general registers */
SI h_gr[16];
/* control registers */
SI h_cr[7];
/* accumulator */
DI h_accum;
/* condition bit */
UBI h_cond;
/* sm */
UBI h_sm;
/* bsm */
UBI h_bsm;
/* ie */
UBI h_ie;
/* bie */
UBI h_bie;
/* bcond */
UBI h_bcond;
/* bpc */
SI h_bpc;
} CPU_DATA;
#ifdef USING_SIM_BASE_H /* FIXME:quick hack */
#define CPU(x) (STATE_CPU_CPU (current_state, 0)->x)
#else
#define CPU(x) (STATE_CPU (current_state).x)
#endif
/* CPU profiling state information. */
typedef struct {
/* general registers */
unsigned long h_gr;
} CPU_PROFILE;
/* Enum declaration for mode types. */
typedef enum mode_type {
MODE_VM, MODE_BI, MODE_QI, MODE_HI,
MODE_SI, MODE_DI, MODE_UBI, MODE_UQI,
MODE_UHI, MODE_USI, MODE_UDI, MODE_SF,
MODE_DF, MODE_XF, MODE_TF, MODE_MAX
} MODE_TYPE;
#define MAX_MODES ((int) MODE_MAX)
/* Return name of instruction numbered INSN. */
#define INSN_NAME(insn) (m32r_cgen_insn_table_entries[insn].syntax.name)
/* Enum declaration for model types. */
typedef enum model_type {
MODEL_M32R_D, MODEL_TEST, MODEL_MAX
} MODEL_TYPE;
#define MAX_MODELS ((int) MODEL_MAX)
/* Enum declaration for unit types. */
typedef enum unit_type {
UNIT_NONE, UNIT_M32R_D_U_STORE, UNIT_M32R_D_U_LOAD, UNIT_M32R_D_U_EXEC,
UNIT_TEST_U_EXEC, UNIT_MAX
} UNIT_TYPE;
#define MAX_UNITS (1)
typedef struct argbuf {
union {
struct {
SI * f_r1;
SI * f_r2;
} fmt_0;
struct {
SI * f_r1;
SI * f_r2;
HI f_simm16;
} fmt_1;
struct {
SI * f_r1;
SI * f_r2;
USI f_uimm16;
} fmt_2;
struct {
SI * f_r1;
SI * f_r2;
UHI f_uimm16;
} fmt_3;
struct {
SI * f_r1;
SI f_simm8;
} fmt_4;
struct {
SI * f_r1;
SI * f_r2;
SI f_simm16;
} fmt_5;
struct {
IADDR f_disp8;
} fmt_6;
struct {
IADDR f_disp24;
} fmt_7;
struct {
SI * f_r1;
SI * f_r2;
IADDR f_disp16;
} fmt_8;
struct {
SI * f_r2;
IADDR f_disp16;
} fmt_9;
struct {
SI * f_r1;
SI * f_r2;
} fmt_10;
struct {
SI * f_r2;
SI f_simm16;
} fmt_11;
struct {
SI * f_r2;
USI f_uimm16;
} fmt_12;
struct {
SI * f_r1;
SI * f_r2;
} fmt_13;
struct {
SI * f_r2;
} fmt_14;
struct {
SI * f_r1;
ADDR f_uimm24;
} fmt_15;
struct {
SI * f_r1;
HI f_simm16;
} fmt_16;
struct {
SI * f_r1;
} fmt_17;
struct {
SI * f_r1;
UINT f_r2;
} fmt_18;
struct {
SI * f_r1;
} fmt_19;
struct {
UINT f_r1;
SI * f_r2;
} fmt_20;
struct {
int empty;
} fmt_21;
struct {
SI * f_r1;
UHI f_hi16;
} fmt_22;
struct {
SI * f_r1;
USI f_uimm5;
} fmt_23;
struct {
SI * f_r1;
SI * f_r2;
HI f_simm16;
} fmt_24;
struct {
USI f_uimm4;
} fmt_25;
} fields;
unsigned int length;
PCADDR addr;
#if 1 || defined (MODULE_trace) || defined (MODULE_profile) /*FIXME:wip*/
const struct cgen_insn *opcode;
#endif
#if 1 || WITH_PROFILE_MODEL_P /*FIXME:wip*/
unsigned long h_gr_get;
unsigned long h_gr_set;
#endif
} ARGBUF;
#endif /* M32R_ARCH_DEFS_H */
|