Update
[gdb.git] / sim / m32r / model2.c
blob4408ed64926c545813fea90c64f58d5408801b74
1 /* Simulator model support for m32r2f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #define WANT_CPU m32r2f
25 #define WANT_CPU_M32R2F
27 #include "sim-main.h"
29 /* The profiling data is recorded here, but is accessed via the profiling
30 mechanism. After all, this is information for profiling. */
32 #if WITH_PROFILE_MODEL_P
34 /* Model handlers for each insn. */
36 static int
37 model_m32r2_add (SIM_CPU *current_cpu, void *sem_arg)
39 #define FLD(f) abuf->fields.sfmt_add.f
40 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
41 const IDESC * UNUSED idesc = abuf->idesc;
42 int cycles = 0;
44 int referenced = 0;
45 int UNUSED insn_referenced = abuf->written;
46 INT in_sr = -1;
47 INT in_dr = -1;
48 INT out_dr = -1;
49 in_sr = FLD (in_sr);
50 in_dr = FLD (in_dr);
51 out_dr = FLD (out_dr);
52 referenced |= 1 << 0;
53 referenced |= 1 << 1;
54 referenced |= 1 << 2;
55 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
57 return cycles;
58 #undef FLD
61 static int
62 model_m32r2_add3 (SIM_CPU *current_cpu, void *sem_arg)
64 #define FLD(f) abuf->fields.sfmt_add3.f
65 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
66 const IDESC * UNUSED idesc = abuf->idesc;
67 int cycles = 0;
69 int referenced = 0;
70 int UNUSED insn_referenced = abuf->written;
71 INT in_sr = -1;
72 INT in_dr = -1;
73 INT out_dr = -1;
74 in_sr = FLD (in_sr);
75 out_dr = FLD (out_dr);
76 referenced |= 1 << 0;
77 referenced |= 1 << 2;
78 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
80 return cycles;
81 #undef FLD
84 static int
85 model_m32r2_and (SIM_CPU *current_cpu, void *sem_arg)
87 #define FLD(f) abuf->fields.sfmt_add.f
88 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
89 const IDESC * UNUSED idesc = abuf->idesc;
90 int cycles = 0;
92 int referenced = 0;
93 int UNUSED insn_referenced = abuf->written;
94 INT in_sr = -1;
95 INT in_dr = -1;
96 INT out_dr = -1;
97 in_sr = FLD (in_sr);
98 in_dr = FLD (in_dr);
99 out_dr = FLD (out_dr);
100 referenced |= 1 << 0;
101 referenced |= 1 << 1;
102 referenced |= 1 << 2;
103 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
105 return cycles;
106 #undef FLD
109 static int
110 model_m32r2_and3 (SIM_CPU *current_cpu, void *sem_arg)
112 #define FLD(f) abuf->fields.sfmt_and3.f
113 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
114 const IDESC * UNUSED idesc = abuf->idesc;
115 int cycles = 0;
117 int referenced = 0;
118 int UNUSED insn_referenced = abuf->written;
119 INT in_sr = -1;
120 INT in_dr = -1;
121 INT out_dr = -1;
122 in_sr = FLD (in_sr);
123 out_dr = FLD (out_dr);
124 referenced |= 1 << 0;
125 referenced |= 1 << 2;
126 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
128 return cycles;
129 #undef FLD
132 static int
133 model_m32r2_or (SIM_CPU *current_cpu, void *sem_arg)
135 #define FLD(f) abuf->fields.sfmt_add.f
136 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
137 const IDESC * UNUSED idesc = abuf->idesc;
138 int cycles = 0;
140 int referenced = 0;
141 int UNUSED insn_referenced = abuf->written;
142 INT in_sr = -1;
143 INT in_dr = -1;
144 INT out_dr = -1;
145 in_sr = FLD (in_sr);
146 in_dr = FLD (in_dr);
147 out_dr = FLD (out_dr);
148 referenced |= 1 << 0;
149 referenced |= 1 << 1;
150 referenced |= 1 << 2;
151 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
153 return cycles;
154 #undef FLD
157 static int
158 model_m32r2_or3 (SIM_CPU *current_cpu, void *sem_arg)
160 #define FLD(f) abuf->fields.sfmt_and3.f
161 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
162 const IDESC * UNUSED idesc = abuf->idesc;
163 int cycles = 0;
165 int referenced = 0;
166 int UNUSED insn_referenced = abuf->written;
167 INT in_sr = -1;
168 INT in_dr = -1;
169 INT out_dr = -1;
170 in_sr = FLD (in_sr);
171 out_dr = FLD (out_dr);
172 referenced |= 1 << 0;
173 referenced |= 1 << 2;
174 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
176 return cycles;
177 #undef FLD
180 static int
181 model_m32r2_xor (SIM_CPU *current_cpu, void *sem_arg)
183 #define FLD(f) abuf->fields.sfmt_add.f
184 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
185 const IDESC * UNUSED idesc = abuf->idesc;
186 int cycles = 0;
188 int referenced = 0;
189 int UNUSED insn_referenced = abuf->written;
190 INT in_sr = -1;
191 INT in_dr = -1;
192 INT out_dr = -1;
193 in_sr = FLD (in_sr);
194 in_dr = FLD (in_dr);
195 out_dr = FLD (out_dr);
196 referenced |= 1 << 0;
197 referenced |= 1 << 1;
198 referenced |= 1 << 2;
199 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
201 return cycles;
202 #undef FLD
205 static int
206 model_m32r2_xor3 (SIM_CPU *current_cpu, void *sem_arg)
208 #define FLD(f) abuf->fields.sfmt_and3.f
209 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
210 const IDESC * UNUSED idesc = abuf->idesc;
211 int cycles = 0;
213 int referenced = 0;
214 int UNUSED insn_referenced = abuf->written;
215 INT in_sr = -1;
216 INT in_dr = -1;
217 INT out_dr = -1;
218 in_sr = FLD (in_sr);
219 out_dr = FLD (out_dr);
220 referenced |= 1 << 0;
221 referenced |= 1 << 2;
222 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
224 return cycles;
225 #undef FLD
228 static int
229 model_m32r2_addi (SIM_CPU *current_cpu, void *sem_arg)
231 #define FLD(f) abuf->fields.sfmt_addi.f
232 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
233 const IDESC * UNUSED idesc = abuf->idesc;
234 int cycles = 0;
236 int referenced = 0;
237 int UNUSED insn_referenced = abuf->written;
238 INT in_sr = -1;
239 INT in_dr = -1;
240 INT out_dr = -1;
241 in_dr = FLD (in_dr);
242 out_dr = FLD (out_dr);
243 referenced |= 1 << 1;
244 referenced |= 1 << 2;
245 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
247 return cycles;
248 #undef FLD
251 static int
252 model_m32r2_addv (SIM_CPU *current_cpu, void *sem_arg)
254 #define FLD(f) abuf->fields.sfmt_add.f
255 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
256 const IDESC * UNUSED idesc = abuf->idesc;
257 int cycles = 0;
259 int referenced = 0;
260 int UNUSED insn_referenced = abuf->written;
261 INT in_sr = -1;
262 INT in_dr = -1;
263 INT out_dr = -1;
264 in_sr = FLD (in_sr);
265 in_dr = FLD (in_dr);
266 out_dr = FLD (out_dr);
267 referenced |= 1 << 0;
268 referenced |= 1 << 1;
269 referenced |= 1 << 2;
270 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
272 return cycles;
273 #undef FLD
276 static int
277 model_m32r2_addv3 (SIM_CPU *current_cpu, void *sem_arg)
279 #define FLD(f) abuf->fields.sfmt_add3.f
280 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
281 const IDESC * UNUSED idesc = abuf->idesc;
282 int cycles = 0;
284 int referenced = 0;
285 int UNUSED insn_referenced = abuf->written;
286 INT in_sr = -1;
287 INT in_dr = -1;
288 INT out_dr = -1;
289 in_sr = FLD (in_sr);
290 out_dr = FLD (out_dr);
291 referenced |= 1 << 0;
292 referenced |= 1 << 2;
293 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
295 return cycles;
296 #undef FLD
299 static int
300 model_m32r2_addx (SIM_CPU *current_cpu, void *sem_arg)
302 #define FLD(f) abuf->fields.sfmt_add.f
303 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
304 const IDESC * UNUSED idesc = abuf->idesc;
305 int cycles = 0;
307 int referenced = 0;
308 int UNUSED insn_referenced = abuf->written;
309 INT in_sr = -1;
310 INT in_dr = -1;
311 INT out_dr = -1;
312 in_sr = FLD (in_sr);
313 in_dr = FLD (in_dr);
314 out_dr = FLD (out_dr);
315 referenced |= 1 << 0;
316 referenced |= 1 << 1;
317 referenced |= 1 << 2;
318 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
320 return cycles;
321 #undef FLD
324 static int
325 model_m32r2_bc8 (SIM_CPU *current_cpu, void *sem_arg)
327 #define FLD(f) abuf->fields.sfmt_bl8.f
328 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
329 const IDESC * UNUSED idesc = abuf->idesc;
330 int cycles = 0;
332 int referenced = 0;
333 int UNUSED insn_referenced = abuf->written;
334 INT in_sr = -1;
335 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
336 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
338 return cycles;
339 #undef FLD
342 static int
343 model_m32r2_bc24 (SIM_CPU *current_cpu, void *sem_arg)
345 #define FLD(f) abuf->fields.sfmt_bl24.f
346 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
347 const IDESC * UNUSED idesc = abuf->idesc;
348 int cycles = 0;
350 int referenced = 0;
351 int UNUSED insn_referenced = abuf->written;
352 INT in_sr = -1;
353 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
354 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
356 return cycles;
357 #undef FLD
360 static int
361 model_m32r2_beq (SIM_CPU *current_cpu, void *sem_arg)
363 #define FLD(f) abuf->fields.sfmt_beq.f
364 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
365 const IDESC * UNUSED idesc = abuf->idesc;
366 int cycles = 0;
368 int referenced = 0;
369 int UNUSED insn_referenced = abuf->written;
370 INT in_sr = -1;
371 if (insn_referenced & (1 << 3)) referenced |= 1 << 1;
372 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
375 int referenced = 0;
376 int UNUSED insn_referenced = abuf->written;
377 INT in_src1 = -1;
378 INT in_src2 = -1;
379 in_src1 = FLD (in_src1);
380 in_src2 = FLD (in_src2);
381 referenced |= 1 << 0;
382 referenced |= 1 << 1;
383 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
385 return cycles;
386 #undef FLD
389 static int
390 model_m32r2_beqz (SIM_CPU *current_cpu, void *sem_arg)
392 #define FLD(f) abuf->fields.sfmt_beq.f
393 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
394 const IDESC * UNUSED idesc = abuf->idesc;
395 int cycles = 0;
397 int referenced = 0;
398 int UNUSED insn_referenced = abuf->written;
399 INT in_sr = -1;
400 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
401 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
404 int referenced = 0;
405 int UNUSED insn_referenced = abuf->written;
406 INT in_src1 = -1;
407 INT in_src2 = -1;
408 in_src2 = FLD (in_src2);
409 referenced |= 1 << 1;
410 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
412 return cycles;
413 #undef FLD
416 static int
417 model_m32r2_bgez (SIM_CPU *current_cpu, void *sem_arg)
419 #define FLD(f) abuf->fields.sfmt_beq.f
420 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
421 const IDESC * UNUSED idesc = abuf->idesc;
422 int cycles = 0;
424 int referenced = 0;
425 int UNUSED insn_referenced = abuf->written;
426 INT in_sr = -1;
427 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
428 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
431 int referenced = 0;
432 int UNUSED insn_referenced = abuf->written;
433 INT in_src1 = -1;
434 INT in_src2 = -1;
435 in_src2 = FLD (in_src2);
436 referenced |= 1 << 1;
437 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
439 return cycles;
440 #undef FLD
443 static int
444 model_m32r2_bgtz (SIM_CPU *current_cpu, void *sem_arg)
446 #define FLD(f) abuf->fields.sfmt_beq.f
447 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
448 const IDESC * UNUSED idesc = abuf->idesc;
449 int cycles = 0;
451 int referenced = 0;
452 int UNUSED insn_referenced = abuf->written;
453 INT in_sr = -1;
454 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
455 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
458 int referenced = 0;
459 int UNUSED insn_referenced = abuf->written;
460 INT in_src1 = -1;
461 INT in_src2 = -1;
462 in_src2 = FLD (in_src2);
463 referenced |= 1 << 1;
464 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
466 return cycles;
467 #undef FLD
470 static int
471 model_m32r2_blez (SIM_CPU *current_cpu, void *sem_arg)
473 #define FLD(f) abuf->fields.sfmt_beq.f
474 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
475 const IDESC * UNUSED idesc = abuf->idesc;
476 int cycles = 0;
478 int referenced = 0;
479 int UNUSED insn_referenced = abuf->written;
480 INT in_sr = -1;
481 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
482 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
485 int referenced = 0;
486 int UNUSED insn_referenced = abuf->written;
487 INT in_src1 = -1;
488 INT in_src2 = -1;
489 in_src2 = FLD (in_src2);
490 referenced |= 1 << 1;
491 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
493 return cycles;
494 #undef FLD
497 static int
498 model_m32r2_bltz (SIM_CPU *current_cpu, void *sem_arg)
500 #define FLD(f) abuf->fields.sfmt_beq.f
501 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
502 const IDESC * UNUSED idesc = abuf->idesc;
503 int cycles = 0;
505 int referenced = 0;
506 int UNUSED insn_referenced = abuf->written;
507 INT in_sr = -1;
508 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
509 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
512 int referenced = 0;
513 int UNUSED insn_referenced = abuf->written;
514 INT in_src1 = -1;
515 INT in_src2 = -1;
516 in_src2 = FLD (in_src2);
517 referenced |= 1 << 1;
518 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
520 return cycles;
521 #undef FLD
524 static int
525 model_m32r2_bnez (SIM_CPU *current_cpu, void *sem_arg)
527 #define FLD(f) abuf->fields.sfmt_beq.f
528 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
529 const IDESC * UNUSED idesc = abuf->idesc;
530 int cycles = 0;
532 int referenced = 0;
533 int UNUSED insn_referenced = abuf->written;
534 INT in_sr = -1;
535 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
536 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
539 int referenced = 0;
540 int UNUSED insn_referenced = abuf->written;
541 INT in_src1 = -1;
542 INT in_src2 = -1;
543 in_src2 = FLD (in_src2);
544 referenced |= 1 << 1;
545 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
547 return cycles;
548 #undef FLD
551 static int
552 model_m32r2_bl8 (SIM_CPU *current_cpu, void *sem_arg)
554 #define FLD(f) abuf->fields.sfmt_bl8.f
555 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
556 const IDESC * UNUSED idesc = abuf->idesc;
557 int cycles = 0;
559 int referenced = 0;
560 int UNUSED insn_referenced = abuf->written;
561 INT in_sr = -1;
562 referenced |= 1 << 1;
563 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
565 return cycles;
566 #undef FLD
569 static int
570 model_m32r2_bl24 (SIM_CPU *current_cpu, void *sem_arg)
572 #define FLD(f) abuf->fields.sfmt_bl24.f
573 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
574 const IDESC * UNUSED idesc = abuf->idesc;
575 int cycles = 0;
577 int referenced = 0;
578 int UNUSED insn_referenced = abuf->written;
579 INT in_sr = -1;
580 referenced |= 1 << 1;
581 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
583 return cycles;
584 #undef FLD
587 static int
588 model_m32r2_bcl8 (SIM_CPU *current_cpu, void *sem_arg)
590 #define FLD(f) abuf->fields.sfmt_bl8.f
591 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
592 const IDESC * UNUSED idesc = abuf->idesc;
593 int cycles = 0;
595 int referenced = 0;
596 int UNUSED insn_referenced = abuf->written;
597 INT in_sr = -1;
598 if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
599 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
601 return cycles;
602 #undef FLD
605 static int
606 model_m32r2_bcl24 (SIM_CPU *current_cpu, void *sem_arg)
608 #define FLD(f) abuf->fields.sfmt_bl24.f
609 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
610 const IDESC * UNUSED idesc = abuf->idesc;
611 int cycles = 0;
613 int referenced = 0;
614 int UNUSED insn_referenced = abuf->written;
615 INT in_sr = -1;
616 if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
617 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
619 return cycles;
620 #undef FLD
623 static int
624 model_m32r2_bnc8 (SIM_CPU *current_cpu, void *sem_arg)
626 #define FLD(f) abuf->fields.sfmt_bl8.f
627 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
628 const IDESC * UNUSED idesc = abuf->idesc;
629 int cycles = 0;
631 int referenced = 0;
632 int UNUSED insn_referenced = abuf->written;
633 INT in_sr = -1;
634 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
635 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
637 return cycles;
638 #undef FLD
641 static int
642 model_m32r2_bnc24 (SIM_CPU *current_cpu, void *sem_arg)
644 #define FLD(f) abuf->fields.sfmt_bl24.f
645 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
646 const IDESC * UNUSED idesc = abuf->idesc;
647 int cycles = 0;
649 int referenced = 0;
650 int UNUSED insn_referenced = abuf->written;
651 INT in_sr = -1;
652 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
653 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
655 return cycles;
656 #undef FLD
659 static int
660 model_m32r2_bne (SIM_CPU *current_cpu, void *sem_arg)
662 #define FLD(f) abuf->fields.sfmt_beq.f
663 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
664 const IDESC * UNUSED idesc = abuf->idesc;
665 int cycles = 0;
667 int referenced = 0;
668 int UNUSED insn_referenced = abuf->written;
669 INT in_sr = -1;
670 if (insn_referenced & (1 << 3)) referenced |= 1 << 1;
671 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
674 int referenced = 0;
675 int UNUSED insn_referenced = abuf->written;
676 INT in_src1 = -1;
677 INT in_src2 = -1;
678 in_src1 = FLD (in_src1);
679 in_src2 = FLD (in_src2);
680 referenced |= 1 << 0;
681 referenced |= 1 << 1;
682 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2);
684 return cycles;
685 #undef FLD
688 static int
689 model_m32r2_bra8 (SIM_CPU *current_cpu, void *sem_arg)
691 #define FLD(f) abuf->fields.sfmt_bl8.f
692 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
693 const IDESC * UNUSED idesc = abuf->idesc;
694 int cycles = 0;
696 int referenced = 0;
697 int UNUSED insn_referenced = abuf->written;
698 INT in_sr = -1;
699 referenced |= 1 << 1;
700 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
702 return cycles;
703 #undef FLD
706 static int
707 model_m32r2_bra24 (SIM_CPU *current_cpu, void *sem_arg)
709 #define FLD(f) abuf->fields.sfmt_bl24.f
710 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
711 const IDESC * UNUSED idesc = abuf->idesc;
712 int cycles = 0;
714 int referenced = 0;
715 int UNUSED insn_referenced = abuf->written;
716 INT in_sr = -1;
717 referenced |= 1 << 1;
718 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
720 return cycles;
721 #undef FLD
724 static int
725 model_m32r2_bncl8 (SIM_CPU *current_cpu, void *sem_arg)
727 #define FLD(f) abuf->fields.sfmt_bl8.f
728 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
729 const IDESC * UNUSED idesc = abuf->idesc;
730 int cycles = 0;
732 int referenced = 0;
733 int UNUSED insn_referenced = abuf->written;
734 INT in_sr = -1;
735 if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
736 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
738 return cycles;
739 #undef FLD
742 static int
743 model_m32r2_bncl24 (SIM_CPU *current_cpu, void *sem_arg)
745 #define FLD(f) abuf->fields.sfmt_bl24.f
746 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
747 const IDESC * UNUSED idesc = abuf->idesc;
748 int cycles = 0;
750 int referenced = 0;
751 int UNUSED insn_referenced = abuf->written;
752 INT in_sr = -1;
753 if (insn_referenced & (1 << 4)) referenced |= 1 << 1;
754 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
756 return cycles;
757 #undef FLD
760 static int
761 model_m32r2_cmp (SIM_CPU *current_cpu, void *sem_arg)
763 #define FLD(f) abuf->fields.sfmt_st_plus.f
764 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
765 const IDESC * UNUSED idesc = abuf->idesc;
766 int cycles = 0;
768 int referenced = 0;
769 int UNUSED insn_referenced = abuf->written;
770 INT in_src1 = -1;
771 INT in_src2 = -1;
772 in_src1 = FLD (in_src1);
773 in_src2 = FLD (in_src2);
774 referenced |= 1 << 0;
775 referenced |= 1 << 1;
776 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
778 return cycles;
779 #undef FLD
782 static int
783 model_m32r2_cmpi (SIM_CPU *current_cpu, void *sem_arg)
785 #define FLD(f) abuf->fields.sfmt_st_d.f
786 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
787 const IDESC * UNUSED idesc = abuf->idesc;
788 int cycles = 0;
790 int referenced = 0;
791 int UNUSED insn_referenced = abuf->written;
792 INT in_src1 = -1;
793 INT in_src2 = -1;
794 in_src2 = FLD (in_src2);
795 referenced |= 1 << 1;
796 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
798 return cycles;
799 #undef FLD
802 static int
803 model_m32r2_cmpu (SIM_CPU *current_cpu, void *sem_arg)
805 #define FLD(f) abuf->fields.sfmt_st_plus.f
806 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
807 const IDESC * UNUSED idesc = abuf->idesc;
808 int cycles = 0;
810 int referenced = 0;
811 int UNUSED insn_referenced = abuf->written;
812 INT in_src1 = -1;
813 INT in_src2 = -1;
814 in_src1 = FLD (in_src1);
815 in_src2 = FLD (in_src2);
816 referenced |= 1 << 0;
817 referenced |= 1 << 1;
818 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
820 return cycles;
821 #undef FLD
824 static int
825 model_m32r2_cmpui (SIM_CPU *current_cpu, void *sem_arg)
827 #define FLD(f) abuf->fields.sfmt_st_d.f
828 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
829 const IDESC * UNUSED idesc = abuf->idesc;
830 int cycles = 0;
832 int referenced = 0;
833 int UNUSED insn_referenced = abuf->written;
834 INT in_src1 = -1;
835 INT in_src2 = -1;
836 in_src2 = FLD (in_src2);
837 referenced |= 1 << 1;
838 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
840 return cycles;
841 #undef FLD
844 static int
845 model_m32r2_cmpeq (SIM_CPU *current_cpu, void *sem_arg)
847 #define FLD(f) abuf->fields.sfmt_st_plus.f
848 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
849 const IDESC * UNUSED idesc = abuf->idesc;
850 int cycles = 0;
852 int referenced = 0;
853 int UNUSED insn_referenced = abuf->written;
854 INT in_src1 = -1;
855 INT in_src2 = -1;
856 in_src1 = FLD (in_src1);
857 in_src2 = FLD (in_src2);
858 referenced |= 1 << 0;
859 referenced |= 1 << 1;
860 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
862 return cycles;
863 #undef FLD
866 static int
867 model_m32r2_cmpz (SIM_CPU *current_cpu, void *sem_arg)
869 #define FLD(f) abuf->fields.sfmt_st_plus.f
870 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
871 const IDESC * UNUSED idesc = abuf->idesc;
872 int cycles = 0;
874 int referenced = 0;
875 int UNUSED insn_referenced = abuf->written;
876 INT in_src1 = -1;
877 INT in_src2 = -1;
878 in_src2 = FLD (in_src2);
879 referenced |= 1 << 1;
880 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
882 return cycles;
883 #undef FLD
886 static int
887 model_m32r2_div (SIM_CPU *current_cpu, void *sem_arg)
889 #define FLD(f) abuf->fields.sfmt_add.f
890 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
891 const IDESC * UNUSED idesc = abuf->idesc;
892 int cycles = 0;
894 int referenced = 0;
895 int UNUSED insn_referenced = abuf->written;
896 INT in_sr = -1;
897 INT in_dr = -1;
898 INT out_dr = -1;
899 in_sr = FLD (in_sr);
900 in_dr = FLD (in_dr);
901 out_dr = FLD (out_dr);
902 referenced |= 1 << 0;
903 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
904 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
905 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
907 return cycles;
908 #undef FLD
911 static int
912 model_m32r2_divu (SIM_CPU *current_cpu, void *sem_arg)
914 #define FLD(f) abuf->fields.sfmt_add.f
915 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
916 const IDESC * UNUSED idesc = abuf->idesc;
917 int cycles = 0;
919 int referenced = 0;
920 int UNUSED insn_referenced = abuf->written;
921 INT in_sr = -1;
922 INT in_dr = -1;
923 INT out_dr = -1;
924 in_sr = FLD (in_sr);
925 in_dr = FLD (in_dr);
926 out_dr = FLD (out_dr);
927 referenced |= 1 << 0;
928 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
929 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
930 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
932 return cycles;
933 #undef FLD
936 static int
937 model_m32r2_rem (SIM_CPU *current_cpu, void *sem_arg)
939 #define FLD(f) abuf->fields.sfmt_add.f
940 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
941 const IDESC * UNUSED idesc = abuf->idesc;
942 int cycles = 0;
944 int referenced = 0;
945 int UNUSED insn_referenced = abuf->written;
946 INT in_sr = -1;
947 INT in_dr = -1;
948 INT out_dr = -1;
949 in_sr = FLD (in_sr);
950 in_dr = FLD (in_dr);
951 out_dr = FLD (out_dr);
952 referenced |= 1 << 0;
953 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
954 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
955 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
957 return cycles;
958 #undef FLD
961 static int
962 model_m32r2_remu (SIM_CPU *current_cpu, void *sem_arg)
964 #define FLD(f) abuf->fields.sfmt_add.f
965 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
966 const IDESC * UNUSED idesc = abuf->idesc;
967 int cycles = 0;
969 int referenced = 0;
970 int UNUSED insn_referenced = abuf->written;
971 INT in_sr = -1;
972 INT in_dr = -1;
973 INT out_dr = -1;
974 in_sr = FLD (in_sr);
975 in_dr = FLD (in_dr);
976 out_dr = FLD (out_dr);
977 referenced |= 1 << 0;
978 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
979 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
980 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
982 return cycles;
983 #undef FLD
986 static int
987 model_m32r2_remh (SIM_CPU *current_cpu, void *sem_arg)
989 #define FLD(f) abuf->fields.sfmt_add.f
990 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
991 const IDESC * UNUSED idesc = abuf->idesc;
992 int cycles = 0;
994 int referenced = 0;
995 int UNUSED insn_referenced = abuf->written;
996 INT in_sr = -1;
997 INT in_dr = -1;
998 INT out_dr = -1;
999 in_sr = FLD (in_sr);
1000 in_dr = FLD (in_dr);
1001 out_dr = FLD (out_dr);
1002 referenced |= 1 << 0;
1003 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1004 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1005 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1007 return cycles;
1008 #undef FLD
1011 static int
1012 model_m32r2_remuh (SIM_CPU *current_cpu, void *sem_arg)
1014 #define FLD(f) abuf->fields.sfmt_add.f
1015 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1016 const IDESC * UNUSED idesc = abuf->idesc;
1017 int cycles = 0;
1019 int referenced = 0;
1020 int UNUSED insn_referenced = abuf->written;
1021 INT in_sr = -1;
1022 INT in_dr = -1;
1023 INT out_dr = -1;
1024 in_sr = FLD (in_sr);
1025 in_dr = FLD (in_dr);
1026 out_dr = FLD (out_dr);
1027 referenced |= 1 << 0;
1028 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1029 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1030 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1032 return cycles;
1033 #undef FLD
1036 static int
1037 model_m32r2_remb (SIM_CPU *current_cpu, void *sem_arg)
1039 #define FLD(f) abuf->fields.sfmt_add.f
1040 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1041 const IDESC * UNUSED idesc = abuf->idesc;
1042 int cycles = 0;
1044 int referenced = 0;
1045 int UNUSED insn_referenced = abuf->written;
1046 INT in_sr = -1;
1047 INT in_dr = -1;
1048 INT out_dr = -1;
1049 in_sr = FLD (in_sr);
1050 in_dr = FLD (in_dr);
1051 out_dr = FLD (out_dr);
1052 referenced |= 1 << 0;
1053 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1054 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1055 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1057 return cycles;
1058 #undef FLD
1061 static int
1062 model_m32r2_remub (SIM_CPU *current_cpu, void *sem_arg)
1064 #define FLD(f) abuf->fields.sfmt_add.f
1065 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1066 const IDESC * UNUSED idesc = abuf->idesc;
1067 int cycles = 0;
1069 int referenced = 0;
1070 int UNUSED insn_referenced = abuf->written;
1071 INT in_sr = -1;
1072 INT in_dr = -1;
1073 INT out_dr = -1;
1074 in_sr = FLD (in_sr);
1075 in_dr = FLD (in_dr);
1076 out_dr = FLD (out_dr);
1077 referenced |= 1 << 0;
1078 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1079 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1080 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1082 return cycles;
1083 #undef FLD
1086 static int
1087 model_m32r2_divuh (SIM_CPU *current_cpu, void *sem_arg)
1089 #define FLD(f) abuf->fields.sfmt_add.f
1090 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1091 const IDESC * UNUSED idesc = abuf->idesc;
1092 int cycles = 0;
1094 int referenced = 0;
1095 int UNUSED insn_referenced = abuf->written;
1096 INT in_sr = -1;
1097 INT in_dr = -1;
1098 INT out_dr = -1;
1099 in_sr = FLD (in_sr);
1100 in_dr = FLD (in_dr);
1101 out_dr = FLD (out_dr);
1102 referenced |= 1 << 0;
1103 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1104 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1105 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1107 return cycles;
1108 #undef FLD
1111 static int
1112 model_m32r2_divb (SIM_CPU *current_cpu, void *sem_arg)
1114 #define FLD(f) abuf->fields.sfmt_add.f
1115 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1116 const IDESC * UNUSED idesc = abuf->idesc;
1117 int cycles = 0;
1119 int referenced = 0;
1120 int UNUSED insn_referenced = abuf->written;
1121 INT in_sr = -1;
1122 INT in_dr = -1;
1123 INT out_dr = -1;
1124 in_sr = FLD (in_sr);
1125 in_dr = FLD (in_dr);
1126 out_dr = FLD (out_dr);
1127 referenced |= 1 << 0;
1128 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1129 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1130 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1132 return cycles;
1133 #undef FLD
1136 static int
1137 model_m32r2_divub (SIM_CPU *current_cpu, void *sem_arg)
1139 #define FLD(f) abuf->fields.sfmt_add.f
1140 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1141 const IDESC * UNUSED idesc = abuf->idesc;
1142 int cycles = 0;
1144 int referenced = 0;
1145 int UNUSED insn_referenced = abuf->written;
1146 INT in_sr = -1;
1147 INT in_dr = -1;
1148 INT out_dr = -1;
1149 in_sr = FLD (in_sr);
1150 in_dr = FLD (in_dr);
1151 out_dr = FLD (out_dr);
1152 referenced |= 1 << 0;
1153 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1154 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1155 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1157 return cycles;
1158 #undef FLD
1161 static int
1162 model_m32r2_divh (SIM_CPU *current_cpu, void *sem_arg)
1164 #define FLD(f) abuf->fields.sfmt_add.f
1165 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1166 const IDESC * UNUSED idesc = abuf->idesc;
1167 int cycles = 0;
1169 int referenced = 0;
1170 int UNUSED insn_referenced = abuf->written;
1171 INT in_sr = -1;
1172 INT in_dr = -1;
1173 INT out_dr = -1;
1174 in_sr = FLD (in_sr);
1175 in_dr = FLD (in_dr);
1176 out_dr = FLD (out_dr);
1177 referenced |= 1 << 0;
1178 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1179 if (insn_referenced & (1 << 2)) referenced |= 1 << 2;
1180 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1182 return cycles;
1183 #undef FLD
1186 static int
1187 model_m32r2_jc (SIM_CPU *current_cpu, void *sem_arg)
1189 #define FLD(f) abuf->fields.sfmt_jl.f
1190 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1191 const IDESC * UNUSED idesc = abuf->idesc;
1192 int cycles = 0;
1194 int referenced = 0;
1195 int UNUSED insn_referenced = abuf->written;
1196 INT in_sr = -1;
1197 in_sr = FLD (in_sr);
1198 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1199 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
1200 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
1202 return cycles;
1203 #undef FLD
1206 static int
1207 model_m32r2_jnc (SIM_CPU *current_cpu, void *sem_arg)
1209 #define FLD(f) abuf->fields.sfmt_jl.f
1210 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1211 const IDESC * UNUSED idesc = abuf->idesc;
1212 int cycles = 0;
1214 int referenced = 0;
1215 int UNUSED insn_referenced = abuf->written;
1216 INT in_sr = -1;
1217 in_sr = FLD (in_sr);
1218 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1219 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
1220 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
1222 return cycles;
1223 #undef FLD
1226 static int
1227 model_m32r2_jl (SIM_CPU *current_cpu, void *sem_arg)
1229 #define FLD(f) abuf->fields.sfmt_jl.f
1230 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1231 const IDESC * UNUSED idesc = abuf->idesc;
1232 int cycles = 0;
1234 int referenced = 0;
1235 int UNUSED insn_referenced = abuf->written;
1236 INT in_sr = -1;
1237 in_sr = FLD (in_sr);
1238 referenced |= 1 << 0;
1239 referenced |= 1 << 1;
1240 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
1242 return cycles;
1243 #undef FLD
1246 static int
1247 model_m32r2_jmp (SIM_CPU *current_cpu, void *sem_arg)
1249 #define FLD(f) abuf->fields.sfmt_jl.f
1250 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1251 const IDESC * UNUSED idesc = abuf->idesc;
1252 int cycles = 0;
1254 int referenced = 0;
1255 int UNUSED insn_referenced = abuf->written;
1256 INT in_sr = -1;
1257 in_sr = FLD (in_sr);
1258 referenced |= 1 << 0;
1259 referenced |= 1 << 1;
1260 cycles += m32r2f_model_m32r2_u_cti (current_cpu, idesc, 0, referenced, in_sr);
1262 return cycles;
1263 #undef FLD
1266 static int
1267 model_m32r2_ld (SIM_CPU *current_cpu, void *sem_arg)
1269 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1270 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1271 const IDESC * UNUSED idesc = abuf->idesc;
1272 int cycles = 0;
1274 int referenced = 0;
1275 int UNUSED insn_referenced = abuf->written;
1276 INT in_sr = 0;
1277 INT out_dr = 0;
1278 in_sr = FLD (in_sr);
1279 out_dr = FLD (out_dr);
1280 referenced |= 1 << 0;
1281 referenced |= 1 << 1;
1282 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1284 return cycles;
1285 #undef FLD
1288 static int
1289 model_m32r2_ld_d (SIM_CPU *current_cpu, void *sem_arg)
1291 #define FLD(f) abuf->fields.sfmt_add3.f
1292 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1293 const IDESC * UNUSED idesc = abuf->idesc;
1294 int cycles = 0;
1296 int referenced = 0;
1297 int UNUSED insn_referenced = abuf->written;
1298 INT in_sr = 0;
1299 INT out_dr = 0;
1300 in_sr = FLD (in_sr);
1301 out_dr = FLD (out_dr);
1302 referenced |= 1 << 0;
1303 referenced |= 1 << 1;
1304 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1306 return cycles;
1307 #undef FLD
1310 static int
1311 model_m32r2_ldb (SIM_CPU *current_cpu, void *sem_arg)
1313 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1314 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1315 const IDESC * UNUSED idesc = abuf->idesc;
1316 int cycles = 0;
1318 int referenced = 0;
1319 int UNUSED insn_referenced = abuf->written;
1320 INT in_sr = 0;
1321 INT out_dr = 0;
1322 in_sr = FLD (in_sr);
1323 out_dr = FLD (out_dr);
1324 referenced |= 1 << 0;
1325 referenced |= 1 << 1;
1326 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1328 return cycles;
1329 #undef FLD
1332 static int
1333 model_m32r2_ldb_d (SIM_CPU *current_cpu, void *sem_arg)
1335 #define FLD(f) abuf->fields.sfmt_add3.f
1336 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1337 const IDESC * UNUSED idesc = abuf->idesc;
1338 int cycles = 0;
1340 int referenced = 0;
1341 int UNUSED insn_referenced = abuf->written;
1342 INT in_sr = 0;
1343 INT out_dr = 0;
1344 in_sr = FLD (in_sr);
1345 out_dr = FLD (out_dr);
1346 referenced |= 1 << 0;
1347 referenced |= 1 << 1;
1348 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1350 return cycles;
1351 #undef FLD
1354 static int
1355 model_m32r2_ldh (SIM_CPU *current_cpu, void *sem_arg)
1357 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1358 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1359 const IDESC * UNUSED idesc = abuf->idesc;
1360 int cycles = 0;
1362 int referenced = 0;
1363 int UNUSED insn_referenced = abuf->written;
1364 INT in_sr = 0;
1365 INT out_dr = 0;
1366 in_sr = FLD (in_sr);
1367 out_dr = FLD (out_dr);
1368 referenced |= 1 << 0;
1369 referenced |= 1 << 1;
1370 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1372 return cycles;
1373 #undef FLD
1376 static int
1377 model_m32r2_ldh_d (SIM_CPU *current_cpu, void *sem_arg)
1379 #define FLD(f) abuf->fields.sfmt_add3.f
1380 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1381 const IDESC * UNUSED idesc = abuf->idesc;
1382 int cycles = 0;
1384 int referenced = 0;
1385 int UNUSED insn_referenced = abuf->written;
1386 INT in_sr = 0;
1387 INT out_dr = 0;
1388 in_sr = FLD (in_sr);
1389 out_dr = FLD (out_dr);
1390 referenced |= 1 << 0;
1391 referenced |= 1 << 1;
1392 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1394 return cycles;
1395 #undef FLD
1398 static int
1399 model_m32r2_ldub (SIM_CPU *current_cpu, void *sem_arg)
1401 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1402 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1403 const IDESC * UNUSED idesc = abuf->idesc;
1404 int cycles = 0;
1406 int referenced = 0;
1407 int UNUSED insn_referenced = abuf->written;
1408 INT in_sr = 0;
1409 INT out_dr = 0;
1410 in_sr = FLD (in_sr);
1411 out_dr = FLD (out_dr);
1412 referenced |= 1 << 0;
1413 referenced |= 1 << 1;
1414 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1416 return cycles;
1417 #undef FLD
1420 static int
1421 model_m32r2_ldub_d (SIM_CPU *current_cpu, void *sem_arg)
1423 #define FLD(f) abuf->fields.sfmt_add3.f
1424 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1425 const IDESC * UNUSED idesc = abuf->idesc;
1426 int cycles = 0;
1428 int referenced = 0;
1429 int UNUSED insn_referenced = abuf->written;
1430 INT in_sr = 0;
1431 INT out_dr = 0;
1432 in_sr = FLD (in_sr);
1433 out_dr = FLD (out_dr);
1434 referenced |= 1 << 0;
1435 referenced |= 1 << 1;
1436 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1438 return cycles;
1439 #undef FLD
1442 static int
1443 model_m32r2_lduh (SIM_CPU *current_cpu, void *sem_arg)
1445 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1446 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1447 const IDESC * UNUSED idesc = abuf->idesc;
1448 int cycles = 0;
1450 int referenced = 0;
1451 int UNUSED insn_referenced = abuf->written;
1452 INT in_sr = 0;
1453 INT out_dr = 0;
1454 in_sr = FLD (in_sr);
1455 out_dr = FLD (out_dr);
1456 referenced |= 1 << 0;
1457 referenced |= 1 << 1;
1458 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1460 return cycles;
1461 #undef FLD
1464 static int
1465 model_m32r2_lduh_d (SIM_CPU *current_cpu, void *sem_arg)
1467 #define FLD(f) abuf->fields.sfmt_add3.f
1468 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1469 const IDESC * UNUSED idesc = abuf->idesc;
1470 int cycles = 0;
1472 int referenced = 0;
1473 int UNUSED insn_referenced = abuf->written;
1474 INT in_sr = 0;
1475 INT out_dr = 0;
1476 in_sr = FLD (in_sr);
1477 out_dr = FLD (out_dr);
1478 referenced |= 1 << 0;
1479 referenced |= 1 << 1;
1480 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1482 return cycles;
1483 #undef FLD
1486 static int
1487 model_m32r2_ld_plus (SIM_CPU *current_cpu, void *sem_arg)
1489 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1490 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1491 const IDESC * UNUSED idesc = abuf->idesc;
1492 int cycles = 0;
1494 int referenced = 0;
1495 int UNUSED insn_referenced = abuf->written;
1496 INT in_sr = 0;
1497 INT out_dr = 0;
1498 in_sr = FLD (in_sr);
1499 out_dr = FLD (out_dr);
1500 referenced |= 1 << 0;
1501 referenced |= 1 << 1;
1502 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1505 int referenced = 0;
1506 int UNUSED insn_referenced = abuf->written;
1507 INT in_sr = -1;
1508 INT in_dr = -1;
1509 INT out_dr = -1;
1510 in_dr = FLD (in_sr);
1511 out_dr = FLD (out_sr);
1512 referenced |= 1 << 0;
1513 referenced |= 1 << 2;
1514 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
1516 return cycles;
1517 #undef FLD
1520 static int
1521 model_m32r2_ld24 (SIM_CPU *current_cpu, void *sem_arg)
1523 #define FLD(f) abuf->fields.sfmt_ld24.f
1524 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1525 const IDESC * UNUSED idesc = abuf->idesc;
1526 int cycles = 0;
1528 int referenced = 0;
1529 int UNUSED insn_referenced = abuf->written;
1530 INT in_sr = -1;
1531 INT in_dr = -1;
1532 INT out_dr = -1;
1533 out_dr = FLD (out_dr);
1534 referenced |= 1 << 2;
1535 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1537 return cycles;
1538 #undef FLD
1541 static int
1542 model_m32r2_ldi8 (SIM_CPU *current_cpu, void *sem_arg)
1544 #define FLD(f) abuf->fields.sfmt_addi.f
1545 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1546 const IDESC * UNUSED idesc = abuf->idesc;
1547 int cycles = 0;
1549 int referenced = 0;
1550 int UNUSED insn_referenced = abuf->written;
1551 INT in_sr = -1;
1552 INT in_dr = -1;
1553 INT out_dr = -1;
1554 out_dr = FLD (out_dr);
1555 referenced |= 1 << 2;
1556 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1558 return cycles;
1559 #undef FLD
1562 static int
1563 model_m32r2_ldi16 (SIM_CPU *current_cpu, void *sem_arg)
1565 #define FLD(f) abuf->fields.sfmt_add3.f
1566 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1567 const IDESC * UNUSED idesc = abuf->idesc;
1568 int cycles = 0;
1570 int referenced = 0;
1571 int UNUSED insn_referenced = abuf->written;
1572 INT in_sr = -1;
1573 INT in_dr = -1;
1574 INT out_dr = -1;
1575 out_dr = FLD (out_dr);
1576 referenced |= 1 << 2;
1577 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1579 return cycles;
1580 #undef FLD
1583 static int
1584 model_m32r2_lock (SIM_CPU *current_cpu, void *sem_arg)
1586 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1587 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1588 const IDESC * UNUSED idesc = abuf->idesc;
1589 int cycles = 0;
1591 int referenced = 0;
1592 int UNUSED insn_referenced = abuf->written;
1593 INT in_sr = 0;
1594 INT out_dr = 0;
1595 in_sr = FLD (in_sr);
1596 out_dr = FLD (out_dr);
1597 referenced |= 1 << 0;
1598 referenced |= 1 << 1;
1599 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
1601 return cycles;
1602 #undef FLD
1605 static int
1606 model_m32r2_machi_a (SIM_CPU *current_cpu, void *sem_arg)
1608 #define FLD(f) abuf->fields.sfmt_machi_a.f
1609 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1610 const IDESC * UNUSED idesc = abuf->idesc;
1611 int cycles = 0;
1613 int referenced = 0;
1614 int UNUSED insn_referenced = abuf->written;
1615 INT in_src1 = -1;
1616 INT in_src2 = -1;
1617 in_src1 = FLD (in_src1);
1618 in_src2 = FLD (in_src2);
1619 referenced |= 1 << 0;
1620 referenced |= 1 << 1;
1621 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1623 return cycles;
1624 #undef FLD
1627 static int
1628 model_m32r2_maclo_a (SIM_CPU *current_cpu, void *sem_arg)
1630 #define FLD(f) abuf->fields.sfmt_machi_a.f
1631 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1632 const IDESC * UNUSED idesc = abuf->idesc;
1633 int cycles = 0;
1635 int referenced = 0;
1636 int UNUSED insn_referenced = abuf->written;
1637 INT in_src1 = -1;
1638 INT in_src2 = -1;
1639 in_src1 = FLD (in_src1);
1640 in_src2 = FLD (in_src2);
1641 referenced |= 1 << 0;
1642 referenced |= 1 << 1;
1643 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1645 return cycles;
1646 #undef FLD
1649 static int
1650 model_m32r2_macwhi_a (SIM_CPU *current_cpu, void *sem_arg)
1652 #define FLD(f) abuf->fields.sfmt_machi_a.f
1653 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1654 const IDESC * UNUSED idesc = abuf->idesc;
1655 int cycles = 0;
1657 int referenced = 0;
1658 int UNUSED insn_referenced = abuf->written;
1659 INT in_src1 = -1;
1660 INT in_src2 = -1;
1661 in_src1 = FLD (in_src1);
1662 in_src2 = FLD (in_src2);
1663 referenced |= 1 << 0;
1664 referenced |= 1 << 1;
1665 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1667 return cycles;
1668 #undef FLD
1671 static int
1672 model_m32r2_macwlo_a (SIM_CPU *current_cpu, void *sem_arg)
1674 #define FLD(f) abuf->fields.sfmt_machi_a.f
1675 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1676 const IDESC * UNUSED idesc = abuf->idesc;
1677 int cycles = 0;
1679 int referenced = 0;
1680 int UNUSED insn_referenced = abuf->written;
1681 INT in_src1 = -1;
1682 INT in_src2 = -1;
1683 in_src1 = FLD (in_src1);
1684 in_src2 = FLD (in_src2);
1685 referenced |= 1 << 0;
1686 referenced |= 1 << 1;
1687 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1689 return cycles;
1690 #undef FLD
1693 static int
1694 model_m32r2_mul (SIM_CPU *current_cpu, void *sem_arg)
1696 #define FLD(f) abuf->fields.sfmt_add.f
1697 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1698 const IDESC * UNUSED idesc = abuf->idesc;
1699 int cycles = 0;
1701 int referenced = 0;
1702 int UNUSED insn_referenced = abuf->written;
1703 INT in_sr = -1;
1704 INT in_dr = -1;
1705 INT out_dr = -1;
1706 in_sr = FLD (in_sr);
1707 in_dr = FLD (in_dr);
1708 out_dr = FLD (out_dr);
1709 referenced |= 1 << 0;
1710 referenced |= 1 << 1;
1711 referenced |= 1 << 2;
1712 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1714 return cycles;
1715 #undef FLD
1718 static int
1719 model_m32r2_mulhi_a (SIM_CPU *current_cpu, void *sem_arg)
1721 #define FLD(f) abuf->fields.sfmt_machi_a.f
1722 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1723 const IDESC * UNUSED idesc = abuf->idesc;
1724 int cycles = 0;
1726 int referenced = 0;
1727 int UNUSED insn_referenced = abuf->written;
1728 INT in_src1 = -1;
1729 INT in_src2 = -1;
1730 in_src1 = FLD (in_src1);
1731 in_src2 = FLD (in_src2);
1732 referenced |= 1 << 0;
1733 referenced |= 1 << 1;
1734 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1736 return cycles;
1737 #undef FLD
1740 static int
1741 model_m32r2_mullo_a (SIM_CPU *current_cpu, void *sem_arg)
1743 #define FLD(f) abuf->fields.sfmt_machi_a.f
1744 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1745 const IDESC * UNUSED idesc = abuf->idesc;
1746 int cycles = 0;
1748 int referenced = 0;
1749 int UNUSED insn_referenced = abuf->written;
1750 INT in_src1 = -1;
1751 INT in_src2 = -1;
1752 in_src1 = FLD (in_src1);
1753 in_src2 = FLD (in_src2);
1754 referenced |= 1 << 0;
1755 referenced |= 1 << 1;
1756 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1758 return cycles;
1759 #undef FLD
1762 static int
1763 model_m32r2_mulwhi_a (SIM_CPU *current_cpu, void *sem_arg)
1765 #define FLD(f) abuf->fields.sfmt_machi_a.f
1766 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1767 const IDESC * UNUSED idesc = abuf->idesc;
1768 int cycles = 0;
1770 int referenced = 0;
1771 int UNUSED insn_referenced = abuf->written;
1772 INT in_src1 = -1;
1773 INT in_src2 = -1;
1774 in_src1 = FLD (in_src1);
1775 in_src2 = FLD (in_src2);
1776 referenced |= 1 << 0;
1777 referenced |= 1 << 1;
1778 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1780 return cycles;
1781 #undef FLD
1784 static int
1785 model_m32r2_mulwlo_a (SIM_CPU *current_cpu, void *sem_arg)
1787 #define FLD(f) abuf->fields.sfmt_machi_a.f
1788 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1789 const IDESC * UNUSED idesc = abuf->idesc;
1790 int cycles = 0;
1792 int referenced = 0;
1793 int UNUSED insn_referenced = abuf->written;
1794 INT in_src1 = -1;
1795 INT in_src2 = -1;
1796 in_src1 = FLD (in_src1);
1797 in_src2 = FLD (in_src2);
1798 referenced |= 1 << 0;
1799 referenced |= 1 << 1;
1800 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
1802 return cycles;
1803 #undef FLD
1806 static int
1807 model_m32r2_mv (SIM_CPU *current_cpu, void *sem_arg)
1809 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1810 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1811 const IDESC * UNUSED idesc = abuf->idesc;
1812 int cycles = 0;
1814 int referenced = 0;
1815 int UNUSED insn_referenced = abuf->written;
1816 INT in_sr = -1;
1817 INT in_dr = -1;
1818 INT out_dr = -1;
1819 in_sr = FLD (in_sr);
1820 out_dr = FLD (out_dr);
1821 referenced |= 1 << 0;
1822 referenced |= 1 << 2;
1823 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1825 return cycles;
1826 #undef FLD
1829 static int
1830 model_m32r2_mvfachi_a (SIM_CPU *current_cpu, void *sem_arg)
1832 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
1833 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1834 const IDESC * UNUSED idesc = abuf->idesc;
1835 int cycles = 0;
1837 int referenced = 0;
1838 int UNUSED insn_referenced = abuf->written;
1839 INT in_sr = -1;
1840 INT in_dr = -1;
1841 INT out_dr = -1;
1842 out_dr = FLD (out_dr);
1843 referenced |= 1 << 2;
1844 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1846 return cycles;
1847 #undef FLD
1850 static int
1851 model_m32r2_mvfaclo_a (SIM_CPU *current_cpu, void *sem_arg)
1853 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
1854 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1855 const IDESC * UNUSED idesc = abuf->idesc;
1856 int cycles = 0;
1858 int referenced = 0;
1859 int UNUSED insn_referenced = abuf->written;
1860 INT in_sr = -1;
1861 INT in_dr = -1;
1862 INT out_dr = -1;
1863 out_dr = FLD (out_dr);
1864 referenced |= 1 << 2;
1865 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1867 return cycles;
1868 #undef FLD
1871 static int
1872 model_m32r2_mvfacmi_a (SIM_CPU *current_cpu, void *sem_arg)
1874 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
1875 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1876 const IDESC * UNUSED idesc = abuf->idesc;
1877 int cycles = 0;
1879 int referenced = 0;
1880 int UNUSED insn_referenced = abuf->written;
1881 INT in_sr = -1;
1882 INT in_dr = -1;
1883 INT out_dr = -1;
1884 out_dr = FLD (out_dr);
1885 referenced |= 1 << 2;
1886 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1888 return cycles;
1889 #undef FLD
1892 static int
1893 model_m32r2_mvfc (SIM_CPU *current_cpu, void *sem_arg)
1895 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1896 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1897 const IDESC * UNUSED idesc = abuf->idesc;
1898 int cycles = 0;
1900 int referenced = 0;
1901 int UNUSED insn_referenced = abuf->written;
1902 INT in_sr = -1;
1903 INT in_dr = -1;
1904 INT out_dr = -1;
1905 out_dr = FLD (out_dr);
1906 referenced |= 1 << 2;
1907 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1909 return cycles;
1910 #undef FLD
1913 static int
1914 model_m32r2_mvtachi_a (SIM_CPU *current_cpu, void *sem_arg)
1916 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
1917 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1918 const IDESC * UNUSED idesc = abuf->idesc;
1919 int cycles = 0;
1921 int referenced = 0;
1922 int UNUSED insn_referenced = abuf->written;
1923 INT in_sr = -1;
1924 INT in_dr = -1;
1925 INT out_dr = -1;
1926 in_sr = FLD (in_src1);
1927 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1929 return cycles;
1930 #undef FLD
1933 static int
1934 model_m32r2_mvtaclo_a (SIM_CPU *current_cpu, void *sem_arg)
1936 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
1937 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1938 const IDESC * UNUSED idesc = abuf->idesc;
1939 int cycles = 0;
1941 int referenced = 0;
1942 int UNUSED insn_referenced = abuf->written;
1943 INT in_sr = -1;
1944 INT in_dr = -1;
1945 INT out_dr = -1;
1946 in_sr = FLD (in_src1);
1947 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1949 return cycles;
1950 #undef FLD
1953 static int
1954 model_m32r2_mvtc (SIM_CPU *current_cpu, void *sem_arg)
1956 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1957 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1958 const IDESC * UNUSED idesc = abuf->idesc;
1959 int cycles = 0;
1961 int referenced = 0;
1962 int UNUSED insn_referenced = abuf->written;
1963 INT in_sr = -1;
1964 INT in_dr = -1;
1965 INT out_dr = -1;
1966 in_sr = FLD (in_sr);
1967 referenced |= 1 << 0;
1968 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1970 return cycles;
1971 #undef FLD
1974 static int
1975 model_m32r2_neg (SIM_CPU *current_cpu, void *sem_arg)
1977 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1978 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1979 const IDESC * UNUSED idesc = abuf->idesc;
1980 int cycles = 0;
1982 int referenced = 0;
1983 int UNUSED insn_referenced = abuf->written;
1984 INT in_sr = -1;
1985 INT in_dr = -1;
1986 INT out_dr = -1;
1987 in_sr = FLD (in_sr);
1988 out_dr = FLD (out_dr);
1989 referenced |= 1 << 0;
1990 referenced |= 1 << 2;
1991 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
1993 return cycles;
1994 #undef FLD
1997 static int
1998 model_m32r2_nop (SIM_CPU *current_cpu, void *sem_arg)
2000 #define FLD(f) abuf->fields.fmt_empty.f
2001 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2002 const IDESC * UNUSED idesc = abuf->idesc;
2003 int cycles = 0;
2005 int referenced = 0;
2006 int UNUSED insn_referenced = abuf->written;
2007 INT in_sr = -1;
2008 INT in_dr = -1;
2009 INT out_dr = -1;
2010 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2012 return cycles;
2013 #undef FLD
2016 static int
2017 model_m32r2_not (SIM_CPU *current_cpu, void *sem_arg)
2019 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2020 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2021 const IDESC * UNUSED idesc = abuf->idesc;
2022 int cycles = 0;
2024 int referenced = 0;
2025 int UNUSED insn_referenced = abuf->written;
2026 INT in_sr = -1;
2027 INT in_dr = -1;
2028 INT out_dr = -1;
2029 in_sr = FLD (in_sr);
2030 out_dr = FLD (out_dr);
2031 referenced |= 1 << 0;
2032 referenced |= 1 << 2;
2033 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2035 return cycles;
2036 #undef FLD
2039 static int
2040 model_m32r2_rac_dsi (SIM_CPU *current_cpu, void *sem_arg)
2042 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2043 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2044 const IDESC * UNUSED idesc = abuf->idesc;
2045 int cycles = 0;
2047 int referenced = 0;
2048 int UNUSED insn_referenced = abuf->written;
2049 INT in_src1 = -1;
2050 INT in_src2 = -1;
2051 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2053 return cycles;
2054 #undef FLD
2057 static int
2058 model_m32r2_rach_dsi (SIM_CPU *current_cpu, void *sem_arg)
2060 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2061 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2062 const IDESC * UNUSED idesc = abuf->idesc;
2063 int cycles = 0;
2065 int referenced = 0;
2066 int UNUSED insn_referenced = abuf->written;
2067 INT in_src1 = -1;
2068 INT in_src2 = -1;
2069 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2071 return cycles;
2072 #undef FLD
2075 static int
2076 model_m32r2_rte (SIM_CPU *current_cpu, void *sem_arg)
2078 #define FLD(f) abuf->fields.fmt_empty.f
2079 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2080 const IDESC * UNUSED idesc = abuf->idesc;
2081 int cycles = 0;
2083 int referenced = 0;
2084 int UNUSED insn_referenced = abuf->written;
2085 INT in_sr = -1;
2086 INT in_dr = -1;
2087 INT out_dr = -1;
2088 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2090 return cycles;
2091 #undef FLD
2094 static int
2095 model_m32r2_seth (SIM_CPU *current_cpu, void *sem_arg)
2097 #define FLD(f) abuf->fields.sfmt_seth.f
2098 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2099 const IDESC * UNUSED idesc = abuf->idesc;
2100 int cycles = 0;
2102 int referenced = 0;
2103 int UNUSED insn_referenced = abuf->written;
2104 INT in_sr = -1;
2105 INT in_dr = -1;
2106 INT out_dr = -1;
2107 out_dr = FLD (out_dr);
2108 referenced |= 1 << 2;
2109 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2111 return cycles;
2112 #undef FLD
2115 static int
2116 model_m32r2_sll (SIM_CPU *current_cpu, void *sem_arg)
2118 #define FLD(f) abuf->fields.sfmt_add.f
2119 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2120 const IDESC * UNUSED idesc = abuf->idesc;
2121 int cycles = 0;
2123 int referenced = 0;
2124 int UNUSED insn_referenced = abuf->written;
2125 INT in_sr = -1;
2126 INT in_dr = -1;
2127 INT out_dr = -1;
2128 in_sr = FLD (in_sr);
2129 in_dr = FLD (in_dr);
2130 out_dr = FLD (out_dr);
2131 referenced |= 1 << 0;
2132 referenced |= 1 << 1;
2133 referenced |= 1 << 2;
2134 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2136 return cycles;
2137 #undef FLD
2140 static int
2141 model_m32r2_sll3 (SIM_CPU *current_cpu, void *sem_arg)
2143 #define FLD(f) abuf->fields.sfmt_add3.f
2144 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2145 const IDESC * UNUSED idesc = abuf->idesc;
2146 int cycles = 0;
2148 int referenced = 0;
2149 int UNUSED insn_referenced = abuf->written;
2150 INT in_sr = -1;
2151 INT in_dr = -1;
2152 INT out_dr = -1;
2153 in_sr = FLD (in_sr);
2154 out_dr = FLD (out_dr);
2155 referenced |= 1 << 0;
2156 referenced |= 1 << 2;
2157 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2159 return cycles;
2160 #undef FLD
2163 static int
2164 model_m32r2_slli (SIM_CPU *current_cpu, void *sem_arg)
2166 #define FLD(f) abuf->fields.sfmt_slli.f
2167 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2168 const IDESC * UNUSED idesc = abuf->idesc;
2169 int cycles = 0;
2171 int referenced = 0;
2172 int UNUSED insn_referenced = abuf->written;
2173 INT in_sr = -1;
2174 INT in_dr = -1;
2175 INT out_dr = -1;
2176 in_dr = FLD (in_dr);
2177 out_dr = FLD (out_dr);
2178 referenced |= 1 << 1;
2179 referenced |= 1 << 2;
2180 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2182 return cycles;
2183 #undef FLD
2186 static int
2187 model_m32r2_sra (SIM_CPU *current_cpu, void *sem_arg)
2189 #define FLD(f) abuf->fields.sfmt_add.f
2190 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2191 const IDESC * UNUSED idesc = abuf->idesc;
2192 int cycles = 0;
2194 int referenced = 0;
2195 int UNUSED insn_referenced = abuf->written;
2196 INT in_sr = -1;
2197 INT in_dr = -1;
2198 INT out_dr = -1;
2199 in_sr = FLD (in_sr);
2200 in_dr = FLD (in_dr);
2201 out_dr = FLD (out_dr);
2202 referenced |= 1 << 0;
2203 referenced |= 1 << 1;
2204 referenced |= 1 << 2;
2205 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2207 return cycles;
2208 #undef FLD
2211 static int
2212 model_m32r2_sra3 (SIM_CPU *current_cpu, void *sem_arg)
2214 #define FLD(f) abuf->fields.sfmt_add3.f
2215 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2216 const IDESC * UNUSED idesc = abuf->idesc;
2217 int cycles = 0;
2219 int referenced = 0;
2220 int UNUSED insn_referenced = abuf->written;
2221 INT in_sr = -1;
2222 INT in_dr = -1;
2223 INT out_dr = -1;
2224 in_sr = FLD (in_sr);
2225 out_dr = FLD (out_dr);
2226 referenced |= 1 << 0;
2227 referenced |= 1 << 2;
2228 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2230 return cycles;
2231 #undef FLD
2234 static int
2235 model_m32r2_srai (SIM_CPU *current_cpu, void *sem_arg)
2237 #define FLD(f) abuf->fields.sfmt_slli.f
2238 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2239 const IDESC * UNUSED idesc = abuf->idesc;
2240 int cycles = 0;
2242 int referenced = 0;
2243 int UNUSED insn_referenced = abuf->written;
2244 INT in_sr = -1;
2245 INT in_dr = -1;
2246 INT out_dr = -1;
2247 in_dr = FLD (in_dr);
2248 out_dr = FLD (out_dr);
2249 referenced |= 1 << 1;
2250 referenced |= 1 << 2;
2251 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2253 return cycles;
2254 #undef FLD
2257 static int
2258 model_m32r2_srl (SIM_CPU *current_cpu, void *sem_arg)
2260 #define FLD(f) abuf->fields.sfmt_add.f
2261 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2262 const IDESC * UNUSED idesc = abuf->idesc;
2263 int cycles = 0;
2265 int referenced = 0;
2266 int UNUSED insn_referenced = abuf->written;
2267 INT in_sr = -1;
2268 INT in_dr = -1;
2269 INT out_dr = -1;
2270 in_sr = FLD (in_sr);
2271 in_dr = FLD (in_dr);
2272 out_dr = FLD (out_dr);
2273 referenced |= 1 << 0;
2274 referenced |= 1 << 1;
2275 referenced |= 1 << 2;
2276 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2278 return cycles;
2279 #undef FLD
2282 static int
2283 model_m32r2_srl3 (SIM_CPU *current_cpu, void *sem_arg)
2285 #define FLD(f) abuf->fields.sfmt_add3.f
2286 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2287 const IDESC * UNUSED idesc = abuf->idesc;
2288 int cycles = 0;
2290 int referenced = 0;
2291 int UNUSED insn_referenced = abuf->written;
2292 INT in_sr = -1;
2293 INT in_dr = -1;
2294 INT out_dr = -1;
2295 in_sr = FLD (in_sr);
2296 out_dr = FLD (out_dr);
2297 referenced |= 1 << 0;
2298 referenced |= 1 << 2;
2299 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2301 return cycles;
2302 #undef FLD
2305 static int
2306 model_m32r2_srli (SIM_CPU *current_cpu, void *sem_arg)
2308 #define FLD(f) abuf->fields.sfmt_slli.f
2309 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2310 const IDESC * UNUSED idesc = abuf->idesc;
2311 int cycles = 0;
2313 int referenced = 0;
2314 int UNUSED insn_referenced = abuf->written;
2315 INT in_sr = -1;
2316 INT in_dr = -1;
2317 INT out_dr = -1;
2318 in_dr = FLD (in_dr);
2319 out_dr = FLD (out_dr);
2320 referenced |= 1 << 1;
2321 referenced |= 1 << 2;
2322 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2324 return cycles;
2325 #undef FLD
2328 static int
2329 model_m32r2_st (SIM_CPU *current_cpu, void *sem_arg)
2331 #define FLD(f) abuf->fields.sfmt_st_plus.f
2332 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2333 const IDESC * UNUSED idesc = abuf->idesc;
2334 int cycles = 0;
2336 int referenced = 0;
2337 int UNUSED insn_referenced = abuf->written;
2338 INT in_src1 = 0;
2339 INT in_src2 = 0;
2340 in_src1 = FLD (in_src1);
2341 in_src2 = FLD (in_src2);
2342 referenced |= 1 << 0;
2343 referenced |= 1 << 1;
2344 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2346 return cycles;
2347 #undef FLD
2350 static int
2351 model_m32r2_st_d (SIM_CPU *current_cpu, void *sem_arg)
2353 #define FLD(f) abuf->fields.sfmt_st_d.f
2354 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2355 const IDESC * UNUSED idesc = abuf->idesc;
2356 int cycles = 0;
2358 int referenced = 0;
2359 int UNUSED insn_referenced = abuf->written;
2360 INT in_src1 = 0;
2361 INT in_src2 = 0;
2362 in_src1 = FLD (in_src1);
2363 in_src2 = FLD (in_src2);
2364 referenced |= 1 << 0;
2365 referenced |= 1 << 1;
2366 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2368 return cycles;
2369 #undef FLD
2372 static int
2373 model_m32r2_stb (SIM_CPU *current_cpu, void *sem_arg)
2375 #define FLD(f) abuf->fields.sfmt_st_plus.f
2376 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2377 const IDESC * UNUSED idesc = abuf->idesc;
2378 int cycles = 0;
2380 int referenced = 0;
2381 int UNUSED insn_referenced = abuf->written;
2382 INT in_src1 = 0;
2383 INT in_src2 = 0;
2384 in_src1 = FLD (in_src1);
2385 in_src2 = FLD (in_src2);
2386 referenced |= 1 << 0;
2387 referenced |= 1 << 1;
2388 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2390 return cycles;
2391 #undef FLD
2394 static int
2395 model_m32r2_stb_d (SIM_CPU *current_cpu, void *sem_arg)
2397 #define FLD(f) abuf->fields.sfmt_st_d.f
2398 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2399 const IDESC * UNUSED idesc = abuf->idesc;
2400 int cycles = 0;
2402 int referenced = 0;
2403 int UNUSED insn_referenced = abuf->written;
2404 INT in_src1 = 0;
2405 INT in_src2 = 0;
2406 in_src1 = FLD (in_src1);
2407 in_src2 = FLD (in_src2);
2408 referenced |= 1 << 0;
2409 referenced |= 1 << 1;
2410 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2412 return cycles;
2413 #undef FLD
2416 static int
2417 model_m32r2_sth (SIM_CPU *current_cpu, void *sem_arg)
2419 #define FLD(f) abuf->fields.sfmt_st_plus.f
2420 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2421 const IDESC * UNUSED idesc = abuf->idesc;
2422 int cycles = 0;
2424 int referenced = 0;
2425 int UNUSED insn_referenced = abuf->written;
2426 INT in_src1 = 0;
2427 INT in_src2 = 0;
2428 in_src1 = FLD (in_src1);
2429 in_src2 = FLD (in_src2);
2430 referenced |= 1 << 0;
2431 referenced |= 1 << 1;
2432 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2434 return cycles;
2435 #undef FLD
2438 static int
2439 model_m32r2_sth_d (SIM_CPU *current_cpu, void *sem_arg)
2441 #define FLD(f) abuf->fields.sfmt_st_d.f
2442 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2443 const IDESC * UNUSED idesc = abuf->idesc;
2444 int cycles = 0;
2446 int referenced = 0;
2447 int UNUSED insn_referenced = abuf->written;
2448 INT in_src1 = 0;
2449 INT in_src2 = 0;
2450 in_src1 = FLD (in_src1);
2451 in_src2 = FLD (in_src2);
2452 referenced |= 1 << 0;
2453 referenced |= 1 << 1;
2454 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2456 return cycles;
2457 #undef FLD
2460 static int
2461 model_m32r2_st_plus (SIM_CPU *current_cpu, void *sem_arg)
2463 #define FLD(f) abuf->fields.sfmt_st_plus.f
2464 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2465 const IDESC * UNUSED idesc = abuf->idesc;
2466 int cycles = 0;
2468 int referenced = 0;
2469 int UNUSED insn_referenced = abuf->written;
2470 INT in_src1 = 0;
2471 INT in_src2 = 0;
2472 in_src1 = FLD (in_src1);
2473 in_src2 = FLD (in_src2);
2474 referenced |= 1 << 0;
2475 referenced |= 1 << 1;
2476 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2479 int referenced = 0;
2480 int UNUSED insn_referenced = abuf->written;
2481 INT in_sr = -1;
2482 INT in_dr = -1;
2483 INT out_dr = -1;
2484 in_dr = FLD (in_src2);
2485 out_dr = FLD (out_src2);
2486 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
2488 return cycles;
2489 #undef FLD
2492 static int
2493 model_m32r2_sth_plus (SIM_CPU *current_cpu, void *sem_arg)
2495 #define FLD(f) abuf->fields.sfmt_st_plus.f
2496 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2497 const IDESC * UNUSED idesc = abuf->idesc;
2498 int cycles = 0;
2500 int referenced = 0;
2501 int UNUSED insn_referenced = abuf->written;
2502 INT in_src1 = 0;
2503 INT in_src2 = 0;
2504 in_src1 = FLD (in_src1);
2505 in_src2 = FLD (in_src2);
2506 referenced |= 1 << 0;
2507 referenced |= 1 << 1;
2508 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2511 int referenced = 0;
2512 int UNUSED insn_referenced = abuf->written;
2513 INT in_sr = -1;
2514 INT in_dr = -1;
2515 INT out_dr = -1;
2516 in_dr = FLD (in_src2);
2517 out_dr = FLD (out_src2);
2518 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
2520 return cycles;
2521 #undef FLD
2524 static int
2525 model_m32r2_stb_plus (SIM_CPU *current_cpu, void *sem_arg)
2527 #define FLD(f) abuf->fields.sfmt_st_plus.f
2528 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2529 const IDESC * UNUSED idesc = abuf->idesc;
2530 int cycles = 0;
2532 int referenced = 0;
2533 int UNUSED insn_referenced = abuf->written;
2534 INT in_src1 = 0;
2535 INT in_src2 = 0;
2536 in_src1 = FLD (in_src1);
2537 in_src2 = FLD (in_src2);
2538 referenced |= 1 << 0;
2539 referenced |= 1 << 1;
2540 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2543 int referenced = 0;
2544 int UNUSED insn_referenced = abuf->written;
2545 INT in_sr = -1;
2546 INT in_dr = -1;
2547 INT out_dr = -1;
2548 in_dr = FLD (in_src2);
2549 out_dr = FLD (out_src2);
2550 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
2552 return cycles;
2553 #undef FLD
2556 static int
2557 model_m32r2_st_minus (SIM_CPU *current_cpu, void *sem_arg)
2559 #define FLD(f) abuf->fields.sfmt_st_plus.f
2560 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2561 const IDESC * UNUSED idesc = abuf->idesc;
2562 int cycles = 0;
2564 int referenced = 0;
2565 int UNUSED insn_referenced = abuf->written;
2566 INT in_src1 = 0;
2567 INT in_src2 = 0;
2568 in_src1 = FLD (in_src1);
2569 in_src2 = FLD (in_src2);
2570 referenced |= 1 << 0;
2571 referenced |= 1 << 1;
2572 cycles += m32r2f_model_m32r2_u_store (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2575 int referenced = 0;
2576 int UNUSED insn_referenced = abuf->written;
2577 INT in_sr = -1;
2578 INT in_dr = -1;
2579 INT out_dr = -1;
2580 in_dr = FLD (in_src2);
2581 out_dr = FLD (out_src2);
2582 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 1, referenced, in_sr, in_dr, out_dr);
2584 return cycles;
2585 #undef FLD
2588 static int
2589 model_m32r2_sub (SIM_CPU *current_cpu, void *sem_arg)
2591 #define FLD(f) abuf->fields.sfmt_add.f
2592 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2593 const IDESC * UNUSED idesc = abuf->idesc;
2594 int cycles = 0;
2596 int referenced = 0;
2597 int UNUSED insn_referenced = abuf->written;
2598 INT in_sr = -1;
2599 INT in_dr = -1;
2600 INT out_dr = -1;
2601 in_sr = FLD (in_sr);
2602 in_dr = FLD (in_dr);
2603 out_dr = FLD (out_dr);
2604 referenced |= 1 << 0;
2605 referenced |= 1 << 1;
2606 referenced |= 1 << 2;
2607 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2609 return cycles;
2610 #undef FLD
2613 static int
2614 model_m32r2_subv (SIM_CPU *current_cpu, void *sem_arg)
2616 #define FLD(f) abuf->fields.sfmt_add.f
2617 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2618 const IDESC * UNUSED idesc = abuf->idesc;
2619 int cycles = 0;
2621 int referenced = 0;
2622 int UNUSED insn_referenced = abuf->written;
2623 INT in_sr = -1;
2624 INT in_dr = -1;
2625 INT out_dr = -1;
2626 in_sr = FLD (in_sr);
2627 in_dr = FLD (in_dr);
2628 out_dr = FLD (out_dr);
2629 referenced |= 1 << 0;
2630 referenced |= 1 << 1;
2631 referenced |= 1 << 2;
2632 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2634 return cycles;
2635 #undef FLD
2638 static int
2639 model_m32r2_subx (SIM_CPU *current_cpu, void *sem_arg)
2641 #define FLD(f) abuf->fields.sfmt_add.f
2642 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2643 const IDESC * UNUSED idesc = abuf->idesc;
2644 int cycles = 0;
2646 int referenced = 0;
2647 int UNUSED insn_referenced = abuf->written;
2648 INT in_sr = -1;
2649 INT in_dr = -1;
2650 INT out_dr = -1;
2651 in_sr = FLD (in_sr);
2652 in_dr = FLD (in_dr);
2653 out_dr = FLD (out_dr);
2654 referenced |= 1 << 0;
2655 referenced |= 1 << 1;
2656 referenced |= 1 << 2;
2657 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2659 return cycles;
2660 #undef FLD
2663 static int
2664 model_m32r2_trap (SIM_CPU *current_cpu, void *sem_arg)
2666 #define FLD(f) abuf->fields.sfmt_trap.f
2667 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2668 const IDESC * UNUSED idesc = abuf->idesc;
2669 int cycles = 0;
2671 int referenced = 0;
2672 int UNUSED insn_referenced = abuf->written;
2673 INT in_sr = -1;
2674 INT in_dr = -1;
2675 INT out_dr = -1;
2676 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2678 return cycles;
2679 #undef FLD
2682 static int
2683 model_m32r2_unlock (SIM_CPU *current_cpu, void *sem_arg)
2685 #define FLD(f) abuf->fields.sfmt_st_plus.f
2686 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2687 const IDESC * UNUSED idesc = abuf->idesc;
2688 int cycles = 0;
2690 int referenced = 0;
2691 int UNUSED insn_referenced = abuf->written;
2692 INT in_sr = 0;
2693 INT out_dr = 0;
2694 cycles += m32r2f_model_m32r2_u_load (current_cpu, idesc, 0, referenced, in_sr, out_dr);
2696 return cycles;
2697 #undef FLD
2700 static int
2701 model_m32r2_satb (SIM_CPU *current_cpu, void *sem_arg)
2703 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2704 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2705 const IDESC * UNUSED idesc = abuf->idesc;
2706 int cycles = 0;
2708 int referenced = 0;
2709 int UNUSED insn_referenced = abuf->written;
2710 INT in_sr = -1;
2711 INT in_dr = -1;
2712 INT out_dr = -1;
2713 in_sr = FLD (in_sr);
2714 out_dr = FLD (out_dr);
2715 referenced |= 1 << 0;
2716 referenced |= 1 << 2;
2717 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2719 return cycles;
2720 #undef FLD
2723 static int
2724 model_m32r2_sath (SIM_CPU *current_cpu, void *sem_arg)
2726 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2727 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2728 const IDESC * UNUSED idesc = abuf->idesc;
2729 int cycles = 0;
2731 int referenced = 0;
2732 int UNUSED insn_referenced = abuf->written;
2733 INT in_sr = -1;
2734 INT in_dr = -1;
2735 INT out_dr = -1;
2736 in_sr = FLD (in_sr);
2737 out_dr = FLD (out_dr);
2738 referenced |= 1 << 0;
2739 referenced |= 1 << 2;
2740 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2742 return cycles;
2743 #undef FLD
2746 static int
2747 model_m32r2_sat (SIM_CPU *current_cpu, void *sem_arg)
2749 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2750 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2751 const IDESC * UNUSED idesc = abuf->idesc;
2752 int cycles = 0;
2754 int referenced = 0;
2755 int UNUSED insn_referenced = abuf->written;
2756 INT in_sr = -1;
2757 INT in_dr = -1;
2758 INT out_dr = -1;
2759 in_sr = FLD (in_sr);
2760 out_dr = FLD (out_dr);
2761 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2762 referenced |= 1 << 2;
2763 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2765 return cycles;
2766 #undef FLD
2769 static int
2770 model_m32r2_pcmpbz (SIM_CPU *current_cpu, void *sem_arg)
2772 #define FLD(f) abuf->fields.sfmt_st_plus.f
2773 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2774 const IDESC * UNUSED idesc = abuf->idesc;
2775 int cycles = 0;
2777 int referenced = 0;
2778 int UNUSED insn_referenced = abuf->written;
2779 INT in_src1 = -1;
2780 INT in_src2 = -1;
2781 in_src2 = FLD (in_src2);
2782 referenced |= 1 << 1;
2783 cycles += m32r2f_model_m32r2_u_cmp (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2785 return cycles;
2786 #undef FLD
2789 static int
2790 model_m32r2_sadd (SIM_CPU *current_cpu, void *sem_arg)
2792 #define FLD(f) abuf->fields.fmt_empty.f
2793 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2794 const IDESC * UNUSED idesc = abuf->idesc;
2795 int cycles = 0;
2797 int referenced = 0;
2798 int UNUSED insn_referenced = abuf->written;
2799 INT in_src1 = -1;
2800 INT in_src2 = -1;
2801 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2803 return cycles;
2804 #undef FLD
2807 static int
2808 model_m32r2_macwu1 (SIM_CPU *current_cpu, void *sem_arg)
2810 #define FLD(f) abuf->fields.sfmt_st_plus.f
2811 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2812 const IDESC * UNUSED idesc = abuf->idesc;
2813 int cycles = 0;
2815 int referenced = 0;
2816 int UNUSED insn_referenced = abuf->written;
2817 INT in_src1 = -1;
2818 INT in_src2 = -1;
2819 in_src1 = FLD (in_src1);
2820 in_src2 = FLD (in_src2);
2821 referenced |= 1 << 0;
2822 referenced |= 1 << 1;
2823 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2825 return cycles;
2826 #undef FLD
2829 static int
2830 model_m32r2_msblo (SIM_CPU *current_cpu, void *sem_arg)
2832 #define FLD(f) abuf->fields.sfmt_st_plus.f
2833 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2834 const IDESC * UNUSED idesc = abuf->idesc;
2835 int cycles = 0;
2837 int referenced = 0;
2838 int UNUSED insn_referenced = abuf->written;
2839 INT in_src1 = -1;
2840 INT in_src2 = -1;
2841 in_src1 = FLD (in_src1);
2842 in_src2 = FLD (in_src2);
2843 referenced |= 1 << 0;
2844 referenced |= 1 << 1;
2845 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2847 return cycles;
2848 #undef FLD
2851 static int
2852 model_m32r2_mulwu1 (SIM_CPU *current_cpu, void *sem_arg)
2854 #define FLD(f) abuf->fields.sfmt_st_plus.f
2855 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2856 const IDESC * UNUSED idesc = abuf->idesc;
2857 int cycles = 0;
2859 int referenced = 0;
2860 int UNUSED insn_referenced = abuf->written;
2861 INT in_src1 = -1;
2862 INT in_src2 = -1;
2863 in_src1 = FLD (in_src1);
2864 in_src2 = FLD (in_src2);
2865 referenced |= 1 << 0;
2866 referenced |= 1 << 1;
2867 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2869 return cycles;
2870 #undef FLD
2873 static int
2874 model_m32r2_maclh1 (SIM_CPU *current_cpu, void *sem_arg)
2876 #define FLD(f) abuf->fields.sfmt_st_plus.f
2877 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2878 const IDESC * UNUSED idesc = abuf->idesc;
2879 int cycles = 0;
2881 int referenced = 0;
2882 int UNUSED insn_referenced = abuf->written;
2883 INT in_src1 = -1;
2884 INT in_src2 = -1;
2885 in_src1 = FLD (in_src1);
2886 in_src2 = FLD (in_src2);
2887 referenced |= 1 << 0;
2888 referenced |= 1 << 1;
2889 cycles += m32r2f_model_m32r2_u_mac (current_cpu, idesc, 0, referenced, in_src1, in_src2);
2891 return cycles;
2892 #undef FLD
2895 static int
2896 model_m32r2_sc (SIM_CPU *current_cpu, void *sem_arg)
2898 #define FLD(f) abuf->fields.fmt_empty.f
2899 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2900 const IDESC * UNUSED idesc = abuf->idesc;
2901 int cycles = 0;
2903 int referenced = 0;
2904 int UNUSED insn_referenced = abuf->written;
2905 INT in_sr = -1;
2906 INT in_dr = -1;
2907 INT out_dr = -1;
2908 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2910 return cycles;
2911 #undef FLD
2914 static int
2915 model_m32r2_snc (SIM_CPU *current_cpu, void *sem_arg)
2917 #define FLD(f) abuf->fields.fmt_empty.f
2918 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2919 const IDESC * UNUSED idesc = abuf->idesc;
2920 int cycles = 0;
2922 int referenced = 0;
2923 int UNUSED insn_referenced = abuf->written;
2924 INT in_sr = -1;
2925 INT in_dr = -1;
2926 INT out_dr = -1;
2927 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2929 return cycles;
2930 #undef FLD
2933 static int
2934 model_m32r2_clrpsw (SIM_CPU *current_cpu, void *sem_arg)
2936 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2937 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2938 const IDESC * UNUSED idesc = abuf->idesc;
2939 int cycles = 0;
2941 int referenced = 0;
2942 int UNUSED insn_referenced = abuf->written;
2943 INT in_sr = -1;
2944 INT in_dr = -1;
2945 INT out_dr = -1;
2946 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2948 return cycles;
2949 #undef FLD
2952 static int
2953 model_m32r2_setpsw (SIM_CPU *current_cpu, void *sem_arg)
2955 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2956 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2957 const IDESC * UNUSED idesc = abuf->idesc;
2958 int cycles = 0;
2960 int referenced = 0;
2961 int UNUSED insn_referenced = abuf->written;
2962 INT in_sr = -1;
2963 INT in_dr = -1;
2964 INT out_dr = -1;
2965 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2967 return cycles;
2968 #undef FLD
2971 static int
2972 model_m32r2_bset (SIM_CPU *current_cpu, void *sem_arg)
2974 #define FLD(f) abuf->fields.sfmt_bset.f
2975 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2976 const IDESC * UNUSED idesc = abuf->idesc;
2977 int cycles = 0;
2979 int referenced = 0;
2980 int UNUSED insn_referenced = abuf->written;
2981 INT in_sr = -1;
2982 INT in_dr = -1;
2983 INT out_dr = -1;
2984 in_sr = FLD (in_sr);
2985 referenced |= 1 << 0;
2986 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
2988 return cycles;
2989 #undef FLD
2992 static int
2993 model_m32r2_bclr (SIM_CPU *current_cpu, void *sem_arg)
2995 #define FLD(f) abuf->fields.sfmt_bset.f
2996 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2997 const IDESC * UNUSED idesc = abuf->idesc;
2998 int cycles = 0;
3000 int referenced = 0;
3001 int UNUSED insn_referenced = abuf->written;
3002 INT in_sr = -1;
3003 INT in_dr = -1;
3004 INT out_dr = -1;
3005 in_sr = FLD (in_sr);
3006 referenced |= 1 << 0;
3007 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
3009 return cycles;
3010 #undef FLD
3013 static int
3014 model_m32r2_btst (SIM_CPU *current_cpu, void *sem_arg)
3016 #define FLD(f) abuf->fields.sfmt_bset.f
3017 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3018 const IDESC * UNUSED idesc = abuf->idesc;
3019 int cycles = 0;
3021 int referenced = 0;
3022 int UNUSED insn_referenced = abuf->written;
3023 INT in_sr = -1;
3024 INT in_dr = -1;
3025 INT out_dr = -1;
3026 in_sr = FLD (in_sr);
3027 referenced |= 1 << 0;
3028 cycles += m32r2f_model_m32r2_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr);
3030 return cycles;
3031 #undef FLD
3034 /* We assume UNIT_NONE == 0 because the tables don't always terminate
3035 entries with it. */
3037 /* Model timing data for `m32r2'. */
3039 static const INSN_TIMING m32r2_timing[] = {
3040 { M32R2F_INSN_X_INVALID, 0, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3041 { M32R2F_INSN_X_AFTER, 0, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3042 { M32R2F_INSN_X_BEFORE, 0, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3043 { M32R2F_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3044 { M32R2F_INSN_X_CHAIN, 0, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3045 { M32R2F_INSN_X_BEGIN, 0, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3046 { M32R2F_INSN_ADD, model_m32r2_add, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3047 { M32R2F_INSN_ADD3, model_m32r2_add3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3048 { M32R2F_INSN_AND, model_m32r2_and, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3049 { M32R2F_INSN_AND3, model_m32r2_and3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3050 { M32R2F_INSN_OR, model_m32r2_or, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3051 { M32R2F_INSN_OR3, model_m32r2_or3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3052 { M32R2F_INSN_XOR, model_m32r2_xor, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3053 { M32R2F_INSN_XOR3, model_m32r2_xor3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3054 { M32R2F_INSN_ADDI, model_m32r2_addi, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3055 { M32R2F_INSN_ADDV, model_m32r2_addv, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3056 { M32R2F_INSN_ADDV3, model_m32r2_addv3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3057 { M32R2F_INSN_ADDX, model_m32r2_addx, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3058 { M32R2F_INSN_BC8, model_m32r2_bc8, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3059 { M32R2F_INSN_BC24, model_m32r2_bc24, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3060 { M32R2F_INSN_BEQ, model_m32r2_beq, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3061 { M32R2F_INSN_BEQZ, model_m32r2_beqz, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3062 { M32R2F_INSN_BGEZ, model_m32r2_bgez, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3063 { M32R2F_INSN_BGTZ, model_m32r2_bgtz, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3064 { M32R2F_INSN_BLEZ, model_m32r2_blez, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3065 { M32R2F_INSN_BLTZ, model_m32r2_bltz, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3066 { M32R2F_INSN_BNEZ, model_m32r2_bnez, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3067 { M32R2F_INSN_BL8, model_m32r2_bl8, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3068 { M32R2F_INSN_BL24, model_m32r2_bl24, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3069 { M32R2F_INSN_BCL8, model_m32r2_bcl8, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3070 { M32R2F_INSN_BCL24, model_m32r2_bcl24, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3071 { M32R2F_INSN_BNC8, model_m32r2_bnc8, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3072 { M32R2F_INSN_BNC24, model_m32r2_bnc24, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3073 { M32R2F_INSN_BNE, model_m32r2_bne, { { (int) UNIT_M32R2_U_CTI, 1, 1 }, { (int) UNIT_M32R2_U_CMP, 1, 0 } } },
3074 { M32R2F_INSN_BRA8, model_m32r2_bra8, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3075 { M32R2F_INSN_BRA24, model_m32r2_bra24, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3076 { M32R2F_INSN_BNCL8, model_m32r2_bncl8, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3077 { M32R2F_INSN_BNCL24, model_m32r2_bncl24, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3078 { M32R2F_INSN_CMP, model_m32r2_cmp, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3079 { M32R2F_INSN_CMPI, model_m32r2_cmpi, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3080 { M32R2F_INSN_CMPU, model_m32r2_cmpu, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3081 { M32R2F_INSN_CMPUI, model_m32r2_cmpui, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3082 { M32R2F_INSN_CMPEQ, model_m32r2_cmpeq, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3083 { M32R2F_INSN_CMPZ, model_m32r2_cmpz, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3084 { M32R2F_INSN_DIV, model_m32r2_div, { { (int) UNIT_M32R2_U_EXEC, 1, 37 } } },
3085 { M32R2F_INSN_DIVU, model_m32r2_divu, { { (int) UNIT_M32R2_U_EXEC, 1, 37 } } },
3086 { M32R2F_INSN_REM, model_m32r2_rem, { { (int) UNIT_M32R2_U_EXEC, 1, 37 } } },
3087 { M32R2F_INSN_REMU, model_m32r2_remu, { { (int) UNIT_M32R2_U_EXEC, 1, 37 } } },
3088 { M32R2F_INSN_REMH, model_m32r2_remh, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3089 { M32R2F_INSN_REMUH, model_m32r2_remuh, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3090 { M32R2F_INSN_REMB, model_m32r2_remb, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3091 { M32R2F_INSN_REMUB, model_m32r2_remub, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3092 { M32R2F_INSN_DIVUH, model_m32r2_divuh, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3093 { M32R2F_INSN_DIVB, model_m32r2_divb, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3094 { M32R2F_INSN_DIVUB, model_m32r2_divub, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3095 { M32R2F_INSN_DIVH, model_m32r2_divh, { { (int) UNIT_M32R2_U_EXEC, 1, 21 } } },
3096 { M32R2F_INSN_JC, model_m32r2_jc, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3097 { M32R2F_INSN_JNC, model_m32r2_jnc, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3098 { M32R2F_INSN_JL, model_m32r2_jl, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3099 { M32R2F_INSN_JMP, model_m32r2_jmp, { { (int) UNIT_M32R2_U_CTI, 1, 1 } } },
3100 { M32R2F_INSN_LD, model_m32r2_ld, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3101 { M32R2F_INSN_LD_D, model_m32r2_ld_d, { { (int) UNIT_M32R2_U_LOAD, 1, 2 } } },
3102 { M32R2F_INSN_LDB, model_m32r2_ldb, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3103 { M32R2F_INSN_LDB_D, model_m32r2_ldb_d, { { (int) UNIT_M32R2_U_LOAD, 1, 2 } } },
3104 { M32R2F_INSN_LDH, model_m32r2_ldh, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3105 { M32R2F_INSN_LDH_D, model_m32r2_ldh_d, { { (int) UNIT_M32R2_U_LOAD, 1, 2 } } },
3106 { M32R2F_INSN_LDUB, model_m32r2_ldub, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3107 { M32R2F_INSN_LDUB_D, model_m32r2_ldub_d, { { (int) UNIT_M32R2_U_LOAD, 1, 2 } } },
3108 { M32R2F_INSN_LDUH, model_m32r2_lduh, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3109 { M32R2F_INSN_LDUH_D, model_m32r2_lduh_d, { { (int) UNIT_M32R2_U_LOAD, 1, 2 } } },
3110 { M32R2F_INSN_LD_PLUS, model_m32r2_ld_plus, { { (int) UNIT_M32R2_U_LOAD, 1, 1 }, { (int) UNIT_M32R2_U_EXEC, 1, 0 } } },
3111 { M32R2F_INSN_LD24, model_m32r2_ld24, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3112 { M32R2F_INSN_LDI8, model_m32r2_ldi8, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3113 { M32R2F_INSN_LDI16, model_m32r2_ldi16, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3114 { M32R2F_INSN_LOCK, model_m32r2_lock, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3115 { M32R2F_INSN_MACHI_A, model_m32r2_machi_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3116 { M32R2F_INSN_MACLO_A, model_m32r2_maclo_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3117 { M32R2F_INSN_MACWHI_A, model_m32r2_macwhi_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3118 { M32R2F_INSN_MACWLO_A, model_m32r2_macwlo_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3119 { M32R2F_INSN_MUL, model_m32r2_mul, { { (int) UNIT_M32R2_U_EXEC, 1, 4 } } },
3120 { M32R2F_INSN_MULHI_A, model_m32r2_mulhi_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3121 { M32R2F_INSN_MULLO_A, model_m32r2_mullo_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3122 { M32R2F_INSN_MULWHI_A, model_m32r2_mulwhi_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3123 { M32R2F_INSN_MULWLO_A, model_m32r2_mulwlo_a, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3124 { M32R2F_INSN_MV, model_m32r2_mv, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3125 { M32R2F_INSN_MVFACHI_A, model_m32r2_mvfachi_a, { { (int) UNIT_M32R2_U_EXEC, 1, 2 } } },
3126 { M32R2F_INSN_MVFACLO_A, model_m32r2_mvfaclo_a, { { (int) UNIT_M32R2_U_EXEC, 1, 2 } } },
3127 { M32R2F_INSN_MVFACMI_A, model_m32r2_mvfacmi_a, { { (int) UNIT_M32R2_U_EXEC, 1, 2 } } },
3128 { M32R2F_INSN_MVFC, model_m32r2_mvfc, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3129 { M32R2F_INSN_MVTACHI_A, model_m32r2_mvtachi_a, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3130 { M32R2F_INSN_MVTACLO_A, model_m32r2_mvtaclo_a, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3131 { M32R2F_INSN_MVTC, model_m32r2_mvtc, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3132 { M32R2F_INSN_NEG, model_m32r2_neg, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3133 { M32R2F_INSN_NOP, model_m32r2_nop, { { (int) UNIT_M32R2_U_EXEC, 1, 0 } } },
3134 { M32R2F_INSN_NOT, model_m32r2_not, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3135 { M32R2F_INSN_RAC_DSI, model_m32r2_rac_dsi, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3136 { M32R2F_INSN_RACH_DSI, model_m32r2_rach_dsi, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3137 { M32R2F_INSN_RTE, model_m32r2_rte, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3138 { M32R2F_INSN_SETH, model_m32r2_seth, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3139 { M32R2F_INSN_SLL, model_m32r2_sll, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3140 { M32R2F_INSN_SLL3, model_m32r2_sll3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3141 { M32R2F_INSN_SLLI, model_m32r2_slli, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3142 { M32R2F_INSN_SRA, model_m32r2_sra, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3143 { M32R2F_INSN_SRA3, model_m32r2_sra3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3144 { M32R2F_INSN_SRAI, model_m32r2_srai, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3145 { M32R2F_INSN_SRL, model_m32r2_srl, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3146 { M32R2F_INSN_SRL3, model_m32r2_srl3, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3147 { M32R2F_INSN_SRLI, model_m32r2_srli, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3148 { M32R2F_INSN_ST, model_m32r2_st, { { (int) UNIT_M32R2_U_STORE, 1, 1 } } },
3149 { M32R2F_INSN_ST_D, model_m32r2_st_d, { { (int) UNIT_M32R2_U_STORE, 1, 2 } } },
3150 { M32R2F_INSN_STB, model_m32r2_stb, { { (int) UNIT_M32R2_U_STORE, 1, 1 } } },
3151 { M32R2F_INSN_STB_D, model_m32r2_stb_d, { { (int) UNIT_M32R2_U_STORE, 1, 2 } } },
3152 { M32R2F_INSN_STH, model_m32r2_sth, { { (int) UNIT_M32R2_U_STORE, 1, 1 } } },
3153 { M32R2F_INSN_STH_D, model_m32r2_sth_d, { { (int) UNIT_M32R2_U_STORE, 1, 2 } } },
3154 { M32R2F_INSN_ST_PLUS, model_m32r2_st_plus, { { (int) UNIT_M32R2_U_STORE, 1, 1 }, { (int) UNIT_M32R2_U_EXEC, 1, 0 } } },
3155 { M32R2F_INSN_STH_PLUS, model_m32r2_sth_plus, { { (int) UNIT_M32R2_U_STORE, 1, 1 }, { (int) UNIT_M32R2_U_EXEC, 1, 0 } } },
3156 { M32R2F_INSN_STB_PLUS, model_m32r2_stb_plus, { { (int) UNIT_M32R2_U_STORE, 1, 1 }, { (int) UNIT_M32R2_U_EXEC, 1, 0 } } },
3157 { M32R2F_INSN_ST_MINUS, model_m32r2_st_minus, { { (int) UNIT_M32R2_U_STORE, 1, 1 }, { (int) UNIT_M32R2_U_EXEC, 1, 0 } } },
3158 { M32R2F_INSN_SUB, model_m32r2_sub, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3159 { M32R2F_INSN_SUBV, model_m32r2_subv, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3160 { M32R2F_INSN_SUBX, model_m32r2_subx, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3161 { M32R2F_INSN_TRAP, model_m32r2_trap, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3162 { M32R2F_INSN_UNLOCK, model_m32r2_unlock, { { (int) UNIT_M32R2_U_LOAD, 1, 1 } } },
3163 { M32R2F_INSN_SATB, model_m32r2_satb, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3164 { M32R2F_INSN_SATH, model_m32r2_sath, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3165 { M32R2F_INSN_SAT, model_m32r2_sat, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3166 { M32R2F_INSN_PCMPBZ, model_m32r2_pcmpbz, { { (int) UNIT_M32R2_U_CMP, 1, 1 } } },
3167 { M32R2F_INSN_SADD, model_m32r2_sadd, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3168 { M32R2F_INSN_MACWU1, model_m32r2_macwu1, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3169 { M32R2F_INSN_MSBLO, model_m32r2_msblo, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3170 { M32R2F_INSN_MULWU1, model_m32r2_mulwu1, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3171 { M32R2F_INSN_MACLH1, model_m32r2_maclh1, { { (int) UNIT_M32R2_U_MAC, 1, 1 } } },
3172 { M32R2F_INSN_SC, model_m32r2_sc, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3173 { M32R2F_INSN_SNC, model_m32r2_snc, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3174 { M32R2F_INSN_CLRPSW, model_m32r2_clrpsw, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3175 { M32R2F_INSN_SETPSW, model_m32r2_setpsw, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3176 { M32R2F_INSN_BSET, model_m32r2_bset, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3177 { M32R2F_INSN_BCLR, model_m32r2_bclr, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3178 { M32R2F_INSN_BTST, model_m32r2_btst, { { (int) UNIT_M32R2_U_EXEC, 1, 1 } } },
3181 #endif /* WITH_PROFILE_MODEL_P */
3183 static void
3184 m32r2_model_init (SIM_CPU *cpu)
3186 CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_M32R2_DATA));
3189 #if WITH_PROFILE_MODEL_P
3190 #define TIMING_DATA(td) td
3191 #else
3192 #define TIMING_DATA(td) 0
3193 #endif
3195 static const MODEL m32r2_models[] =
3197 { "m32r2", & m32r2_mach, MODEL_M32R2, TIMING_DATA (& m32r2_timing[0]), m32r2_model_init },
3198 { 0 }
3201 /* The properties of this cpu's implementation. */
3203 static const MACH_IMP_PROPERTIES m32r2f_imp_properties =
3205 sizeof (SIM_CPU),
3206 #if WITH_SCACHE
3207 sizeof (SCACHE)
3208 #else
3210 #endif
3214 static void
3215 m32r2f_prepare_run (SIM_CPU *cpu)
3217 if (CPU_IDESC (cpu) == NULL)
3218 m32r2f_init_idesc_table (cpu);
3221 static const CGEN_INSN *
3222 m32r2f_get_idata (SIM_CPU *cpu, int inum)
3224 return CPU_IDESC (cpu) [inum].idata;
3227 static void
3228 m32r2_init_cpu (SIM_CPU *cpu)
3230 CPU_REG_FETCH (cpu) = m32r2f_fetch_register;
3231 CPU_REG_STORE (cpu) = m32r2f_store_register;
3232 CPU_PC_FETCH (cpu) = m32r2f_h_pc_get;
3233 CPU_PC_STORE (cpu) = m32r2f_h_pc_set;
3234 CPU_GET_IDATA (cpu) = m32r2f_get_idata;
3235 CPU_MAX_INSNS (cpu) = M32R2F_INSN__MAX;
3236 CPU_INSN_NAME (cpu) = cgen_insn_name;
3237 CPU_FULL_ENGINE_FN (cpu) = m32r2f_engine_run_full;
3238 #if WITH_FAST
3239 CPU_FAST_ENGINE_FN (cpu) = m32r2f_engine_run_fast;
3240 #else
3241 CPU_FAST_ENGINE_FN (cpu) = m32r2f_engine_run_full;
3242 #endif
3245 const MACH m32r2_mach =
3247 "m32r2", "m32r2", MACH_M32R2,
3248 32, 32, & m32r2_models[0], & m32r2f_imp_properties,
3249 m32r2_init_cpu,
3250 m32r2f_prepare_run