Commit | Line | Data |
---|---|---|
646c6f2b DE |
1 | /* Simulator instruction extractor for m32r. |
2 | ||
9d70630e | 3 | Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. |
646c6f2b | 4 | |
9d70630e | 5 | This file is part of the GNU Simulators. |
646c6f2b DE |
6 | |
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2, or (at your option) | |
10 | any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License along | |
18 | with this program; if not, write to the Free Software Foundation, Inc., | |
19 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
20 | ||
21 | */ | |
22 | ||
9d70630e DE |
23 | #define WANT_CPU |
24 | #define WANT_CPU_M32R | |
25 | ||
646c6f2b | 26 | #include "sim-main.h" |
646c6f2b DE |
27 | #include "cpu-sim.h" |
28 | ||
29 | void | |
9d70630e | 30 | EX_FN_NAME (m32r,fmt_0_add) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 31 | { |
9d70630e DE |
32 | #define FLD(f) abuf->fields.fmt_0_add.f |
33 | EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
34 | ||
35 | EXTRACT_FMT_0_ADD_CODE | |
646c6f2b DE |
36 | |
37 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
38 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
39 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
40 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_0_add", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
41 | |
42 | abuf->length = length; | |
43 | abuf->addr = pc; | |
44 | ||
45 | #if WITH_PROFILE_MODEL_P | |
46 | /* Record the fields for profiling. */ | |
47 | if (PROFILE_MODEL_P (current_cpu)) | |
48 | { | |
49 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); | |
50 | abuf->h_gr_set = 0 | (1 << f_r1); | |
51 | } | |
52 | #endif | |
53 | #undef FLD | |
54 | } | |
55 | ||
56 | void | |
9d70630e | 57 | EX_FN_NAME (m32r,fmt_1_add3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 58 | { |
9d70630e DE |
59 | #define FLD(f) abuf->fields.fmt_1_add3.f |
60 | EXTRACT_FMT_1_ADD3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
61 | ||
62 | EXTRACT_FMT_1_ADD3_CODE | |
646c6f2b DE |
63 | |
64 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
65 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
66 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
646c6f2b | 67 | FLD (f_simm16) = f_simm16; |
9d70630e | 68 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_1_add3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); |
646c6f2b DE |
69 | |
70 | abuf->length = length; | |
71 | abuf->addr = pc; | |
72 | ||
73 | #if WITH_PROFILE_MODEL_P | |
74 | /* Record the fields for profiling. */ | |
75 | if (PROFILE_MODEL_P (current_cpu)) | |
76 | { | |
77 | abuf->h_gr_get = 0 | (1 << f_r2); | |
78 | abuf->h_gr_set = 0 | (1 << f_r1); | |
79 | } | |
80 | #endif | |
81 | #undef FLD | |
82 | } | |
83 | ||
84 | void | |
9d70630e | 85 | EX_FN_NAME (m32r,fmt_2_and3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 86 | { |
9d70630e DE |
87 | #define FLD(f) abuf->fields.fmt_2_and3.f |
88 | EXTRACT_FMT_2_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ | |
89 | ||
90 | EXTRACT_FMT_2_AND3_CODE | |
646c6f2b DE |
91 | |
92 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
93 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
94 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
95 | FLD (f_uimm16) = f_uimm16; | |
96 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_2_and3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); | |
646c6f2b DE |
97 | |
98 | abuf->length = length; | |
99 | abuf->addr = pc; | |
100 | ||
101 | #if WITH_PROFILE_MODEL_P | |
102 | /* Record the fields for profiling. */ | |
103 | if (PROFILE_MODEL_P (current_cpu)) | |
104 | { | |
9d70630e | 105 | abuf->h_gr_get = 0 | (1 << f_r2); |
646c6f2b DE |
106 | abuf->h_gr_set = 0 | (1 << f_r1); |
107 | } | |
108 | #endif | |
109 | #undef FLD | |
110 | } | |
111 | ||
112 | void | |
9d70630e | 113 | EX_FN_NAME (m32r,fmt_3_or3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 114 | { |
9d70630e DE |
115 | #define FLD(f) abuf->fields.fmt_3_or3.f |
116 | EXTRACT_FMT_3_OR3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ | |
117 | ||
118 | EXTRACT_FMT_3_OR3_CODE | |
646c6f2b DE |
119 | |
120 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
121 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
122 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
646c6f2b | 123 | FLD (f_uimm16) = f_uimm16; |
9d70630e | 124 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_3_or3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "ulo16 0x%x", 'x', f_uimm16, (char *) 0)); |
646c6f2b DE |
125 | |
126 | abuf->length = length; | |
127 | abuf->addr = pc; | |
128 | ||
129 | #if WITH_PROFILE_MODEL_P | |
130 | /* Record the fields for profiling. */ | |
131 | if (PROFILE_MODEL_P (current_cpu)) | |
132 | { | |
133 | abuf->h_gr_get = 0 | (1 << f_r2); | |
134 | abuf->h_gr_set = 0 | (1 << f_r1); | |
135 | } | |
136 | #endif | |
137 | #undef FLD | |
138 | } | |
139 | ||
140 | void | |
9d70630e | 141 | EX_FN_NAME (m32r,fmt_4_addi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 142 | { |
9d70630e DE |
143 | #define FLD(f) abuf->fields.fmt_4_addi.f |
144 | EXTRACT_FMT_4_ADDI_VARS /* f-op1 f-r1 f-simm8 */ | |
145 | ||
146 | EXTRACT_FMT_4_ADDI_CODE | |
646c6f2b DE |
147 | |
148 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
149 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
150 | FLD (f_simm8) = f_simm8; | |
151 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_4_addi", "dr 0x%x", 'x', f_r1, "simm8 0x%x", 'x', f_simm8, (char *) 0)); | |
646c6f2b DE |
152 | |
153 | abuf->length = length; | |
154 | abuf->addr = pc; | |
155 | ||
156 | #if WITH_PROFILE_MODEL_P | |
157 | /* Record the fields for profiling. */ | |
158 | if (PROFILE_MODEL_P (current_cpu)) | |
159 | { | |
9d70630e | 160 | abuf->h_gr_get = 0 | (1 << f_r1); |
646c6f2b DE |
161 | abuf->h_gr_set = 0 | (1 << f_r1); |
162 | } | |
163 | #endif | |
164 | #undef FLD | |
165 | } | |
166 | ||
167 | void | |
9d70630e | 168 | EX_FN_NAME (m32r,fmt_5_addv3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 169 | { |
9d70630e DE |
170 | #define FLD(f) abuf->fields.fmt_5_addv3.f |
171 | EXTRACT_FMT_5_ADDV3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
172 | ||
173 | EXTRACT_FMT_5_ADDV3_CODE | |
646c6f2b DE |
174 | |
175 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
176 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
177 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
178 | FLD (f_simm16) = f_simm16; | |
179 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_5_addv3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); | |
646c6f2b DE |
180 | |
181 | abuf->length = length; | |
182 | abuf->addr = pc; | |
183 | ||
184 | #if WITH_PROFILE_MODEL_P | |
185 | /* Record the fields for profiling. */ | |
186 | if (PROFILE_MODEL_P (current_cpu)) | |
187 | { | |
188 | abuf->h_gr_get = 0 | (1 << f_r2); | |
189 | abuf->h_gr_set = 0 | (1 << f_r1); | |
190 | } | |
191 | #endif | |
192 | #undef FLD | |
193 | } | |
194 | ||
195 | void | |
9d70630e | 196 | EX_FN_NAME (m32r,fmt_6_addx) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 197 | { |
9d70630e DE |
198 | #define FLD(f) abuf->fields.fmt_6_addx.f |
199 | EXTRACT_FMT_6_ADDX_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
200 | ||
201 | EXTRACT_FMT_6_ADDX_CODE | |
646c6f2b DE |
202 | |
203 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
204 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
205 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
206 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_6_addx", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
207 | |
208 | abuf->length = length; | |
209 | abuf->addr = pc; | |
210 | ||
211 | #if WITH_PROFILE_MODEL_P | |
212 | /* Record the fields for profiling. */ | |
213 | if (PROFILE_MODEL_P (current_cpu)) | |
214 | { | |
215 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); | |
216 | abuf->h_gr_set = 0 | (1 << f_r1); | |
217 | } | |
218 | #endif | |
219 | #undef FLD | |
220 | } | |
221 | ||
222 | void | |
9d70630e | 223 | EX_FN_NAME (m32r,fmt_7_bc8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 224 | { |
9d70630e DE |
225 | #define FLD(f) abuf->fields.fmt_7_bc8.f |
226 | EXTRACT_FMT_7_BC8_VARS /* f-op1 f-r1 f-disp8 */ | |
227 | ||
228 | EXTRACT_FMT_7_BC8_CODE | |
646c6f2b DE |
229 | |
230 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
231 | RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); |
232 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_7_bc8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); | |
646c6f2b DE |
233 | |
234 | abuf->length = length; | |
235 | abuf->addr = pc; | |
646c6f2b DE |
236 | #undef FLD |
237 | } | |
238 | ||
239 | void | |
9d70630e | 240 | EX_FN_NAME (m32r,fmt_8_bc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 241 | { |
9d70630e DE |
242 | #define FLD(f) abuf->fields.fmt_8_bc24.f |
243 | EXTRACT_FMT_8_BC24_VARS /* f-op1 f-r1 f-disp24 */ | |
244 | ||
245 | EXTRACT_FMT_8_BC24_CODE | |
646c6f2b DE |
246 | |
247 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
248 | RECORD_IADDR (FLD (f_disp24), pc + f_disp24); |
249 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_8_bc24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); | |
646c6f2b DE |
250 | |
251 | abuf->length = length; | |
252 | abuf->addr = pc; | |
646c6f2b DE |
253 | #undef FLD |
254 | } | |
255 | ||
256 | void | |
9d70630e | 257 | EX_FN_NAME (m32r,fmt_9_beq) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 258 | { |
9d70630e DE |
259 | #define FLD(f) abuf->fields.fmt_9_beq.f |
260 | EXTRACT_FMT_9_BEQ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ | |
261 | ||
262 | EXTRACT_FMT_9_BEQ_CODE | |
646c6f2b DE |
263 | |
264 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
265 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
266 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
267 | RECORD_IADDR (FLD (f_disp16), pc + f_disp16); | |
268 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_9_beq", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); | |
646c6f2b DE |
269 | |
270 | abuf->length = length; | |
271 | abuf->addr = pc; | |
272 | ||
273 | #if WITH_PROFILE_MODEL_P | |
274 | /* Record the fields for profiling. */ | |
275 | if (PROFILE_MODEL_P (current_cpu)) | |
276 | { | |
277 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); | |
646c6f2b DE |
278 | } |
279 | #endif | |
280 | #undef FLD | |
281 | } | |
282 | ||
283 | void | |
9d70630e | 284 | EX_FN_NAME (m32r,fmt_10_beqz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 285 | { |
9d70630e DE |
286 | #define FLD(f) abuf->fields.fmt_10_beqz.f |
287 | EXTRACT_FMT_10_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ | |
288 | ||
289 | EXTRACT_FMT_10_BEQZ_CODE | |
646c6f2b DE |
290 | |
291 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
292 | FLD (f_r2) = & CPU (h_gr)[f_r2]; |
293 | RECORD_IADDR (FLD (f_disp16), pc + f_disp16); | |
294 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_10_beqz", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); | |
646c6f2b DE |
295 | |
296 | abuf->length = length; | |
297 | abuf->addr = pc; | |
298 | ||
299 | #if WITH_PROFILE_MODEL_P | |
300 | /* Record the fields for profiling. */ | |
301 | if (PROFILE_MODEL_P (current_cpu)) | |
302 | { | |
303 | abuf->h_gr_get = 0 | (1 << f_r2); | |
646c6f2b DE |
304 | } |
305 | #endif | |
306 | #undef FLD | |
307 | } | |
308 | ||
309 | void | |
9d70630e | 310 | EX_FN_NAME (m32r,fmt_11_bl8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 311 | { |
9d70630e DE |
312 | #define FLD(f) abuf->fields.fmt_11_bl8.f |
313 | EXTRACT_FMT_11_BL8_VARS /* f-op1 f-r1 f-disp8 */ | |
646c6f2b | 314 | |
9d70630e | 315 | EXTRACT_FMT_11_BL8_CODE |
646c6f2b DE |
316 | |
317 | /* Record the fields for the semantic handler. */ | |
318 | RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); | |
9d70630e | 319 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_11_bl8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); |
646c6f2b DE |
320 | |
321 | abuf->length = length; | |
322 | abuf->addr = pc; | |
323 | #undef FLD | |
324 | } | |
325 | ||
326 | void | |
9d70630e | 327 | EX_FN_NAME (m32r,fmt_12_bl24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 328 | { |
9d70630e DE |
329 | #define FLD(f) abuf->fields.fmt_12_bl24.f |
330 | EXTRACT_FMT_12_BL24_VARS /* f-op1 f-r1 f-disp24 */ | |
331 | ||
332 | EXTRACT_FMT_12_BL24_CODE | |
646c6f2b DE |
333 | |
334 | /* Record the fields for the semantic handler. */ | |
335 | RECORD_IADDR (FLD (f_disp24), pc + f_disp24); | |
9d70630e | 336 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_12_bl24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); |
646c6f2b DE |
337 | |
338 | abuf->length = length; | |
339 | abuf->addr = pc; | |
340 | #undef FLD | |
341 | } | |
342 | ||
343 | void | |
9d70630e | 344 | EX_FN_NAME (m32r,fmt_13_bra8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 345 | { |
9d70630e DE |
346 | #define FLD(f) abuf->fields.fmt_13_bra8.f |
347 | EXTRACT_FMT_13_BRA8_VARS /* f-op1 f-r1 f-disp8 */ | |
348 | ||
349 | EXTRACT_FMT_13_BRA8_CODE | |
646c6f2b DE |
350 | |
351 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
352 | RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); |
353 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_13_bra8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); | |
646c6f2b DE |
354 | |
355 | abuf->length = length; | |
356 | abuf->addr = pc; | |
646c6f2b DE |
357 | #undef FLD |
358 | } | |
359 | ||
360 | void | |
9d70630e | 361 | EX_FN_NAME (m32r,fmt_14_bra24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 362 | { |
9d70630e DE |
363 | #define FLD(f) abuf->fields.fmt_14_bra24.f |
364 | EXTRACT_FMT_14_BRA24_VARS /* f-op1 f-r1 f-disp24 */ | |
365 | ||
366 | EXTRACT_FMT_14_BRA24_CODE | |
646c6f2b DE |
367 | |
368 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
369 | RECORD_IADDR (FLD (f_disp24), pc + f_disp24); |
370 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_14_bra24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); | |
646c6f2b DE |
371 | |
372 | abuf->length = length; | |
373 | abuf->addr = pc; | |
646c6f2b DE |
374 | #undef FLD |
375 | } | |
376 | ||
377 | void | |
9d70630e | 378 | EX_FN_NAME (m32r,fmt_15_cmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 379 | { |
9d70630e DE |
380 | #define FLD(f) abuf->fields.fmt_15_cmp.f |
381 | EXTRACT_FMT_15_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
382 | ||
383 | EXTRACT_FMT_15_CMP_CODE | |
646c6f2b DE |
384 | |
385 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
386 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
387 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
388 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_15_cmp", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
389 | |
390 | abuf->length = length; | |
391 | abuf->addr = pc; | |
392 | ||
393 | #if WITH_PROFILE_MODEL_P | |
394 | /* Record the fields for profiling. */ | |
395 | if (PROFILE_MODEL_P (current_cpu)) | |
396 | { | |
9d70630e | 397 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); |
646c6f2b DE |
398 | } |
399 | #endif | |
400 | #undef FLD | |
401 | } | |
402 | ||
403 | void | |
9d70630e | 404 | EX_FN_NAME (m32r,fmt_16_cmpi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 405 | { |
9d70630e DE |
406 | #define FLD(f) abuf->fields.fmt_16_cmpi.f |
407 | EXTRACT_FMT_16_CMPI_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
408 | ||
409 | EXTRACT_FMT_16_CMPI_CODE | |
646c6f2b DE |
410 | |
411 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
412 | FLD (f_r2) = & CPU (h_gr)[f_r2]; |
413 | FLD (f_simm16) = f_simm16; | |
414 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_16_cmpi", "src2 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); | |
646c6f2b DE |
415 | |
416 | abuf->length = length; | |
417 | abuf->addr = pc; | |
418 | ||
419 | #if WITH_PROFILE_MODEL_P | |
420 | /* Record the fields for profiling. */ | |
421 | if (PROFILE_MODEL_P (current_cpu)) | |
422 | { | |
423 | abuf->h_gr_get = 0 | (1 << f_r2); | |
424 | } | |
425 | #endif | |
426 | #undef FLD | |
427 | } | |
428 | ||
429 | void | |
9d70630e | 430 | EX_FN_NAME (m32r,fmt_17_cmpui) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 431 | { |
9d70630e DE |
432 | #define FLD(f) abuf->fields.fmt_17_cmpui.f |
433 | EXTRACT_FMT_17_CMPUI_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ | |
434 | ||
435 | EXTRACT_FMT_17_CMPUI_CODE | |
646c6f2b DE |
436 | |
437 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
438 | FLD (f_r2) = & CPU (h_gr)[f_r2]; |
439 | FLD (f_uimm16) = f_uimm16; | |
440 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_17_cmpui", "src2 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); | |
646c6f2b DE |
441 | |
442 | abuf->length = length; | |
443 | abuf->addr = pc; | |
444 | ||
445 | #if WITH_PROFILE_MODEL_P | |
446 | /* Record the fields for profiling. */ | |
447 | if (PROFILE_MODEL_P (current_cpu)) | |
448 | { | |
449 | abuf->h_gr_get = 0 | (1 << f_r2); | |
450 | } | |
451 | #endif | |
452 | #undef FLD | |
453 | } | |
454 | ||
455 | void | |
9d70630e | 456 | EX_FN_NAME (m32r,fmt_18_div) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 457 | { |
9d70630e DE |
458 | #define FLD(f) abuf->fields.fmt_18_div.f |
459 | EXTRACT_FMT_18_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
460 | ||
461 | EXTRACT_FMT_18_DIV_CODE | |
646c6f2b DE |
462 | |
463 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
464 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
465 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
466 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_18_div", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
467 | |
468 | abuf->length = length; | |
469 | abuf->addr = pc; | |
470 | ||
471 | #if WITH_PROFILE_MODEL_P | |
472 | /* Record the fields for profiling. */ | |
473 | if (PROFILE_MODEL_P (current_cpu)) | |
474 | { | |
9d70630e DE |
475 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); |
476 | abuf->h_gr_set = 0 | (1 << f_r1); | |
646c6f2b DE |
477 | } |
478 | #endif | |
479 | #undef FLD | |
480 | } | |
481 | ||
482 | void | |
9d70630e | 483 | EX_FN_NAME (m32r,fmt_19_jl) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 484 | { |
9d70630e DE |
485 | #define FLD(f) abuf->fields.fmt_19_jl.f |
486 | EXTRACT_FMT_19_JL_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
487 | ||
488 | EXTRACT_FMT_19_JL_CODE | |
646c6f2b DE |
489 | |
490 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
491 | FLD (f_r2) = & CPU (h_gr)[f_r2]; |
492 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_19_jl", "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
493 | |
494 | abuf->length = length; | |
495 | abuf->addr = pc; | |
496 | ||
497 | #if WITH_PROFILE_MODEL_P | |
498 | /* Record the fields for profiling. */ | |
499 | if (PROFILE_MODEL_P (current_cpu)) | |
500 | { | |
501 | abuf->h_gr_get = 0 | (1 << f_r2); | |
502 | } | |
503 | #endif | |
504 | #undef FLD | |
505 | } | |
506 | ||
507 | void | |
9d70630e | 508 | EX_FN_NAME (m32r,fmt_20_jmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 509 | { |
9d70630e DE |
510 | #define FLD(f) abuf->fields.fmt_20_jmp.f |
511 | EXTRACT_FMT_20_JMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
512 | ||
513 | EXTRACT_FMT_20_JMP_CODE | |
646c6f2b DE |
514 | |
515 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
516 | FLD (f_r2) = & CPU (h_gr)[f_r2]; |
517 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_20_jmp", "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
518 | |
519 | abuf->length = length; | |
520 | abuf->addr = pc; | |
521 | ||
522 | #if WITH_PROFILE_MODEL_P | |
523 | /* Record the fields for profiling. */ | |
524 | if (PROFILE_MODEL_P (current_cpu)) | |
525 | { | |
9d70630e | 526 | abuf->h_gr_get = 0 | (1 << f_r2); |
646c6f2b DE |
527 | } |
528 | #endif | |
529 | #undef FLD | |
530 | } | |
531 | ||
532 | void | |
9d70630e | 533 | EX_FN_NAME (m32r,fmt_21_ld) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 534 | { |
9d70630e DE |
535 | #define FLD(f) abuf->fields.fmt_21_ld.f |
536 | EXTRACT_FMT_21_LD_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
537 | ||
538 | EXTRACT_FMT_21_LD_CODE | |
646c6f2b DE |
539 | |
540 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
541 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
542 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
543 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_21_ld", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
544 | |
545 | abuf->length = length; | |
546 | abuf->addr = pc; | |
547 | ||
548 | #if WITH_PROFILE_MODEL_P | |
549 | /* Record the fields for profiling. */ | |
550 | if (PROFILE_MODEL_P (current_cpu)) | |
551 | { | |
9d70630e DE |
552 | abuf->h_gr_get = 0 | (1 << f_r2); |
553 | abuf->h_gr_set = 0 | (1 << f_r1); | |
646c6f2b DE |
554 | } |
555 | #endif | |
556 | #undef FLD | |
557 | } | |
558 | ||
559 | void | |
9d70630e | 560 | EX_FN_NAME (m32r,fmt_22_ld_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 561 | { |
9d70630e DE |
562 | #define FLD(f) abuf->fields.fmt_22_ld_d.f |
563 | EXTRACT_FMT_22_LD_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
646c6f2b | 564 | |
9d70630e | 565 | EXTRACT_FMT_22_LD_D_CODE |
646c6f2b DE |
566 | |
567 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
568 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
569 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
570 | FLD (f_simm16) = f_simm16; | |
571 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_22_ld_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); | |
646c6f2b DE |
572 | |
573 | abuf->length = length; | |
574 | abuf->addr = pc; | |
575 | ||
576 | #if WITH_PROFILE_MODEL_P | |
577 | /* Record the fields for profiling. */ | |
578 | if (PROFILE_MODEL_P (current_cpu)) | |
579 | { | |
9d70630e DE |
580 | abuf->h_gr_get = 0 | (1 << f_r2); |
581 | abuf->h_gr_set = 0 | (1 << f_r1); | |
646c6f2b DE |
582 | } |
583 | #endif | |
584 | #undef FLD | |
585 | } | |
586 | ||
587 | void | |
9d70630e | 588 | EX_FN_NAME (m32r,fmt_23_ldb) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 589 | { |
9d70630e DE |
590 | #define FLD(f) abuf->fields.fmt_23_ldb.f |
591 | EXTRACT_FMT_23_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
646c6f2b | 592 | |
9d70630e | 593 | EXTRACT_FMT_23_LDB_CODE |
646c6f2b DE |
594 | |
595 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
596 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
597 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
598 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_23_ldb", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
599 | |
600 | abuf->length = length; | |
601 | abuf->addr = pc; | |
602 | ||
603 | #if WITH_PROFILE_MODEL_P | |
604 | /* Record the fields for profiling. */ | |
605 | if (PROFILE_MODEL_P (current_cpu)) | |
606 | { | |
9d70630e DE |
607 | abuf->h_gr_get = 0 | (1 << f_r2); |
608 | abuf->h_gr_set = 0 | (1 << f_r1); | |
646c6f2b DE |
609 | } |
610 | #endif | |
611 | #undef FLD | |
612 | } | |
613 | ||
614 | void | |
9d70630e | 615 | EX_FN_NAME (m32r,fmt_24_ldb_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 616 | { |
9d70630e DE |
617 | #define FLD(f) abuf->fields.fmt_24_ldb_d.f |
618 | EXTRACT_FMT_24_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
619 | ||
620 | EXTRACT_FMT_24_LDB_D_CODE | |
646c6f2b DE |
621 | |
622 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
623 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
624 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
646c6f2b | 625 | FLD (f_simm16) = f_simm16; |
9d70630e | 626 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_24_ldb_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); |
646c6f2b DE |
627 | |
628 | abuf->length = length; | |
629 | abuf->addr = pc; | |
630 | ||
631 | #if WITH_PROFILE_MODEL_P | |
632 | /* Record the fields for profiling. */ | |
633 | if (PROFILE_MODEL_P (current_cpu)) | |
634 | { | |
635 | abuf->h_gr_get = 0 | (1 << f_r2); | |
9d70630e | 636 | abuf->h_gr_set = 0 | (1 << f_r1); |
646c6f2b DE |
637 | } |
638 | #endif | |
639 | #undef FLD | |
640 | } | |
641 | ||
642 | void | |
9d70630e | 643 | EX_FN_NAME (m32r,fmt_25_ldh) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 644 | { |
9d70630e DE |
645 | #define FLD(f) abuf->fields.fmt_25_ldh.f |
646 | EXTRACT_FMT_25_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
647 | ||
648 | EXTRACT_FMT_25_LDH_CODE | |
646c6f2b DE |
649 | |
650 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
651 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
652 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
653 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_25_ldh", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
654 | |
655 | abuf->length = length; | |
656 | abuf->addr = pc; | |
657 | ||
658 | #if WITH_PROFILE_MODEL_P | |
659 | /* Record the fields for profiling. */ | |
660 | if (PROFILE_MODEL_P (current_cpu)) | |
661 | { | |
9d70630e DE |
662 | abuf->h_gr_get = 0 | (1 << f_r2); |
663 | abuf->h_gr_set = 0 | (1 << f_r1); | |
646c6f2b DE |
664 | } |
665 | #endif | |
666 | #undef FLD | |
667 | } | |
668 | ||
669 | void | |
9d70630e | 670 | EX_FN_NAME (m32r,fmt_26_ldh_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 671 | { |
9d70630e DE |
672 | #define FLD(f) abuf->fields.fmt_26_ldh_d.f |
673 | EXTRACT_FMT_26_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
674 | ||
675 | EXTRACT_FMT_26_LDH_D_CODE | |
646c6f2b DE |
676 | |
677 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
678 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
679 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
680 | FLD (f_simm16) = f_simm16; | |
681 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_26_ldh_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); | |
646c6f2b DE |
682 | |
683 | abuf->length = length; | |
684 | abuf->addr = pc; | |
685 | ||
686 | #if WITH_PROFILE_MODEL_P | |
687 | /* Record the fields for profiling. */ | |
688 | if (PROFILE_MODEL_P (current_cpu)) | |
689 | { | |
690 | abuf->h_gr_get = 0 | (1 << f_r2); | |
9d70630e | 691 | abuf->h_gr_set = 0 | (1 << f_r1); |
646c6f2b DE |
692 | } |
693 | #endif | |
694 | #undef FLD | |
695 | } | |
696 | ||
697 | void | |
9d70630e | 698 | EX_FN_NAME (m32r,fmt_27_ld24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 699 | { |
9d70630e DE |
700 | #define FLD(f) abuf->fields.fmt_27_ld24.f |
701 | EXTRACT_FMT_27_LD24_VARS /* f-op1 f-r1 f-uimm24 */ | |
702 | ||
703 | EXTRACT_FMT_27_LD24_CODE | |
646c6f2b DE |
704 | |
705 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
706 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
707 | FLD (f_uimm24) = f_uimm24; | |
708 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_27_ld24", "dr 0x%x", 'x', f_r1, "uimm24 0x%x", 'x', f_uimm24, (char *) 0)); | |
646c6f2b DE |
709 | |
710 | abuf->length = length; | |
711 | abuf->addr = pc; | |
712 | ||
713 | #if WITH_PROFILE_MODEL_P | |
714 | /* Record the fields for profiling. */ | |
715 | if (PROFILE_MODEL_P (current_cpu)) | |
716 | { | |
646c6f2b DE |
717 | abuf->h_gr_set = 0 | (1 << f_r1); |
718 | } | |
719 | #endif | |
720 | #undef FLD | |
721 | } | |
722 | ||
723 | void | |
9d70630e | 724 | EX_FN_NAME (m32r,fmt_28_ldi8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 725 | { |
9d70630e DE |
726 | #define FLD(f) abuf->fields.fmt_28_ldi8.f |
727 | EXTRACT_FMT_28_LDI8_VARS /* f-op1 f-r1 f-simm8 */ | |
728 | ||
729 | EXTRACT_FMT_28_LDI8_CODE | |
646c6f2b DE |
730 | |
731 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
732 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
733 | FLD (f_simm8) = f_simm8; | |
734 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_28_ldi8", "dr 0x%x", 'x', f_r1, "simm8 0x%x", 'x', f_simm8, (char *) 0)); | |
646c6f2b DE |
735 | |
736 | abuf->length = length; | |
737 | abuf->addr = pc; | |
738 | ||
739 | #if WITH_PROFILE_MODEL_P | |
740 | /* Record the fields for profiling. */ | |
741 | if (PROFILE_MODEL_P (current_cpu)) | |
742 | { | |
646c6f2b DE |
743 | abuf->h_gr_set = 0 | (1 << f_r1); |
744 | } | |
745 | #endif | |
746 | #undef FLD | |
747 | } | |
748 | ||
749 | void | |
9d70630e | 750 | EX_FN_NAME (m32r,fmt_29_ldi16) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 751 | { |
9d70630e DE |
752 | #define FLD(f) abuf->fields.fmt_29_ldi16.f |
753 | EXTRACT_FMT_29_LDI16_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
754 | ||
755 | EXTRACT_FMT_29_LDI16_CODE | |
646c6f2b DE |
756 | |
757 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
758 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
759 | FLD (f_simm16) = f_simm16; | |
760 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_29_ldi16", "dr 0x%x", 'x', f_r1, "slo16 0x%x", 'x', f_simm16, (char *) 0)); | |
646c6f2b DE |
761 | |
762 | abuf->length = length; | |
763 | abuf->addr = pc; | |
764 | ||
765 | #if WITH_PROFILE_MODEL_P | |
766 | /* Record the fields for profiling. */ | |
767 | if (PROFILE_MODEL_P (current_cpu)) | |
768 | { | |
646c6f2b DE |
769 | abuf->h_gr_set = 0 | (1 << f_r1); |
770 | } | |
771 | #endif | |
772 | #undef FLD | |
773 | } | |
774 | ||
775 | void | |
9d70630e | 776 | EX_FN_NAME (m32r,fmt_30_machi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 777 | { |
9d70630e DE |
778 | #define FLD(f) abuf->fields.fmt_30_machi.f |
779 | EXTRACT_FMT_30_MACHI_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
780 | ||
781 | EXTRACT_FMT_30_MACHI_CODE | |
646c6f2b DE |
782 | |
783 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
784 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
785 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
786 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_30_machi", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
787 | |
788 | abuf->length = length; | |
789 | abuf->addr = pc; | |
790 | ||
791 | #if WITH_PROFILE_MODEL_P | |
792 | /* Record the fields for profiling. */ | |
793 | if (PROFILE_MODEL_P (current_cpu)) | |
794 | { | |
795 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); | |
646c6f2b DE |
796 | } |
797 | #endif | |
798 | #undef FLD | |
799 | } | |
800 | ||
801 | void | |
9d70630e | 802 | EX_FN_NAME (m32r,fmt_31_mv) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 803 | { |
9d70630e DE |
804 | #define FLD(f) abuf->fields.fmt_31_mv.f |
805 | EXTRACT_FMT_31_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
806 | ||
807 | EXTRACT_FMT_31_MV_CODE | |
646c6f2b DE |
808 | |
809 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
810 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
811 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
812 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_31_mv", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
813 | |
814 | abuf->length = length; | |
815 | abuf->addr = pc; | |
816 | ||
817 | #if WITH_PROFILE_MODEL_P | |
818 | /* Record the fields for profiling. */ | |
819 | if (PROFILE_MODEL_P (current_cpu)) | |
820 | { | |
821 | abuf->h_gr_get = 0 | (1 << f_r2); | |
9d70630e | 822 | abuf->h_gr_set = 0 | (1 << f_r1); |
646c6f2b DE |
823 | } |
824 | #endif | |
825 | #undef FLD | |
826 | } | |
827 | ||
828 | void | |
9d70630e | 829 | EX_FN_NAME (m32r,fmt_32_mvfachi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 830 | { |
9d70630e DE |
831 | #define FLD(f) abuf->fields.fmt_32_mvfachi.f |
832 | EXTRACT_FMT_32_MVFACHI_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
833 | ||
834 | EXTRACT_FMT_32_MVFACHI_CODE | |
646c6f2b DE |
835 | |
836 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
837 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
838 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_32_mvfachi", "dr 0x%x", 'x', f_r1, (char *) 0)); | |
646c6f2b DE |
839 | |
840 | abuf->length = length; | |
841 | abuf->addr = pc; | |
842 | ||
843 | #if WITH_PROFILE_MODEL_P | |
844 | /* Record the fields for profiling. */ | |
845 | if (PROFILE_MODEL_P (current_cpu)) | |
846 | { | |
9d70630e | 847 | abuf->h_gr_set = 0 | (1 << f_r1); |
646c6f2b DE |
848 | } |
849 | #endif | |
850 | #undef FLD | |
851 | } | |
852 | ||
853 | void | |
9d70630e | 854 | EX_FN_NAME (m32r,fmt_33_mvfc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 855 | { |
9d70630e DE |
856 | #define FLD(f) abuf->fields.fmt_33_mvfc.f |
857 | EXTRACT_FMT_33_MVFC_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
858 | ||
859 | EXTRACT_FMT_33_MVFC_CODE | |
646c6f2b DE |
860 | |
861 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
862 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
863 | FLD (f_r2) = f_r2; | |
864 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_33_mvfc", "dr 0x%x", 'x', f_r1, "scr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
865 | |
866 | abuf->length = length; | |
867 | abuf->addr = pc; | |
868 | ||
869 | #if WITH_PROFILE_MODEL_P | |
870 | /* Record the fields for profiling. */ | |
871 | if (PROFILE_MODEL_P (current_cpu)) | |
872 | { | |
646c6f2b DE |
873 | abuf->h_gr_set = 0 | (1 << f_r1); |
874 | } | |
875 | #endif | |
876 | #undef FLD | |
877 | } | |
878 | ||
879 | void | |
9d70630e | 880 | EX_FN_NAME (m32r,fmt_34_mvtachi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 881 | { |
9d70630e DE |
882 | #define FLD(f) abuf->fields.fmt_34_mvtachi.f |
883 | EXTRACT_FMT_34_MVTACHI_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
884 | ||
885 | EXTRACT_FMT_34_MVTACHI_CODE | |
646c6f2b DE |
886 | |
887 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
888 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
889 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_34_mvtachi", "src1 0x%x", 'x', f_r1, (char *) 0)); | |
646c6f2b DE |
890 | |
891 | abuf->length = length; | |
892 | abuf->addr = pc; | |
893 | ||
894 | #if WITH_PROFILE_MODEL_P | |
895 | /* Record the fields for profiling. */ | |
896 | if (PROFILE_MODEL_P (current_cpu)) | |
897 | { | |
9d70630e | 898 | abuf->h_gr_get = 0 | (1 << f_r1); |
646c6f2b DE |
899 | } |
900 | #endif | |
901 | #undef FLD | |
902 | } | |
903 | ||
904 | void | |
9d70630e | 905 | EX_FN_NAME (m32r,fmt_35_mvtc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 906 | { |
9d70630e DE |
907 | #define FLD(f) abuf->fields.fmt_35_mvtc.f |
908 | EXTRACT_FMT_35_MVTC_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
909 | ||
910 | EXTRACT_FMT_35_MVTC_CODE | |
646c6f2b DE |
911 | |
912 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
913 | FLD (f_r1) = f_r1; |
914 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
915 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_35_mvtc", "dcr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); | |
646c6f2b DE |
916 | |
917 | abuf->length = length; | |
918 | abuf->addr = pc; | |
919 | ||
920 | #if WITH_PROFILE_MODEL_P | |
921 | /* Record the fields for profiling. */ | |
922 | if (PROFILE_MODEL_P (current_cpu)) | |
923 | { | |
924 | abuf->h_gr_get = 0 | (1 << f_r2); | |
646c6f2b DE |
925 | } |
926 | #endif | |
927 | #undef FLD | |
928 | } | |
929 | ||
930 | void | |
9d70630e | 931 | EX_FN_NAME (m32r,fmt_36_nop) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 932 | { |
9d70630e DE |
933 | #define FLD(f) abuf->fields.fmt_36_nop.f |
934 | EXTRACT_FMT_36_NOP_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
935 | ||
936 | EXTRACT_FMT_36_NOP_CODE | |
646c6f2b DE |
937 | |
938 | /* Record the fields for the semantic handler. */ | |
9d70630e | 939 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_36_nop", (char *) 0)); |
646c6f2b DE |
940 | |
941 | abuf->length = length; | |
942 | abuf->addr = pc; | |
646c6f2b DE |
943 | #undef FLD |
944 | } | |
945 | ||
946 | void | |
9d70630e | 947 | EX_FN_NAME (m32r,fmt_37_rac) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 948 | { |
9d70630e DE |
949 | #define FLD(f) abuf->fields.fmt_37_rac.f |
950 | EXTRACT_FMT_37_RAC_VARS /* f-op1 f-r1 f-op2 f-r2 */ | |
951 | ||
952 | EXTRACT_FMT_37_RAC_CODE | |
646c6f2b DE |
953 | |
954 | /* Record the fields for the semantic handler. */ | |
9d70630e | 955 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_37_rac", (char *) 0)); |
646c6f2b DE |
956 | |
957 | abuf->length = length; | |
958 | abuf->addr = pc; | |
646c6f2b DE |
959 | #undef FLD |
960 | } | |
961 | ||
962 | void | |
9d70630e | 963 | EX_FN_NAME (m32r,fmt_38_seth) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 964 | { |
9d70630e DE |
965 | #define FLD(f) abuf->fields.fmt_38_seth.f |
966 | EXTRACT_FMT_38_SETH_VARS /* f-op1 f-r1 f-op2 f-r2 f-hi16 */ | |
967 | ||
968 | EXTRACT_FMT_38_SETH_CODE | |
646c6f2b DE |
969 | |
970 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
971 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
972 | FLD (f_hi16) = f_hi16; | |
973 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_38_seth", "dr 0x%x", 'x', f_r1, "hi16 0x%x", 'x', f_hi16, (char *) 0)); | |
646c6f2b DE |
974 | |
975 | abuf->length = length; | |
976 | abuf->addr = pc; | |
977 | ||
978 | #if WITH_PROFILE_MODEL_P | |
979 | /* Record the fields for profiling. */ | |
980 | if (PROFILE_MODEL_P (current_cpu)) | |
981 | { | |
646c6f2b DE |
982 | abuf->h_gr_set = 0 | (1 << f_r1); |
983 | } | |
984 | #endif | |
985 | #undef FLD | |
986 | } | |
987 | ||
988 | void | |
9d70630e | 989 | EX_FN_NAME (m32r,fmt_39_slli) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 990 | { |
9d70630e DE |
991 | #define FLD(f) abuf->fields.fmt_39_slli.f |
992 | EXTRACT_FMT_39_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */ | |
993 | ||
994 | EXTRACT_FMT_39_SLLI_CODE | |
646c6f2b DE |
995 | |
996 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
997 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
998 | FLD (f_uimm5) = f_uimm5; | |
999 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_39_slli", "dr 0x%x", 'x', f_r1, "uimm5 0x%x", 'x', f_uimm5, (char *) 0)); | |
646c6f2b DE |
1000 | |
1001 | abuf->length = length; | |
1002 | abuf->addr = pc; | |
1003 | ||
1004 | #if WITH_PROFILE_MODEL_P | |
1005 | /* Record the fields for profiling. */ | |
1006 | if (PROFILE_MODEL_P (current_cpu)) | |
1007 | { | |
9d70630e | 1008 | abuf->h_gr_get = 0 | (1 << f_r1); |
646c6f2b DE |
1009 | abuf->h_gr_set = 0 | (1 << f_r1); |
1010 | } | |
1011 | #endif | |
1012 | #undef FLD | |
1013 | } | |
1014 | ||
1015 | void | |
9d70630e | 1016 | EX_FN_NAME (m32r,fmt_40_st_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 1017 | { |
9d70630e DE |
1018 | #define FLD(f) abuf->fields.fmt_40_st_d.f |
1019 | EXTRACT_FMT_40_ST_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ | |
1020 | ||
1021 | EXTRACT_FMT_40_ST_D_CODE | |
646c6f2b DE |
1022 | |
1023 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
1024 | FLD (f_r1) = & CPU (h_gr)[f_r1]; |
1025 | FLD (f_r2) = & CPU (h_gr)[f_r2]; | |
646c6f2b | 1026 | FLD (f_simm16) = f_simm16; |
9d70630e | 1027 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_40_st_d", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); |
646c6f2b DE |
1028 | |
1029 | abuf->length = length; | |
1030 | abuf->addr = pc; | |
1031 | ||
1032 | #if WITH_PROFILE_MODEL_P | |
1033 | /* Record the fields for profiling. */ | |
1034 | if (PROFILE_MODEL_P (current_cpu)) | |
1035 | { | |
9d70630e | 1036 | abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); |
646c6f2b DE |
1037 | } |
1038 | #endif | |
1039 | #undef FLD | |
1040 | } | |
1041 | ||
1042 | void | |
9d70630e | 1043 | EX_FN_NAME (m32r,fmt_41_trap) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 1044 | { |
9d70630e DE |
1045 | #define FLD(f) abuf->fields.fmt_41_trap.f |
1046 | EXTRACT_FMT_41_TRAP_VARS /* f-op1 f-r1 f-op2 f-uimm4 */ | |
1047 | ||
1048 | EXTRACT_FMT_41_TRAP_CODE | |
646c6f2b DE |
1049 | |
1050 | /* Record the fields for the semantic handler. */ | |
9d70630e DE |
1051 | FLD (f_uimm4) = f_uimm4; |
1052 | TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_41_trap", "uimm4 0x%x", 'x', f_uimm4, (char *) 0)); | |
646c6f2b DE |
1053 | |
1054 | abuf->length = length; | |
1055 | abuf->addr = pc; | |
646c6f2b DE |
1056 | #undef FLD |
1057 | } | |
1058 | ||
1059 | void | |
9d70630e | 1060 | EX_FN_NAME (m32r,illegal) (SIM_CPU *cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 1061 | { |
9d70630e | 1062 | abuf->length = CGEN_BASE_INSN_SIZE; |
646c6f2b | 1063 | abuf->addr = pc; |
9d70630e DE |
1064 | /* Leave signalling to semantic fn. */ |
1065 | } | |
646c6f2b | 1066 | |
9d70630e | 1067 | #if 0 /*wip*/ |
646c6f2b | 1068 | void |
9d70630e | 1069 | EXC_FN_NAME (m32r,illegal) (SIM_CPU *cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) |
646c6f2b | 1070 | { |
9d70630e | 1071 | abuf->length = CGEN_BASE_INSN_SIZE; |
646c6f2b | 1072 | abuf->addr = pc; |
9d70630e | 1073 | /* Leave signalling to semantic fn. */ |
646c6f2b | 1074 | } |
646c6f2b | 1075 | #endif |