Eliminate literal line numbers in mi-console.exp
[binutils-gdb.git] / sim / cris / modelv32.c
blob7a4cedcd4641847df7d7214e08606bf5fef1a856
1 /* Simulator model support for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2014 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file 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, or (at your option)
12 any later version.
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, see <http://www.gnu.org/licenses/>.
24 #define WANT_CPU crisv32f
25 #define WANT_CPU_CRISV32F
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_crisv32_move_b_r (SIM_CPU *current_cpu, void *sem_arg)
39 #define FLD(f) abuf->fields.sfmt_addc_m.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_Rd = -1;
47 INT in_Rs = -1;
48 INT out_Rd = -1;
49 in_Rs = FLD (in_Rs);
50 referenced |= 1 << 1;
51 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
53 return cycles;
54 #undef FLD
57 static int
58 model_crisv32_move_w_r (SIM_CPU *current_cpu, void *sem_arg)
60 #define FLD(f) abuf->fields.sfmt_addc_m.f
61 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
62 const IDESC * UNUSED idesc = abuf->idesc;
63 int cycles = 0;
65 int referenced = 0;
66 int UNUSED insn_referenced = abuf->written;
67 INT in_Rd = -1;
68 INT in_Rs = -1;
69 INT out_Rd = -1;
70 in_Rs = FLD (in_Rs);
71 referenced |= 1 << 1;
72 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
74 return cycles;
75 #undef FLD
78 static int
79 model_crisv32_move_d_r (SIM_CPU *current_cpu, void *sem_arg)
81 #define FLD(f) abuf->fields.sfmt_addc_m.f
82 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
83 const IDESC * UNUSED idesc = abuf->idesc;
84 int cycles = 0;
86 int referenced = 0;
87 int UNUSED insn_referenced = abuf->written;
88 INT in_Rd = -1;
89 INT in_Rs = -1;
90 INT out_Rd = -1;
91 in_Rs = FLD (in_Rs);
92 referenced |= 1 << 1;
93 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
95 return cycles;
96 #undef FLD
99 static int
100 model_crisv32_moveq (SIM_CPU *current_cpu, void *sem_arg)
102 #define FLD(f) abuf->fields.sfmt_moveq.f
103 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
104 const IDESC * UNUSED idesc = abuf->idesc;
105 int cycles = 0;
107 int referenced = 0;
108 int UNUSED insn_referenced = abuf->written;
109 INT in_Rd = -1;
110 INT in_Rs = -1;
111 INT out_Rd = -1;
112 out_Rd = FLD (out_Rd);
113 referenced |= 1 << 2;
114 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
116 return cycles;
117 #undef FLD
120 static int
121 model_crisv32_movs_b_r (SIM_CPU *current_cpu, void *sem_arg)
123 #define FLD(f) abuf->fields.sfmt_muls_b.f
124 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
125 const IDESC * UNUSED idesc = abuf->idesc;
126 int cycles = 0;
128 int referenced = 0;
129 int UNUSED insn_referenced = abuf->written;
130 INT in_Rd = -1;
131 INT in_Rs = -1;
132 INT out_Rd = -1;
133 in_Rs = FLD (in_Rs);
134 out_Rd = FLD (out_Rd);
135 referenced |= 1 << 1;
136 referenced |= 1 << 2;
137 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
139 return cycles;
140 #undef FLD
143 static int
144 model_crisv32_movs_w_r (SIM_CPU *current_cpu, void *sem_arg)
146 #define FLD(f) abuf->fields.sfmt_muls_b.f
147 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
148 const IDESC * UNUSED idesc = abuf->idesc;
149 int cycles = 0;
151 int referenced = 0;
152 int UNUSED insn_referenced = abuf->written;
153 INT in_Rd = -1;
154 INT in_Rs = -1;
155 INT out_Rd = -1;
156 in_Rs = FLD (in_Rs);
157 out_Rd = FLD (out_Rd);
158 referenced |= 1 << 1;
159 referenced |= 1 << 2;
160 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
162 return cycles;
163 #undef FLD
166 static int
167 model_crisv32_movu_b_r (SIM_CPU *current_cpu, void *sem_arg)
169 #define FLD(f) abuf->fields.sfmt_muls_b.f
170 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
171 const IDESC * UNUSED idesc = abuf->idesc;
172 int cycles = 0;
174 int referenced = 0;
175 int UNUSED insn_referenced = abuf->written;
176 INT in_Rd = -1;
177 INT in_Rs = -1;
178 INT out_Rd = -1;
179 in_Rs = FLD (in_Rs);
180 out_Rd = FLD (out_Rd);
181 referenced |= 1 << 1;
182 referenced |= 1 << 2;
183 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
185 return cycles;
186 #undef FLD
189 static int
190 model_crisv32_movu_w_r (SIM_CPU *current_cpu, void *sem_arg)
192 #define FLD(f) abuf->fields.sfmt_muls_b.f
193 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
194 const IDESC * UNUSED idesc = abuf->idesc;
195 int cycles = 0;
197 int referenced = 0;
198 int UNUSED insn_referenced = abuf->written;
199 INT in_Rd = -1;
200 INT in_Rs = -1;
201 INT out_Rd = -1;
202 in_Rs = FLD (in_Rs);
203 out_Rd = FLD (out_Rd);
204 referenced |= 1 << 1;
205 referenced |= 1 << 2;
206 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
208 return cycles;
209 #undef FLD
212 static int
213 model_crisv32_movecbr (SIM_CPU *current_cpu, void *sem_arg)
215 #define FLD(f) abuf->fields.sfmt_addcbr.f
216 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
217 const IDESC * UNUSED idesc = abuf->idesc;
218 int cycles = 0;
220 int referenced = 0;
221 int UNUSED insn_referenced = abuf->written;
222 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
225 int referenced = 0;
226 int UNUSED insn_referenced = abuf->written;
227 INT in_Rd = -1;
228 INT in_Rs = -1;
229 INT out_Rd = -1;
230 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
232 return cycles;
233 #undef FLD
236 static int
237 model_crisv32_movecwr (SIM_CPU *current_cpu, void *sem_arg)
239 #define FLD(f) abuf->fields.sfmt_addcwr.f
240 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
241 const IDESC * UNUSED idesc = abuf->idesc;
242 int cycles = 0;
244 int referenced = 0;
245 int UNUSED insn_referenced = abuf->written;
246 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
249 int referenced = 0;
250 int UNUSED insn_referenced = abuf->written;
251 INT in_Rd = -1;
252 INT in_Rs = -1;
253 INT out_Rd = -1;
254 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
256 return cycles;
257 #undef FLD
260 static int
261 model_crisv32_movecdr (SIM_CPU *current_cpu, void *sem_arg)
263 #define FLD(f) abuf->fields.sfmt_bound_cd.f
264 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
265 const IDESC * UNUSED idesc = abuf->idesc;
266 int cycles = 0;
268 int referenced = 0;
269 int UNUSED insn_referenced = abuf->written;
270 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
273 int referenced = 0;
274 int UNUSED insn_referenced = abuf->written;
275 INT in_Rd = -1;
276 INT in_Rs = -1;
277 INT out_Rd = -1;
278 out_Rd = FLD (out_Rd);
279 referenced |= 1 << 2;
280 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
282 return cycles;
283 #undef FLD
286 static int
287 model_crisv32_movscbr (SIM_CPU *current_cpu, void *sem_arg)
289 #define FLD(f) abuf->fields.sfmt_bound_cb.f
290 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
291 const IDESC * UNUSED idesc = abuf->idesc;
292 int cycles = 0;
294 int referenced = 0;
295 int UNUSED insn_referenced = abuf->written;
296 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
299 int referenced = 0;
300 int UNUSED insn_referenced = abuf->written;
301 INT in_Rd = -1;
302 INT in_Rs = -1;
303 INT out_Rd = -1;
304 out_Rd = FLD (out_Rd);
305 referenced |= 1 << 2;
306 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
308 return cycles;
309 #undef FLD
312 static int
313 model_crisv32_movscwr (SIM_CPU *current_cpu, void *sem_arg)
315 #define FLD(f) abuf->fields.sfmt_bound_cw.f
316 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
317 const IDESC * UNUSED idesc = abuf->idesc;
318 int cycles = 0;
320 int referenced = 0;
321 int UNUSED insn_referenced = abuf->written;
322 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
325 int referenced = 0;
326 int UNUSED insn_referenced = abuf->written;
327 INT in_Rd = -1;
328 INT in_Rs = -1;
329 INT out_Rd = -1;
330 out_Rd = FLD (out_Rd);
331 referenced |= 1 << 2;
332 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
334 return cycles;
335 #undef FLD
338 static int
339 model_crisv32_movucbr (SIM_CPU *current_cpu, void *sem_arg)
341 #define FLD(f) abuf->fields.sfmt_bound_cb.f
342 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
343 const IDESC * UNUSED idesc = abuf->idesc;
344 int cycles = 0;
346 int referenced = 0;
347 int UNUSED insn_referenced = abuf->written;
348 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
351 int referenced = 0;
352 int UNUSED insn_referenced = abuf->written;
353 INT in_Rd = -1;
354 INT in_Rs = -1;
355 INT out_Rd = -1;
356 out_Rd = FLD (out_Rd);
357 referenced |= 1 << 2;
358 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
360 return cycles;
361 #undef FLD
364 static int
365 model_crisv32_movucwr (SIM_CPU *current_cpu, void *sem_arg)
367 #define FLD(f) abuf->fields.sfmt_bound_cw.f
368 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
369 const IDESC * UNUSED idesc = abuf->idesc;
370 int cycles = 0;
372 int referenced = 0;
373 int UNUSED insn_referenced = abuf->written;
374 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
377 int referenced = 0;
378 int UNUSED insn_referenced = abuf->written;
379 INT in_Rd = -1;
380 INT in_Rs = -1;
381 INT out_Rd = -1;
382 out_Rd = FLD (out_Rd);
383 referenced |= 1 << 2;
384 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
386 return cycles;
387 #undef FLD
390 static int
391 model_crisv32_addq (SIM_CPU *current_cpu, void *sem_arg)
393 #define FLD(f) abuf->fields.sfmt_addq.f
394 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
395 const IDESC * UNUSED idesc = abuf->idesc;
396 int cycles = 0;
398 int referenced = 0;
399 int UNUSED insn_referenced = abuf->written;
400 INT in_Rd = -1;
401 INT in_Rs = -1;
402 INT out_Rd = -1;
403 in_Rd = FLD (in_Rd);
404 referenced |= 1 << 0;
405 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
407 return cycles;
408 #undef FLD
411 static int
412 model_crisv32_subq (SIM_CPU *current_cpu, void *sem_arg)
414 #define FLD(f) abuf->fields.sfmt_addq.f
415 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
416 const IDESC * UNUSED idesc = abuf->idesc;
417 int cycles = 0;
419 int referenced = 0;
420 int UNUSED insn_referenced = abuf->written;
421 INT in_Rd = -1;
422 INT in_Rs = -1;
423 INT out_Rd = -1;
424 in_Rd = FLD (in_Rd);
425 referenced |= 1 << 0;
426 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
428 return cycles;
429 #undef FLD
432 static int
433 model_crisv32_cmp_r_b_r (SIM_CPU *current_cpu, void *sem_arg)
435 #define FLD(f) abuf->fields.sfmt_muls_b.f
436 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
437 const IDESC * UNUSED idesc = abuf->idesc;
438 int cycles = 0;
440 int referenced = 0;
441 int UNUSED insn_referenced = abuf->written;
442 INT in_Rd = -1;
443 INT in_Rs = -1;
444 INT out_Rd = -1;
445 in_Rd = FLD (in_Rd);
446 in_Rs = FLD (in_Rs);
447 referenced |= 1 << 0;
448 referenced |= 1 << 1;
449 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
451 return cycles;
452 #undef FLD
455 static int
456 model_crisv32_cmp_r_w_r (SIM_CPU *current_cpu, void *sem_arg)
458 #define FLD(f) abuf->fields.sfmt_muls_b.f
459 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
460 const IDESC * UNUSED idesc = abuf->idesc;
461 int cycles = 0;
463 int referenced = 0;
464 int UNUSED insn_referenced = abuf->written;
465 INT in_Rd = -1;
466 INT in_Rs = -1;
467 INT out_Rd = -1;
468 in_Rd = FLD (in_Rd);
469 in_Rs = FLD (in_Rs);
470 referenced |= 1 << 0;
471 referenced |= 1 << 1;
472 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
474 return cycles;
475 #undef FLD
478 static int
479 model_crisv32_cmp_r_d_r (SIM_CPU *current_cpu, void *sem_arg)
481 #define FLD(f) abuf->fields.sfmt_muls_b.f
482 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
483 const IDESC * UNUSED idesc = abuf->idesc;
484 int cycles = 0;
486 int referenced = 0;
487 int UNUSED insn_referenced = abuf->written;
488 INT in_Rd = -1;
489 INT in_Rs = -1;
490 INT out_Rd = -1;
491 in_Rd = FLD (in_Rd);
492 in_Rs = FLD (in_Rs);
493 referenced |= 1 << 0;
494 referenced |= 1 << 1;
495 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
497 return cycles;
498 #undef FLD
501 static int
502 model_crisv32_cmp_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
504 #define FLD(f) abuf->fields.sfmt_addc_m.f
505 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
506 const IDESC * UNUSED idesc = abuf->idesc;
507 int cycles = 0;
509 int referenced = 0;
510 int UNUSED insn_referenced = abuf->written;
511 INT in_Rs = -1;
512 in_Rs = FLD (in_Rs);
513 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
514 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
517 int referenced = 0;
518 int UNUSED insn_referenced = abuf->written;
519 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
522 int referenced = 0;
523 int UNUSED insn_referenced = abuf->written;
524 INT in_Rd = -1;
525 INT in_Rs = -1;
526 INT out_Rd = -1;
527 in_Rd = FLD (in_Rd);
528 in_Rs = FLD (in_Rs);
529 referenced |= 1 << 0;
530 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
531 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
533 return cycles;
534 #undef FLD
537 static int
538 model_crisv32_cmp_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
540 #define FLD(f) abuf->fields.sfmt_addc_m.f
541 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
542 const IDESC * UNUSED idesc = abuf->idesc;
543 int cycles = 0;
545 int referenced = 0;
546 int UNUSED insn_referenced = abuf->written;
547 INT in_Rs = -1;
548 in_Rs = FLD (in_Rs);
549 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
550 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
553 int referenced = 0;
554 int UNUSED insn_referenced = abuf->written;
555 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
558 int referenced = 0;
559 int UNUSED insn_referenced = abuf->written;
560 INT in_Rd = -1;
561 INT in_Rs = -1;
562 INT out_Rd = -1;
563 in_Rd = FLD (in_Rd);
564 in_Rs = FLD (in_Rs);
565 referenced |= 1 << 0;
566 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
567 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
569 return cycles;
570 #undef FLD
573 static int
574 model_crisv32_cmp_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
576 #define FLD(f) abuf->fields.sfmt_addc_m.f
577 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
578 const IDESC * UNUSED idesc = abuf->idesc;
579 int cycles = 0;
581 int referenced = 0;
582 int UNUSED insn_referenced = abuf->written;
583 INT in_Rs = -1;
584 in_Rs = FLD (in_Rs);
585 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
586 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
589 int referenced = 0;
590 int UNUSED insn_referenced = abuf->written;
591 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
594 int referenced = 0;
595 int UNUSED insn_referenced = abuf->written;
596 INT in_Rd = -1;
597 INT in_Rs = -1;
598 INT out_Rd = -1;
599 in_Rd = FLD (in_Rd);
600 in_Rs = FLD (in_Rs);
601 referenced |= 1 << 0;
602 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
603 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
605 return cycles;
606 #undef FLD
609 static int
610 model_crisv32_cmpcbr (SIM_CPU *current_cpu, void *sem_arg)
612 #define FLD(f) abuf->fields.sfmt_bound_cb.f
613 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
614 const IDESC * UNUSED idesc = abuf->idesc;
615 int cycles = 0;
617 int referenced = 0;
618 int UNUSED insn_referenced = abuf->written;
619 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
622 int referenced = 0;
623 int UNUSED insn_referenced = abuf->written;
624 INT in_Rd = -1;
625 INT in_Rs = -1;
626 INT out_Rd = -1;
627 in_Rd = FLD (in_Rd);
628 referenced |= 1 << 0;
629 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
631 return cycles;
632 #undef FLD
635 static int
636 model_crisv32_cmpcwr (SIM_CPU *current_cpu, void *sem_arg)
638 #define FLD(f) abuf->fields.sfmt_bound_cw.f
639 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
640 const IDESC * UNUSED idesc = abuf->idesc;
641 int cycles = 0;
643 int referenced = 0;
644 int UNUSED insn_referenced = abuf->written;
645 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
648 int referenced = 0;
649 int UNUSED insn_referenced = abuf->written;
650 INT in_Rd = -1;
651 INT in_Rs = -1;
652 INT out_Rd = -1;
653 in_Rd = FLD (in_Rd);
654 referenced |= 1 << 0;
655 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
657 return cycles;
658 #undef FLD
661 static int
662 model_crisv32_cmpcdr (SIM_CPU *current_cpu, void *sem_arg)
664 #define FLD(f) abuf->fields.sfmt_bound_cd.f
665 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
666 const IDESC * UNUSED idesc = abuf->idesc;
667 int cycles = 0;
669 int referenced = 0;
670 int UNUSED insn_referenced = abuf->written;
671 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
674 int referenced = 0;
675 int UNUSED insn_referenced = abuf->written;
676 INT in_Rd = -1;
677 INT in_Rs = -1;
678 INT out_Rd = -1;
679 in_Rd = FLD (in_Rd);
680 referenced |= 1 << 0;
681 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
683 return cycles;
684 #undef FLD
687 static int
688 model_crisv32_cmpq (SIM_CPU *current_cpu, void *sem_arg)
690 #define FLD(f) abuf->fields.sfmt_andq.f
691 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
692 const IDESC * UNUSED idesc = abuf->idesc;
693 int cycles = 0;
695 int referenced = 0;
696 int UNUSED insn_referenced = abuf->written;
697 INT in_Rd = -1;
698 INT in_Rs = -1;
699 INT out_Rd = -1;
700 in_Rd = FLD (in_Rd);
701 referenced |= 1 << 0;
702 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
704 return cycles;
705 #undef FLD
708 static int
709 model_crisv32_cmps_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
711 #define FLD(f) abuf->fields.sfmt_addc_m.f
712 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
713 const IDESC * UNUSED idesc = abuf->idesc;
714 int cycles = 0;
716 int referenced = 0;
717 int UNUSED insn_referenced = abuf->written;
718 INT in_Rs = -1;
719 in_Rs = FLD (in_Rs);
720 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
721 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
724 int referenced = 0;
725 int UNUSED insn_referenced = abuf->written;
726 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
729 int referenced = 0;
730 int UNUSED insn_referenced = abuf->written;
731 INT in_Rd = -1;
732 INT in_Rs = -1;
733 INT out_Rd = -1;
734 in_Rd = FLD (in_Rd);
735 in_Rs = FLD (in_Rs);
736 referenced |= 1 << 0;
737 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
738 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
740 return cycles;
741 #undef FLD
744 static int
745 model_crisv32_cmps_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
747 #define FLD(f) abuf->fields.sfmt_addc_m.f
748 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
749 const IDESC * UNUSED idesc = abuf->idesc;
750 int cycles = 0;
752 int referenced = 0;
753 int UNUSED insn_referenced = abuf->written;
754 INT in_Rs = -1;
755 in_Rs = FLD (in_Rs);
756 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
757 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
760 int referenced = 0;
761 int UNUSED insn_referenced = abuf->written;
762 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
765 int referenced = 0;
766 int UNUSED insn_referenced = abuf->written;
767 INT in_Rd = -1;
768 INT in_Rs = -1;
769 INT out_Rd = -1;
770 in_Rd = FLD (in_Rd);
771 in_Rs = FLD (in_Rs);
772 referenced |= 1 << 0;
773 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
774 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
776 return cycles;
777 #undef FLD
780 static int
781 model_crisv32_cmpscbr (SIM_CPU *current_cpu, void *sem_arg)
783 #define FLD(f) abuf->fields.sfmt_bound_cb.f
784 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
785 const IDESC * UNUSED idesc = abuf->idesc;
786 int cycles = 0;
788 int referenced = 0;
789 int UNUSED insn_referenced = abuf->written;
790 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
793 int referenced = 0;
794 int UNUSED insn_referenced = abuf->written;
795 INT in_Rd = -1;
796 INT in_Rs = -1;
797 INT out_Rd = -1;
798 in_Rd = FLD (in_Rd);
799 referenced |= 1 << 0;
800 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
802 return cycles;
803 #undef FLD
806 static int
807 model_crisv32_cmpscwr (SIM_CPU *current_cpu, void *sem_arg)
809 #define FLD(f) abuf->fields.sfmt_bound_cw.f
810 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
811 const IDESC * UNUSED idesc = abuf->idesc;
812 int cycles = 0;
814 int referenced = 0;
815 int UNUSED insn_referenced = abuf->written;
816 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
819 int referenced = 0;
820 int UNUSED insn_referenced = abuf->written;
821 INT in_Rd = -1;
822 INT in_Rs = -1;
823 INT out_Rd = -1;
824 in_Rd = FLD (in_Rd);
825 referenced |= 1 << 0;
826 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
828 return cycles;
829 #undef FLD
832 static int
833 model_crisv32_cmpu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
835 #define FLD(f) abuf->fields.sfmt_addc_m.f
836 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
837 const IDESC * UNUSED idesc = abuf->idesc;
838 int cycles = 0;
840 int referenced = 0;
841 int UNUSED insn_referenced = abuf->written;
842 INT in_Rs = -1;
843 in_Rs = FLD (in_Rs);
844 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
845 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
848 int referenced = 0;
849 int UNUSED insn_referenced = abuf->written;
850 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
853 int referenced = 0;
854 int UNUSED insn_referenced = abuf->written;
855 INT in_Rd = -1;
856 INT in_Rs = -1;
857 INT out_Rd = -1;
858 in_Rd = FLD (in_Rd);
859 in_Rs = FLD (in_Rs);
860 referenced |= 1 << 0;
861 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
862 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
864 return cycles;
865 #undef FLD
868 static int
869 model_crisv32_cmpu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
871 #define FLD(f) abuf->fields.sfmt_addc_m.f
872 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
873 const IDESC * UNUSED idesc = abuf->idesc;
874 int cycles = 0;
876 int referenced = 0;
877 int UNUSED insn_referenced = abuf->written;
878 INT in_Rs = -1;
879 in_Rs = FLD (in_Rs);
880 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
881 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
884 int referenced = 0;
885 int UNUSED insn_referenced = abuf->written;
886 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
889 int referenced = 0;
890 int UNUSED insn_referenced = abuf->written;
891 INT in_Rd = -1;
892 INT in_Rs = -1;
893 INT out_Rd = -1;
894 in_Rd = FLD (in_Rd);
895 in_Rs = FLD (in_Rs);
896 referenced |= 1 << 0;
897 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
898 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
900 return cycles;
901 #undef FLD
904 static int
905 model_crisv32_cmpucbr (SIM_CPU *current_cpu, void *sem_arg)
907 #define FLD(f) abuf->fields.sfmt_bound_cb.f
908 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
909 const IDESC * UNUSED idesc = abuf->idesc;
910 int cycles = 0;
912 int referenced = 0;
913 int UNUSED insn_referenced = abuf->written;
914 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
917 int referenced = 0;
918 int UNUSED insn_referenced = abuf->written;
919 INT in_Rd = -1;
920 INT in_Rs = -1;
921 INT out_Rd = -1;
922 in_Rd = FLD (in_Rd);
923 referenced |= 1 << 0;
924 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
926 return cycles;
927 #undef FLD
930 static int
931 model_crisv32_cmpucwr (SIM_CPU *current_cpu, void *sem_arg)
933 #define FLD(f) abuf->fields.sfmt_bound_cw.f
934 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
935 const IDESC * UNUSED idesc = abuf->idesc;
936 int cycles = 0;
938 int referenced = 0;
939 int UNUSED insn_referenced = abuf->written;
940 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
943 int referenced = 0;
944 int UNUSED insn_referenced = abuf->written;
945 INT in_Rd = -1;
946 INT in_Rs = -1;
947 INT out_Rd = -1;
948 in_Rd = FLD (in_Rd);
949 referenced |= 1 << 0;
950 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
952 return cycles;
953 #undef FLD
956 static int
957 model_crisv32_move_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
959 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
960 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
961 const IDESC * UNUSED idesc = abuf->idesc;
962 int cycles = 0;
964 int referenced = 0;
965 int UNUSED insn_referenced = abuf->written;
966 INT in_Rs = -1;
967 in_Rs = FLD (in_Rs);
968 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
969 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
972 int referenced = 0;
973 int UNUSED insn_referenced = abuf->written;
974 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
977 int referenced = 0;
978 int UNUSED insn_referenced = abuf->written;
979 INT in_Rd = -1;
980 INT in_Rs = -1;
981 INT out_Rd = -1;
982 in_Rs = FLD (in_Rs);
983 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
984 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
986 return cycles;
987 #undef FLD
990 static int
991 model_crisv32_move_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
993 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
994 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
995 const IDESC * UNUSED idesc = abuf->idesc;
996 int cycles = 0;
998 int referenced = 0;
999 int UNUSED insn_referenced = abuf->written;
1000 INT in_Rs = -1;
1001 in_Rs = FLD (in_Rs);
1002 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1003 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1006 int referenced = 0;
1007 int UNUSED insn_referenced = abuf->written;
1008 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1011 int referenced = 0;
1012 int UNUSED insn_referenced = abuf->written;
1013 INT in_Rd = -1;
1014 INT in_Rs = -1;
1015 INT out_Rd = -1;
1016 in_Rs = FLD (in_Rs);
1017 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1018 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1020 return cycles;
1021 #undef FLD
1024 static int
1025 model_crisv32_move_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
1027 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1028 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1029 const IDESC * UNUSED idesc = abuf->idesc;
1030 int cycles = 0;
1032 int referenced = 0;
1033 int UNUSED insn_referenced = abuf->written;
1034 INT in_Rs = -1;
1035 in_Rs = FLD (in_Rs);
1036 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1037 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1040 int referenced = 0;
1041 int UNUSED insn_referenced = abuf->written;
1042 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1045 int referenced = 0;
1046 int UNUSED insn_referenced = abuf->written;
1047 INT in_Rd = -1;
1048 INT in_Rs = -1;
1049 INT out_Rd = -1;
1050 in_Rs = FLD (in_Rs);
1051 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1052 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1054 return cycles;
1055 #undef FLD
1058 static int
1059 model_crisv32_movs_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1061 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1062 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1063 const IDESC * UNUSED idesc = abuf->idesc;
1064 int cycles = 0;
1066 int referenced = 0;
1067 int UNUSED insn_referenced = abuf->written;
1068 INT in_Rs = -1;
1069 in_Rs = FLD (in_Rs);
1070 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1071 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1074 int referenced = 0;
1075 int UNUSED insn_referenced = abuf->written;
1076 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1079 int referenced = 0;
1080 int UNUSED insn_referenced = abuf->written;
1081 INT in_Rd = -1;
1082 INT in_Rs = -1;
1083 INT out_Rd = -1;
1084 in_Rs = FLD (in_Rs);
1085 out_Rd = FLD (out_Rd);
1086 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1087 if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1088 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1090 return cycles;
1091 #undef FLD
1094 static int
1095 model_crisv32_movs_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1097 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1098 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1099 const IDESC * UNUSED idesc = abuf->idesc;
1100 int cycles = 0;
1102 int referenced = 0;
1103 int UNUSED insn_referenced = abuf->written;
1104 INT in_Rs = -1;
1105 in_Rs = FLD (in_Rs);
1106 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1107 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1110 int referenced = 0;
1111 int UNUSED insn_referenced = abuf->written;
1112 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1115 int referenced = 0;
1116 int UNUSED insn_referenced = abuf->written;
1117 INT in_Rd = -1;
1118 INT in_Rs = -1;
1119 INT out_Rd = -1;
1120 in_Rs = FLD (in_Rs);
1121 out_Rd = FLD (out_Rd);
1122 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1123 if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1124 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1126 return cycles;
1127 #undef FLD
1130 static int
1131 model_crisv32_movu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1133 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1134 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1135 const IDESC * UNUSED idesc = abuf->idesc;
1136 int cycles = 0;
1138 int referenced = 0;
1139 int UNUSED insn_referenced = abuf->written;
1140 INT in_Rs = -1;
1141 in_Rs = FLD (in_Rs);
1142 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1143 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1146 int referenced = 0;
1147 int UNUSED insn_referenced = abuf->written;
1148 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1151 int referenced = 0;
1152 int UNUSED insn_referenced = abuf->written;
1153 INT in_Rd = -1;
1154 INT in_Rs = -1;
1155 INT out_Rd = -1;
1156 in_Rs = FLD (in_Rs);
1157 out_Rd = FLD (out_Rd);
1158 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1159 if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1160 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1162 return cycles;
1163 #undef FLD
1166 static int
1167 model_crisv32_movu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1169 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1170 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1171 const IDESC * UNUSED idesc = abuf->idesc;
1172 int cycles = 0;
1174 int referenced = 0;
1175 int UNUSED insn_referenced = abuf->written;
1176 INT in_Rs = -1;
1177 in_Rs = FLD (in_Rs);
1178 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1179 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1182 int referenced = 0;
1183 int UNUSED insn_referenced = abuf->written;
1184 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1187 int referenced = 0;
1188 int UNUSED insn_referenced = abuf->written;
1189 INT in_Rd = -1;
1190 INT in_Rs = -1;
1191 INT out_Rd = -1;
1192 in_Rs = FLD (in_Rs);
1193 out_Rd = FLD (out_Rd);
1194 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1195 if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1196 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1198 return cycles;
1199 #undef FLD
1202 static int
1203 model_crisv32_move_r_sprv32 (SIM_CPU *current_cpu, void *sem_arg)
1205 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
1206 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1207 const IDESC * UNUSED idesc = abuf->idesc;
1208 int cycles = 0;
1210 int referenced = 0;
1211 int UNUSED insn_referenced = abuf->written;
1212 INT in_Rs = -1;
1213 INT out_Pd = -1;
1214 in_Rs = FLD (in_Rs);
1215 out_Pd = FLD (out_Pd);
1216 referenced |= 1 << 0;
1217 if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
1218 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 0, referenced, in_Rs, out_Pd);
1220 return cycles;
1221 #undef FLD
1224 static int
1225 model_crisv32_move_spr_rv32 (SIM_CPU *current_cpu, void *sem_arg)
1227 #define FLD(f) abuf->fields.sfmt_mcp.f
1228 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1229 const IDESC * UNUSED idesc = abuf->idesc;
1230 int cycles = 0;
1232 int referenced = 0;
1233 int UNUSED insn_referenced = abuf->written;
1234 INT in_Rd = -1;
1235 INT in_Rs = -1;
1236 INT out_Rd = -1;
1237 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1239 return cycles;
1240 #undef FLD
1243 static int
1244 model_crisv32_move_m_sprv32 (SIM_CPU *current_cpu, void *sem_arg)
1246 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
1247 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1248 const IDESC * UNUSED idesc = abuf->idesc;
1249 int cycles = 0;
1251 int referenced = 0;
1252 int UNUSED insn_referenced = abuf->written;
1253 INT in_Rs = -1;
1254 in_Rs = FLD (in_Rs);
1255 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1256 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1259 int referenced = 0;
1260 int UNUSED insn_referenced = abuf->written;
1261 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1264 int referenced = 0;
1265 int UNUSED insn_referenced = abuf->written;
1266 INT in_Rs = -1;
1267 INT out_Pd = -1;
1268 in_Rs = FLD (in_Rs);
1269 out_Pd = FLD (out_Pd);
1270 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1271 referenced |= 1 << 1;
1272 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 2, referenced, in_Rs, out_Pd);
1274 return cycles;
1275 #undef FLD
1278 static int
1279 model_crisv32_move_c_sprv32_p2 (SIM_CPU *current_cpu, void *sem_arg)
1281 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1282 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1283 const IDESC * UNUSED idesc = abuf->idesc;
1284 int cycles = 0;
1286 int referenced = 0;
1287 int UNUSED insn_referenced = abuf->written;
1288 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1291 int referenced = 0;
1292 int UNUSED insn_referenced = abuf->written;
1293 INT in_Rs = -1;
1294 INT out_Pd = -1;
1295 out_Pd = FLD (out_Pd);
1296 referenced |= 1 << 1;
1297 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1299 return cycles;
1300 #undef FLD
1303 static int
1304 model_crisv32_move_c_sprv32_p3 (SIM_CPU *current_cpu, void *sem_arg)
1306 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1307 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1308 const IDESC * UNUSED idesc = abuf->idesc;
1309 int cycles = 0;
1311 int referenced = 0;
1312 int UNUSED insn_referenced = abuf->written;
1313 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1316 int referenced = 0;
1317 int UNUSED insn_referenced = abuf->written;
1318 INT in_Rs = -1;
1319 INT out_Pd = -1;
1320 out_Pd = FLD (out_Pd);
1321 referenced |= 1 << 1;
1322 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1324 return cycles;
1325 #undef FLD
1328 static int
1329 model_crisv32_move_c_sprv32_p5 (SIM_CPU *current_cpu, void *sem_arg)
1331 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1332 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1333 const IDESC * UNUSED idesc = abuf->idesc;
1334 int cycles = 0;
1336 int referenced = 0;
1337 int UNUSED insn_referenced = abuf->written;
1338 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1341 int referenced = 0;
1342 int UNUSED insn_referenced = abuf->written;
1343 INT in_Rs = -1;
1344 INT out_Pd = -1;
1345 out_Pd = FLD (out_Pd);
1346 referenced |= 1 << 1;
1347 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1349 return cycles;
1350 #undef FLD
1353 static int
1354 model_crisv32_move_c_sprv32_p6 (SIM_CPU *current_cpu, void *sem_arg)
1356 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1357 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1358 const IDESC * UNUSED idesc = abuf->idesc;
1359 int cycles = 0;
1361 int referenced = 0;
1362 int UNUSED insn_referenced = abuf->written;
1363 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1366 int referenced = 0;
1367 int UNUSED insn_referenced = abuf->written;
1368 INT in_Rs = -1;
1369 INT out_Pd = -1;
1370 out_Pd = FLD (out_Pd);
1371 referenced |= 1 << 1;
1372 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1374 return cycles;
1375 #undef FLD
1378 static int
1379 model_crisv32_move_c_sprv32_p7 (SIM_CPU *current_cpu, void *sem_arg)
1381 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1382 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1383 const IDESC * UNUSED idesc = abuf->idesc;
1384 int cycles = 0;
1386 int referenced = 0;
1387 int UNUSED insn_referenced = abuf->written;
1388 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1391 int referenced = 0;
1392 int UNUSED insn_referenced = abuf->written;
1393 INT in_Rs = -1;
1394 INT out_Pd = -1;
1395 out_Pd = FLD (out_Pd);
1396 referenced |= 1 << 1;
1397 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1399 return cycles;
1400 #undef FLD
1403 static int
1404 model_crisv32_move_c_sprv32_p9 (SIM_CPU *current_cpu, void *sem_arg)
1406 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1407 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1408 const IDESC * UNUSED idesc = abuf->idesc;
1409 int cycles = 0;
1411 int referenced = 0;
1412 int UNUSED insn_referenced = abuf->written;
1413 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1416 int referenced = 0;
1417 int UNUSED insn_referenced = abuf->written;
1418 INT in_Rs = -1;
1419 INT out_Pd = -1;
1420 out_Pd = FLD (out_Pd);
1421 referenced |= 1 << 1;
1422 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1424 return cycles;
1425 #undef FLD
1428 static int
1429 model_crisv32_move_c_sprv32_p10 (SIM_CPU *current_cpu, void *sem_arg)
1431 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1432 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1433 const IDESC * UNUSED idesc = abuf->idesc;
1434 int cycles = 0;
1436 int referenced = 0;
1437 int UNUSED insn_referenced = abuf->written;
1438 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1441 int referenced = 0;
1442 int UNUSED insn_referenced = abuf->written;
1443 INT in_Rs = -1;
1444 INT out_Pd = -1;
1445 out_Pd = FLD (out_Pd);
1446 referenced |= 1 << 1;
1447 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1449 return cycles;
1450 #undef FLD
1453 static int
1454 model_crisv32_move_c_sprv32_p11 (SIM_CPU *current_cpu, void *sem_arg)
1456 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1457 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1458 const IDESC * UNUSED idesc = abuf->idesc;
1459 int cycles = 0;
1461 int referenced = 0;
1462 int UNUSED insn_referenced = abuf->written;
1463 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1466 int referenced = 0;
1467 int UNUSED insn_referenced = abuf->written;
1468 INT in_Rs = -1;
1469 INT out_Pd = -1;
1470 out_Pd = FLD (out_Pd);
1471 referenced |= 1 << 1;
1472 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1474 return cycles;
1475 #undef FLD
1478 static int
1479 model_crisv32_move_c_sprv32_p12 (SIM_CPU *current_cpu, void *sem_arg)
1481 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1482 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1483 const IDESC * UNUSED idesc = abuf->idesc;
1484 int cycles = 0;
1486 int referenced = 0;
1487 int UNUSED insn_referenced = abuf->written;
1488 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1491 int referenced = 0;
1492 int UNUSED insn_referenced = abuf->written;
1493 INT in_Rs = -1;
1494 INT out_Pd = -1;
1495 out_Pd = FLD (out_Pd);
1496 referenced |= 1 << 1;
1497 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1499 return cycles;
1500 #undef FLD
1503 static int
1504 model_crisv32_move_c_sprv32_p13 (SIM_CPU *current_cpu, void *sem_arg)
1506 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1507 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1508 const IDESC * UNUSED idesc = abuf->idesc;
1509 int cycles = 0;
1511 int referenced = 0;
1512 int UNUSED insn_referenced = abuf->written;
1513 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1516 int referenced = 0;
1517 int UNUSED insn_referenced = abuf->written;
1518 INT in_Rs = -1;
1519 INT out_Pd = -1;
1520 out_Pd = FLD (out_Pd);
1521 referenced |= 1 << 1;
1522 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1524 return cycles;
1525 #undef FLD
1528 static int
1529 model_crisv32_move_c_sprv32_p14 (SIM_CPU *current_cpu, void *sem_arg)
1531 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1532 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1533 const IDESC * UNUSED idesc = abuf->idesc;
1534 int cycles = 0;
1536 int referenced = 0;
1537 int UNUSED insn_referenced = abuf->written;
1538 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1541 int referenced = 0;
1542 int UNUSED insn_referenced = abuf->written;
1543 INT in_Rs = -1;
1544 INT out_Pd = -1;
1545 out_Pd = FLD (out_Pd);
1546 referenced |= 1 << 1;
1547 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1549 return cycles;
1550 #undef FLD
1553 static int
1554 model_crisv32_move_c_sprv32_p15 (SIM_CPU *current_cpu, void *sem_arg)
1556 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1557 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1558 const IDESC * UNUSED idesc = abuf->idesc;
1559 int cycles = 0;
1561 int referenced = 0;
1562 int UNUSED insn_referenced = abuf->written;
1563 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1566 int referenced = 0;
1567 int UNUSED insn_referenced = abuf->written;
1568 INT in_Rs = -1;
1569 INT out_Pd = -1;
1570 out_Pd = FLD (out_Pd);
1571 referenced |= 1 << 1;
1572 cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1574 return cycles;
1575 #undef FLD
1578 static int
1579 model_crisv32_move_spr_mv32 (SIM_CPU *current_cpu, void *sem_arg)
1581 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
1582 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1583 const IDESC * UNUSED idesc = abuf->idesc;
1584 int cycles = 0;
1586 int referenced = 0;
1587 int UNUSED insn_referenced = abuf->written;
1588 INT in_Rs = -1;
1589 in_Rs = FLD (in_Rs);
1590 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1591 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1594 int referenced = 0;
1595 int UNUSED insn_referenced = abuf->written;
1596 INT in_Rd = -1;
1597 INT in_Rs = -1;
1598 INT out_Rd = -1;
1599 in_Rs = FLD (in_Rs);
1600 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1601 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1604 int referenced = 0;
1605 int UNUSED insn_referenced = abuf->written;
1606 cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
1608 return cycles;
1609 #undef FLD
1612 static int
1613 model_crisv32_move_ss_r (SIM_CPU *current_cpu, void *sem_arg)
1615 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
1616 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1617 const IDESC * UNUSED idesc = abuf->idesc;
1618 int cycles = 0;
1620 int referenced = 0;
1621 int UNUSED insn_referenced = abuf->written;
1622 INT in_Rd = -1;
1623 INT in_Rs = -1;
1624 INT out_Rd = -1;
1625 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1627 return cycles;
1628 #undef FLD
1631 static int
1632 model_crisv32_move_r_ss (SIM_CPU *current_cpu, void *sem_arg)
1634 #define FLD(f) abuf->fields.sfmt_mcp.f
1635 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1636 const IDESC * UNUSED idesc = abuf->idesc;
1637 int cycles = 0;
1639 int referenced = 0;
1640 int UNUSED insn_referenced = abuf->written;
1641 INT in_Rd = -1;
1642 INT in_Rs = -1;
1643 INT out_Rd = -1;
1644 in_Rs = FLD (in_Rs);
1645 referenced |= 1 << 1;
1646 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1648 return cycles;
1649 #undef FLD
1652 static int
1653 model_crisv32_movem_r_m_v32 (SIM_CPU *current_cpu, void *sem_arg)
1655 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
1656 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1657 const IDESC * UNUSED idesc = abuf->idesc;
1658 int cycles = 0;
1660 int referenced = 0;
1661 int UNUSED insn_referenced = abuf->written;
1662 INT in_Rs = -1;
1663 in_Rs = FLD (in_Rs);
1664 referenced |= 1 << 0;
1665 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1668 int referenced = 0;
1669 int UNUSED insn_referenced = abuf->written;
1670 INT in_Rs = -1;
1671 INT in_Rd = -1;
1672 in_Rs = FLD (in_Rs);
1673 in_Rd = FLD (in_Rd);
1674 referenced |= 1 << 0;
1675 referenced |= 1 << 1;
1676 cycles += crisv32f_model_crisv32_u_movem_rtom (current_cpu, idesc, 1, referenced, in_Rs, in_Rd);
1679 int referenced = 0;
1680 int UNUSED insn_referenced = abuf->written;
1681 INT in_Rs = -1;
1682 INT out_Rd = -1;
1683 in_Rs = FLD (in_Rs);
1684 referenced |= 1 << 0;
1685 cycles += crisv32f_model_crisv32_u_exec_movem (current_cpu, idesc, 2, referenced, in_Rs, out_Rd);
1688 int referenced = 0;
1689 int UNUSED insn_referenced = abuf->written;
1690 cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 3, referenced);
1692 return cycles;
1693 #undef FLD
1696 static int
1697 model_crisv32_movem_m_r_v32 (SIM_CPU *current_cpu, void *sem_arg)
1699 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
1700 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1701 const IDESC * UNUSED idesc = abuf->idesc;
1702 int cycles = 0;
1704 int referenced = 0;
1705 int UNUSED insn_referenced = abuf->written;
1706 INT in_Rs = -1;
1707 in_Rs = FLD (in_Rs);
1708 referenced |= 1 << 0;
1709 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1712 int referenced = 0;
1713 int UNUSED insn_referenced = abuf->written;
1714 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1717 int referenced = 0;
1718 int UNUSED insn_referenced = abuf->written;
1719 INT in_Rs = -1;
1720 INT in_Rd = -1;
1721 in_Rs = FLD (in_Rs);
1722 in_Rd = FLD (in_Rd);
1723 referenced |= 1 << 0;
1724 referenced |= 1 << 1;
1725 cycles += crisv32f_model_crisv32_u_movem_mtor (current_cpu, idesc, 2, referenced, in_Rs, in_Rd);
1728 int referenced = 0;
1729 int UNUSED insn_referenced = abuf->written;
1730 INT in_Rs = -1;
1731 INT out_Rd = -1;
1732 in_Rs = FLD (in_Rs);
1733 referenced |= 1 << 0;
1734 cycles += crisv32f_model_crisv32_u_exec_movem (current_cpu, idesc, 3, referenced, in_Rs, out_Rd);
1736 return cycles;
1737 #undef FLD
1740 static int
1741 model_crisv32_add_b_r (SIM_CPU *current_cpu, void *sem_arg)
1743 #define FLD(f) abuf->fields.sfmt_addc_m.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_Rd = -1;
1751 INT in_Rs = -1;
1752 INT out_Rd = -1;
1753 in_Rd = FLD (in_Rd);
1754 in_Rs = FLD (in_Rs);
1755 referenced |= 1 << 0;
1756 referenced |= 1 << 1;
1757 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1759 return cycles;
1760 #undef FLD
1763 static int
1764 model_crisv32_add_w_r (SIM_CPU *current_cpu, void *sem_arg)
1766 #define FLD(f) abuf->fields.sfmt_addc_m.f
1767 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1768 const IDESC * UNUSED idesc = abuf->idesc;
1769 int cycles = 0;
1771 int referenced = 0;
1772 int UNUSED insn_referenced = abuf->written;
1773 INT in_Rd = -1;
1774 INT in_Rs = -1;
1775 INT out_Rd = -1;
1776 in_Rd = FLD (in_Rd);
1777 in_Rs = FLD (in_Rs);
1778 referenced |= 1 << 0;
1779 referenced |= 1 << 1;
1780 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1782 return cycles;
1783 #undef FLD
1786 static int
1787 model_crisv32_add_d_r (SIM_CPU *current_cpu, void *sem_arg)
1789 #define FLD(f) abuf->fields.sfmt_addc_m.f
1790 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1791 const IDESC * UNUSED idesc = abuf->idesc;
1792 int cycles = 0;
1794 int referenced = 0;
1795 int UNUSED insn_referenced = abuf->written;
1796 INT in_Rd = -1;
1797 INT in_Rs = -1;
1798 INT out_Rd = -1;
1799 in_Rd = FLD (in_Rd);
1800 in_Rs = FLD (in_Rs);
1801 referenced |= 1 << 0;
1802 referenced |= 1 << 1;
1803 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1805 return cycles;
1806 #undef FLD
1809 static int
1810 model_crisv32_add_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1812 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1813 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1814 const IDESC * UNUSED idesc = abuf->idesc;
1815 int cycles = 0;
1817 int referenced = 0;
1818 int UNUSED insn_referenced = abuf->written;
1819 INT in_Rs = -1;
1820 in_Rs = FLD (in_Rs);
1821 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1822 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1825 int referenced = 0;
1826 int UNUSED insn_referenced = abuf->written;
1827 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1830 int referenced = 0;
1831 int UNUSED insn_referenced = abuf->written;
1832 INT in_Rd = -1;
1833 INT in_Rs = -1;
1834 INT out_Rd = -1;
1835 in_Rd = FLD (in_Rd);
1836 in_Rs = FLD (in_Rs);
1837 referenced |= 1 << 0;
1838 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1839 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1841 return cycles;
1842 #undef FLD
1845 static int
1846 model_crisv32_add_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1848 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1849 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1850 const IDESC * UNUSED idesc = abuf->idesc;
1851 int cycles = 0;
1853 int referenced = 0;
1854 int UNUSED insn_referenced = abuf->written;
1855 INT in_Rs = -1;
1856 in_Rs = FLD (in_Rs);
1857 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1858 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1861 int referenced = 0;
1862 int UNUSED insn_referenced = abuf->written;
1863 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1866 int referenced = 0;
1867 int UNUSED insn_referenced = abuf->written;
1868 INT in_Rd = -1;
1869 INT in_Rs = -1;
1870 INT out_Rd = -1;
1871 in_Rd = FLD (in_Rd);
1872 in_Rs = FLD (in_Rs);
1873 referenced |= 1 << 0;
1874 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1875 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1877 return cycles;
1878 #undef FLD
1881 static int
1882 model_crisv32_add_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
1884 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1885 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1886 const IDESC * UNUSED idesc = abuf->idesc;
1887 int cycles = 0;
1889 int referenced = 0;
1890 int UNUSED insn_referenced = abuf->written;
1891 INT in_Rs = -1;
1892 in_Rs = FLD (in_Rs);
1893 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1894 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1897 int referenced = 0;
1898 int UNUSED insn_referenced = abuf->written;
1899 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1902 int referenced = 0;
1903 int UNUSED insn_referenced = abuf->written;
1904 INT in_Rd = -1;
1905 INT in_Rs = -1;
1906 INT out_Rd = -1;
1907 in_Rd = FLD (in_Rd);
1908 in_Rs = FLD (in_Rs);
1909 referenced |= 1 << 0;
1910 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1911 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1913 return cycles;
1914 #undef FLD
1917 static int
1918 model_crisv32_addcbr (SIM_CPU *current_cpu, void *sem_arg)
1920 #define FLD(f) abuf->fields.sfmt_addcbr.f
1921 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1922 const IDESC * UNUSED idesc = abuf->idesc;
1923 int cycles = 0;
1925 int referenced = 0;
1926 int UNUSED insn_referenced = abuf->written;
1927 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
1930 int referenced = 0;
1931 int UNUSED insn_referenced = abuf->written;
1932 INT in_Rd = -1;
1933 INT in_Rs = -1;
1934 INT out_Rd = -1;
1935 in_Rd = FLD (in_Rd);
1936 referenced |= 1 << 0;
1937 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1939 return cycles;
1940 #undef FLD
1943 static int
1944 model_crisv32_addcwr (SIM_CPU *current_cpu, void *sem_arg)
1946 #define FLD(f) abuf->fields.sfmt_addcwr.f
1947 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1948 const IDESC * UNUSED idesc = abuf->idesc;
1949 int cycles = 0;
1951 int referenced = 0;
1952 int UNUSED insn_referenced = abuf->written;
1953 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
1956 int referenced = 0;
1957 int UNUSED insn_referenced = abuf->written;
1958 INT in_Rd = -1;
1959 INT in_Rs = -1;
1960 INT out_Rd = -1;
1961 in_Rd = FLD (in_Rd);
1962 referenced |= 1 << 0;
1963 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1965 return cycles;
1966 #undef FLD
1969 static int
1970 model_crisv32_addcdr (SIM_CPU *current_cpu, void *sem_arg)
1972 #define FLD(f) abuf->fields.sfmt_addcdr.f
1973 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1974 const IDESC * UNUSED idesc = abuf->idesc;
1975 int cycles = 0;
1977 int referenced = 0;
1978 int UNUSED insn_referenced = abuf->written;
1979 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1982 int referenced = 0;
1983 int UNUSED insn_referenced = abuf->written;
1984 INT in_Rd = -1;
1985 INT in_Rs = -1;
1986 INT out_Rd = -1;
1987 in_Rd = FLD (in_Rd);
1988 referenced |= 1 << 0;
1989 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1991 return cycles;
1992 #undef FLD
1995 static int
1996 model_crisv32_adds_b_r (SIM_CPU *current_cpu, void *sem_arg)
1998 #define FLD(f) abuf->fields.sfmt_addc_m.f
1999 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2000 const IDESC * UNUSED idesc = abuf->idesc;
2001 int cycles = 0;
2003 int referenced = 0;
2004 int UNUSED insn_referenced = abuf->written;
2005 INT in_Rd = -1;
2006 INT in_Rs = -1;
2007 INT out_Rd = -1;
2008 in_Rd = FLD (in_Rd);
2009 in_Rs = FLD (in_Rs);
2010 referenced |= 1 << 0;
2011 referenced |= 1 << 1;
2012 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2014 return cycles;
2015 #undef FLD
2018 static int
2019 model_crisv32_adds_w_r (SIM_CPU *current_cpu, void *sem_arg)
2021 #define FLD(f) abuf->fields.sfmt_addc_m.f
2022 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2023 const IDESC * UNUSED idesc = abuf->idesc;
2024 int cycles = 0;
2026 int referenced = 0;
2027 int UNUSED insn_referenced = abuf->written;
2028 INT in_Rd = -1;
2029 INT in_Rs = -1;
2030 INT out_Rd = -1;
2031 in_Rd = FLD (in_Rd);
2032 in_Rs = FLD (in_Rs);
2033 referenced |= 1 << 0;
2034 referenced |= 1 << 1;
2035 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2037 return cycles;
2038 #undef FLD
2041 static int
2042 model_crisv32_adds_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2044 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2045 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2046 const IDESC * UNUSED idesc = abuf->idesc;
2047 int cycles = 0;
2049 int referenced = 0;
2050 int UNUSED insn_referenced = abuf->written;
2051 INT in_Rs = -1;
2052 in_Rs = FLD (in_Rs);
2053 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2054 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2057 int referenced = 0;
2058 int UNUSED insn_referenced = abuf->written;
2059 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2062 int referenced = 0;
2063 int UNUSED insn_referenced = abuf->written;
2064 INT in_Rd = -1;
2065 INT in_Rs = -1;
2066 INT out_Rd = -1;
2067 in_Rd = FLD (in_Rd);
2068 in_Rs = FLD (in_Rs);
2069 referenced |= 1 << 0;
2070 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2071 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2073 return cycles;
2074 #undef FLD
2077 static int
2078 model_crisv32_adds_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2080 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2081 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2082 const IDESC * UNUSED idesc = abuf->idesc;
2083 int cycles = 0;
2085 int referenced = 0;
2086 int UNUSED insn_referenced = abuf->written;
2087 INT in_Rs = -1;
2088 in_Rs = FLD (in_Rs);
2089 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2090 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2093 int referenced = 0;
2094 int UNUSED insn_referenced = abuf->written;
2095 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2098 int referenced = 0;
2099 int UNUSED insn_referenced = abuf->written;
2100 INT in_Rd = -1;
2101 INT in_Rs = -1;
2102 INT out_Rd = -1;
2103 in_Rd = FLD (in_Rd);
2104 in_Rs = FLD (in_Rs);
2105 referenced |= 1 << 0;
2106 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2107 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2109 return cycles;
2110 #undef FLD
2113 static int
2114 model_crisv32_addscbr (SIM_CPU *current_cpu, void *sem_arg)
2116 #define FLD(f) abuf->fields.sfmt_addcbr.f
2117 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2118 const IDESC * UNUSED idesc = abuf->idesc;
2119 int cycles = 0;
2121 int referenced = 0;
2122 int UNUSED insn_referenced = abuf->written;
2123 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2126 int referenced = 0;
2127 int UNUSED insn_referenced = abuf->written;
2128 INT in_Rd = -1;
2129 INT in_Rs = -1;
2130 INT out_Rd = -1;
2131 in_Rd = FLD (in_Rd);
2132 referenced |= 1 << 0;
2133 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2135 return cycles;
2136 #undef FLD
2139 static int
2140 model_crisv32_addscwr (SIM_CPU *current_cpu, void *sem_arg)
2142 #define FLD(f) abuf->fields.sfmt_addcwr.f
2143 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2144 const IDESC * UNUSED idesc = abuf->idesc;
2145 int cycles = 0;
2147 int referenced = 0;
2148 int UNUSED insn_referenced = abuf->written;
2149 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2152 int referenced = 0;
2153 int UNUSED insn_referenced = abuf->written;
2154 INT in_Rd = -1;
2155 INT in_Rs = -1;
2156 INT out_Rd = -1;
2157 in_Rd = FLD (in_Rd);
2158 referenced |= 1 << 0;
2159 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2161 return cycles;
2162 #undef FLD
2165 static int
2166 model_crisv32_addu_b_r (SIM_CPU *current_cpu, void *sem_arg)
2168 #define FLD(f) abuf->fields.sfmt_addc_m.f
2169 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2170 const IDESC * UNUSED idesc = abuf->idesc;
2171 int cycles = 0;
2173 int referenced = 0;
2174 int UNUSED insn_referenced = abuf->written;
2175 INT in_Rd = -1;
2176 INT in_Rs = -1;
2177 INT out_Rd = -1;
2178 in_Rd = FLD (in_Rd);
2179 in_Rs = FLD (in_Rs);
2180 referenced |= 1 << 0;
2181 referenced |= 1 << 1;
2182 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2184 return cycles;
2185 #undef FLD
2188 static int
2189 model_crisv32_addu_w_r (SIM_CPU *current_cpu, void *sem_arg)
2191 #define FLD(f) abuf->fields.sfmt_addc_m.f
2192 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2193 const IDESC * UNUSED idesc = abuf->idesc;
2194 int cycles = 0;
2196 int referenced = 0;
2197 int UNUSED insn_referenced = abuf->written;
2198 INT in_Rd = -1;
2199 INT in_Rs = -1;
2200 INT out_Rd = -1;
2201 in_Rd = FLD (in_Rd);
2202 in_Rs = FLD (in_Rs);
2203 referenced |= 1 << 0;
2204 referenced |= 1 << 1;
2205 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2207 return cycles;
2208 #undef FLD
2211 static int
2212 model_crisv32_addu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2214 #define FLD(f) abuf->fields.sfmt_add_m_b_m.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_Rs = -1;
2222 in_Rs = FLD (in_Rs);
2223 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2224 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2227 int referenced = 0;
2228 int UNUSED insn_referenced = abuf->written;
2229 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2232 int referenced = 0;
2233 int UNUSED insn_referenced = abuf->written;
2234 INT in_Rd = -1;
2235 INT in_Rs = -1;
2236 INT out_Rd = -1;
2237 in_Rd = FLD (in_Rd);
2238 in_Rs = FLD (in_Rs);
2239 referenced |= 1 << 0;
2240 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2241 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2243 return cycles;
2244 #undef FLD
2247 static int
2248 model_crisv32_addu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2250 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2251 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2252 const IDESC * UNUSED idesc = abuf->idesc;
2253 int cycles = 0;
2255 int referenced = 0;
2256 int UNUSED insn_referenced = abuf->written;
2257 INT in_Rs = -1;
2258 in_Rs = FLD (in_Rs);
2259 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2260 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2263 int referenced = 0;
2264 int UNUSED insn_referenced = abuf->written;
2265 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2268 int referenced = 0;
2269 int UNUSED insn_referenced = abuf->written;
2270 INT in_Rd = -1;
2271 INT in_Rs = -1;
2272 INT out_Rd = -1;
2273 in_Rd = FLD (in_Rd);
2274 in_Rs = FLD (in_Rs);
2275 referenced |= 1 << 0;
2276 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2277 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2279 return cycles;
2280 #undef FLD
2283 static int
2284 model_crisv32_adducbr (SIM_CPU *current_cpu, void *sem_arg)
2286 #define FLD(f) abuf->fields.sfmt_addcbr.f
2287 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2288 const IDESC * UNUSED idesc = abuf->idesc;
2289 int cycles = 0;
2291 int referenced = 0;
2292 int UNUSED insn_referenced = abuf->written;
2293 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2296 int referenced = 0;
2297 int UNUSED insn_referenced = abuf->written;
2298 INT in_Rd = -1;
2299 INT in_Rs = -1;
2300 INT out_Rd = -1;
2301 in_Rd = FLD (in_Rd);
2302 referenced |= 1 << 0;
2303 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2305 return cycles;
2306 #undef FLD
2309 static int
2310 model_crisv32_adducwr (SIM_CPU *current_cpu, void *sem_arg)
2312 #define FLD(f) abuf->fields.sfmt_addcwr.f
2313 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2314 const IDESC * UNUSED idesc = abuf->idesc;
2315 int cycles = 0;
2317 int referenced = 0;
2318 int UNUSED insn_referenced = abuf->written;
2319 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2322 int referenced = 0;
2323 int UNUSED insn_referenced = abuf->written;
2324 INT in_Rd = -1;
2325 INT in_Rs = -1;
2326 INT out_Rd = -1;
2327 in_Rd = FLD (in_Rd);
2328 referenced |= 1 << 0;
2329 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2331 return cycles;
2332 #undef FLD
2335 static int
2336 model_crisv32_sub_b_r (SIM_CPU *current_cpu, void *sem_arg)
2338 #define FLD(f) abuf->fields.sfmt_addc_m.f
2339 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2340 const IDESC * UNUSED idesc = abuf->idesc;
2341 int cycles = 0;
2343 int referenced = 0;
2344 int UNUSED insn_referenced = abuf->written;
2345 INT in_Rd = -1;
2346 INT in_Rs = -1;
2347 INT out_Rd = -1;
2348 in_Rd = FLD (in_Rd);
2349 in_Rs = FLD (in_Rs);
2350 referenced |= 1 << 0;
2351 referenced |= 1 << 1;
2352 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2354 return cycles;
2355 #undef FLD
2358 static int
2359 model_crisv32_sub_w_r (SIM_CPU *current_cpu, void *sem_arg)
2361 #define FLD(f) abuf->fields.sfmt_addc_m.f
2362 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2363 const IDESC * UNUSED idesc = abuf->idesc;
2364 int cycles = 0;
2366 int referenced = 0;
2367 int UNUSED insn_referenced = abuf->written;
2368 INT in_Rd = -1;
2369 INT in_Rs = -1;
2370 INT out_Rd = -1;
2371 in_Rd = FLD (in_Rd);
2372 in_Rs = FLD (in_Rs);
2373 referenced |= 1 << 0;
2374 referenced |= 1 << 1;
2375 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2377 return cycles;
2378 #undef FLD
2381 static int
2382 model_crisv32_sub_d_r (SIM_CPU *current_cpu, void *sem_arg)
2384 #define FLD(f) abuf->fields.sfmt_addc_m.f
2385 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2386 const IDESC * UNUSED idesc = abuf->idesc;
2387 int cycles = 0;
2389 int referenced = 0;
2390 int UNUSED insn_referenced = abuf->written;
2391 INT in_Rd = -1;
2392 INT in_Rs = -1;
2393 INT out_Rd = -1;
2394 in_Rd = FLD (in_Rd);
2395 in_Rs = FLD (in_Rs);
2396 referenced |= 1 << 0;
2397 referenced |= 1 << 1;
2398 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2400 return cycles;
2401 #undef FLD
2404 static int
2405 model_crisv32_sub_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2407 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2408 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2409 const IDESC * UNUSED idesc = abuf->idesc;
2410 int cycles = 0;
2412 int referenced = 0;
2413 int UNUSED insn_referenced = abuf->written;
2414 INT in_Rs = -1;
2415 in_Rs = FLD (in_Rs);
2416 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2417 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2420 int referenced = 0;
2421 int UNUSED insn_referenced = abuf->written;
2422 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2425 int referenced = 0;
2426 int UNUSED insn_referenced = abuf->written;
2427 INT in_Rd = -1;
2428 INT in_Rs = -1;
2429 INT out_Rd = -1;
2430 in_Rd = FLD (in_Rd);
2431 in_Rs = FLD (in_Rs);
2432 referenced |= 1 << 0;
2433 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2434 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2436 return cycles;
2437 #undef FLD
2440 static int
2441 model_crisv32_sub_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2443 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2444 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2445 const IDESC * UNUSED idesc = abuf->idesc;
2446 int cycles = 0;
2448 int referenced = 0;
2449 int UNUSED insn_referenced = abuf->written;
2450 INT in_Rs = -1;
2451 in_Rs = FLD (in_Rs);
2452 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2453 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2456 int referenced = 0;
2457 int UNUSED insn_referenced = abuf->written;
2458 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2461 int referenced = 0;
2462 int UNUSED insn_referenced = abuf->written;
2463 INT in_Rd = -1;
2464 INT in_Rs = -1;
2465 INT out_Rd = -1;
2466 in_Rd = FLD (in_Rd);
2467 in_Rs = FLD (in_Rs);
2468 referenced |= 1 << 0;
2469 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2470 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2472 return cycles;
2473 #undef FLD
2476 static int
2477 model_crisv32_sub_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
2479 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2480 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2481 const IDESC * UNUSED idesc = abuf->idesc;
2482 int cycles = 0;
2484 int referenced = 0;
2485 int UNUSED insn_referenced = abuf->written;
2486 INT in_Rs = -1;
2487 in_Rs = FLD (in_Rs);
2488 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2489 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2492 int referenced = 0;
2493 int UNUSED insn_referenced = abuf->written;
2494 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2497 int referenced = 0;
2498 int UNUSED insn_referenced = abuf->written;
2499 INT in_Rd = -1;
2500 INT in_Rs = -1;
2501 INT out_Rd = -1;
2502 in_Rd = FLD (in_Rd);
2503 in_Rs = FLD (in_Rs);
2504 referenced |= 1 << 0;
2505 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2506 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2508 return cycles;
2509 #undef FLD
2512 static int
2513 model_crisv32_subcbr (SIM_CPU *current_cpu, void *sem_arg)
2515 #define FLD(f) abuf->fields.sfmt_addcbr.f
2516 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2517 const IDESC * UNUSED idesc = abuf->idesc;
2518 int cycles = 0;
2520 int referenced = 0;
2521 int UNUSED insn_referenced = abuf->written;
2522 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2525 int referenced = 0;
2526 int UNUSED insn_referenced = abuf->written;
2527 INT in_Rd = -1;
2528 INT in_Rs = -1;
2529 INT out_Rd = -1;
2530 in_Rd = FLD (in_Rd);
2531 referenced |= 1 << 0;
2532 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2534 return cycles;
2535 #undef FLD
2538 static int
2539 model_crisv32_subcwr (SIM_CPU *current_cpu, void *sem_arg)
2541 #define FLD(f) abuf->fields.sfmt_addcwr.f
2542 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2543 const IDESC * UNUSED idesc = abuf->idesc;
2544 int cycles = 0;
2546 int referenced = 0;
2547 int UNUSED insn_referenced = abuf->written;
2548 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2551 int referenced = 0;
2552 int UNUSED insn_referenced = abuf->written;
2553 INT in_Rd = -1;
2554 INT in_Rs = -1;
2555 INT out_Rd = -1;
2556 in_Rd = FLD (in_Rd);
2557 referenced |= 1 << 0;
2558 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2560 return cycles;
2561 #undef FLD
2564 static int
2565 model_crisv32_subcdr (SIM_CPU *current_cpu, void *sem_arg)
2567 #define FLD(f) abuf->fields.sfmt_addcdr.f
2568 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2569 const IDESC * UNUSED idesc = abuf->idesc;
2570 int cycles = 0;
2572 int referenced = 0;
2573 int UNUSED insn_referenced = abuf->written;
2574 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
2577 int referenced = 0;
2578 int UNUSED insn_referenced = abuf->written;
2579 INT in_Rd = -1;
2580 INT in_Rs = -1;
2581 INT out_Rd = -1;
2582 in_Rd = FLD (in_Rd);
2583 referenced |= 1 << 0;
2584 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2586 return cycles;
2587 #undef FLD
2590 static int
2591 model_crisv32_subs_b_r (SIM_CPU *current_cpu, void *sem_arg)
2593 #define FLD(f) abuf->fields.sfmt_addc_m.f
2594 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2595 const IDESC * UNUSED idesc = abuf->idesc;
2596 int cycles = 0;
2598 int referenced = 0;
2599 int UNUSED insn_referenced = abuf->written;
2600 INT in_Rd = -1;
2601 INT in_Rs = -1;
2602 INT out_Rd = -1;
2603 in_Rd = FLD (in_Rd);
2604 in_Rs = FLD (in_Rs);
2605 referenced |= 1 << 0;
2606 referenced |= 1 << 1;
2607 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2609 return cycles;
2610 #undef FLD
2613 static int
2614 model_crisv32_subs_w_r (SIM_CPU *current_cpu, void *sem_arg)
2616 #define FLD(f) abuf->fields.sfmt_addc_m.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_Rd = -1;
2624 INT in_Rs = -1;
2625 INT out_Rd = -1;
2626 in_Rd = FLD (in_Rd);
2627 in_Rs = FLD (in_Rs);
2628 referenced |= 1 << 0;
2629 referenced |= 1 << 1;
2630 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2632 return cycles;
2633 #undef FLD
2636 static int
2637 model_crisv32_subs_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2639 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2640 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2641 const IDESC * UNUSED idesc = abuf->idesc;
2642 int cycles = 0;
2644 int referenced = 0;
2645 int UNUSED insn_referenced = abuf->written;
2646 INT in_Rs = -1;
2647 in_Rs = FLD (in_Rs);
2648 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2649 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2652 int referenced = 0;
2653 int UNUSED insn_referenced = abuf->written;
2654 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2657 int referenced = 0;
2658 int UNUSED insn_referenced = abuf->written;
2659 INT in_Rd = -1;
2660 INT in_Rs = -1;
2661 INT out_Rd = -1;
2662 in_Rd = FLD (in_Rd);
2663 in_Rs = FLD (in_Rs);
2664 referenced |= 1 << 0;
2665 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2666 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2668 return cycles;
2669 #undef FLD
2672 static int
2673 model_crisv32_subs_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2675 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2676 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2677 const IDESC * UNUSED idesc = abuf->idesc;
2678 int cycles = 0;
2680 int referenced = 0;
2681 int UNUSED insn_referenced = abuf->written;
2682 INT in_Rs = -1;
2683 in_Rs = FLD (in_Rs);
2684 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2685 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2688 int referenced = 0;
2689 int UNUSED insn_referenced = abuf->written;
2690 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2693 int referenced = 0;
2694 int UNUSED insn_referenced = abuf->written;
2695 INT in_Rd = -1;
2696 INT in_Rs = -1;
2697 INT out_Rd = -1;
2698 in_Rd = FLD (in_Rd);
2699 in_Rs = FLD (in_Rs);
2700 referenced |= 1 << 0;
2701 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2702 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2704 return cycles;
2705 #undef FLD
2708 static int
2709 model_crisv32_subscbr (SIM_CPU *current_cpu, void *sem_arg)
2711 #define FLD(f) abuf->fields.sfmt_addcbr.f
2712 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2713 const IDESC * UNUSED idesc = abuf->idesc;
2714 int cycles = 0;
2716 int referenced = 0;
2717 int UNUSED insn_referenced = abuf->written;
2718 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2721 int referenced = 0;
2722 int UNUSED insn_referenced = abuf->written;
2723 INT in_Rd = -1;
2724 INT in_Rs = -1;
2725 INT out_Rd = -1;
2726 in_Rd = FLD (in_Rd);
2727 referenced |= 1 << 0;
2728 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2730 return cycles;
2731 #undef FLD
2734 static int
2735 model_crisv32_subscwr (SIM_CPU *current_cpu, void *sem_arg)
2737 #define FLD(f) abuf->fields.sfmt_addcwr.f
2738 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2739 const IDESC * UNUSED idesc = abuf->idesc;
2740 int cycles = 0;
2742 int referenced = 0;
2743 int UNUSED insn_referenced = abuf->written;
2744 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2747 int referenced = 0;
2748 int UNUSED insn_referenced = abuf->written;
2749 INT in_Rd = -1;
2750 INT in_Rs = -1;
2751 INT out_Rd = -1;
2752 in_Rd = FLD (in_Rd);
2753 referenced |= 1 << 0;
2754 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2756 return cycles;
2757 #undef FLD
2760 static int
2761 model_crisv32_subu_b_r (SIM_CPU *current_cpu, void *sem_arg)
2763 #define FLD(f) abuf->fields.sfmt_addc_m.f
2764 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2765 const IDESC * UNUSED idesc = abuf->idesc;
2766 int cycles = 0;
2768 int referenced = 0;
2769 int UNUSED insn_referenced = abuf->written;
2770 INT in_Rd = -1;
2771 INT in_Rs = -1;
2772 INT out_Rd = -1;
2773 in_Rd = FLD (in_Rd);
2774 in_Rs = FLD (in_Rs);
2775 referenced |= 1 << 0;
2776 referenced |= 1 << 1;
2777 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2779 return cycles;
2780 #undef FLD
2783 static int
2784 model_crisv32_subu_w_r (SIM_CPU *current_cpu, void *sem_arg)
2786 #define FLD(f) abuf->fields.sfmt_addc_m.f
2787 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2788 const IDESC * UNUSED idesc = abuf->idesc;
2789 int cycles = 0;
2791 int referenced = 0;
2792 int UNUSED insn_referenced = abuf->written;
2793 INT in_Rd = -1;
2794 INT in_Rs = -1;
2795 INT out_Rd = -1;
2796 in_Rd = FLD (in_Rd);
2797 in_Rs = FLD (in_Rs);
2798 referenced |= 1 << 0;
2799 referenced |= 1 << 1;
2800 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2802 return cycles;
2803 #undef FLD
2806 static int
2807 model_crisv32_subu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2809 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2810 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2811 const IDESC * UNUSED idesc = abuf->idesc;
2812 int cycles = 0;
2814 int referenced = 0;
2815 int UNUSED insn_referenced = abuf->written;
2816 INT in_Rs = -1;
2817 in_Rs = FLD (in_Rs);
2818 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2819 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2822 int referenced = 0;
2823 int UNUSED insn_referenced = abuf->written;
2824 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2827 int referenced = 0;
2828 int UNUSED insn_referenced = abuf->written;
2829 INT in_Rd = -1;
2830 INT in_Rs = -1;
2831 INT out_Rd = -1;
2832 in_Rd = FLD (in_Rd);
2833 in_Rs = FLD (in_Rs);
2834 referenced |= 1 << 0;
2835 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2836 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2838 return cycles;
2839 #undef FLD
2842 static int
2843 model_crisv32_subu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2845 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2846 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2847 const IDESC * UNUSED idesc = abuf->idesc;
2848 int cycles = 0;
2850 int referenced = 0;
2851 int UNUSED insn_referenced = abuf->written;
2852 INT in_Rs = -1;
2853 in_Rs = FLD (in_Rs);
2854 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2855 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2858 int referenced = 0;
2859 int UNUSED insn_referenced = abuf->written;
2860 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2863 int referenced = 0;
2864 int UNUSED insn_referenced = abuf->written;
2865 INT in_Rd = -1;
2866 INT in_Rs = -1;
2867 INT out_Rd = -1;
2868 in_Rd = FLD (in_Rd);
2869 in_Rs = FLD (in_Rs);
2870 referenced |= 1 << 0;
2871 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2872 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2874 return cycles;
2875 #undef FLD
2878 static int
2879 model_crisv32_subucbr (SIM_CPU *current_cpu, void *sem_arg)
2881 #define FLD(f) abuf->fields.sfmt_addcbr.f
2882 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2883 const IDESC * UNUSED idesc = abuf->idesc;
2884 int cycles = 0;
2886 int referenced = 0;
2887 int UNUSED insn_referenced = abuf->written;
2888 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2891 int referenced = 0;
2892 int UNUSED insn_referenced = abuf->written;
2893 INT in_Rd = -1;
2894 INT in_Rs = -1;
2895 INT out_Rd = -1;
2896 in_Rd = FLD (in_Rd);
2897 referenced |= 1 << 0;
2898 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2900 return cycles;
2901 #undef FLD
2904 static int
2905 model_crisv32_subucwr (SIM_CPU *current_cpu, void *sem_arg)
2907 #define FLD(f) abuf->fields.sfmt_addcwr.f
2908 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2909 const IDESC * UNUSED idesc = abuf->idesc;
2910 int cycles = 0;
2912 int referenced = 0;
2913 int UNUSED insn_referenced = abuf->written;
2914 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2917 int referenced = 0;
2918 int UNUSED insn_referenced = abuf->written;
2919 INT in_Rd = -1;
2920 INT in_Rs = -1;
2921 INT out_Rd = -1;
2922 in_Rd = FLD (in_Rd);
2923 referenced |= 1 << 0;
2924 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2926 return cycles;
2927 #undef FLD
2930 static int
2931 model_crisv32_addc_r (SIM_CPU *current_cpu, void *sem_arg)
2933 #define FLD(f) abuf->fields.sfmt_addc_m.f
2934 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2935 const IDESC * UNUSED idesc = abuf->idesc;
2936 int cycles = 0;
2938 int referenced = 0;
2939 int UNUSED insn_referenced = abuf->written;
2940 INT in_Rd = -1;
2941 INT in_Rs = -1;
2942 INT out_Rd = -1;
2943 in_Rd = FLD (in_Rd);
2944 in_Rs = FLD (in_Rs);
2945 referenced |= 1 << 0;
2946 referenced |= 1 << 1;
2947 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2949 return cycles;
2950 #undef FLD
2953 static int
2954 model_crisv32_addc_m (SIM_CPU *current_cpu, void *sem_arg)
2956 #define FLD(f) abuf->fields.sfmt_addc_m.f
2957 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2958 const IDESC * UNUSED idesc = abuf->idesc;
2959 int cycles = 0;
2961 int referenced = 0;
2962 int UNUSED insn_referenced = abuf->written;
2963 INT in_Rs = -1;
2964 in_Rs = FLD (in_Rs);
2965 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2966 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2969 int referenced = 0;
2970 int UNUSED insn_referenced = abuf->written;
2971 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2974 int referenced = 0;
2975 int UNUSED insn_referenced = abuf->written;
2976 INT in_Rd = -1;
2977 INT in_Rs = -1;
2978 INT out_Rd = -1;
2979 in_Rd = FLD (in_Rd);
2980 in_Rs = FLD (in_Rs);
2981 referenced |= 1 << 0;
2982 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2983 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2985 return cycles;
2986 #undef FLD
2989 static int
2990 model_crisv32_addc_c (SIM_CPU *current_cpu, void *sem_arg)
2992 #define FLD(f) abuf->fields.sfmt_addcdr.f
2993 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2994 const IDESC * UNUSED idesc = abuf->idesc;
2995 int cycles = 0;
2997 int referenced = 0;
2998 int UNUSED insn_referenced = abuf->written;
2999 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3002 int referenced = 0;
3003 int UNUSED insn_referenced = abuf->written;
3004 INT in_Rd = -1;
3005 INT in_Rs = -1;
3006 INT out_Rd = -1;
3007 in_Rd = FLD (in_Rd);
3008 referenced |= 1 << 0;
3009 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3011 return cycles;
3012 #undef FLD
3015 static int
3016 model_crisv32_lapc_d (SIM_CPU *current_cpu, void *sem_arg)
3018 #define FLD(f) abuf->fields.sfmt_lapc_d.f
3019 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3020 const IDESC * UNUSED idesc = abuf->idesc;
3021 int cycles = 0;
3023 int referenced = 0;
3024 int UNUSED insn_referenced = abuf->written;
3025 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3028 int referenced = 0;
3029 int UNUSED insn_referenced = abuf->written;
3030 INT in_Rd = -1;
3031 INT in_Rs = -1;
3032 INT out_Rd = -1;
3033 out_Rd = FLD (out_Rd);
3034 referenced |= 1 << 2;
3035 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3037 return cycles;
3038 #undef FLD
3041 static int
3042 model_crisv32_lapcq (SIM_CPU *current_cpu, void *sem_arg)
3044 #define FLD(f) abuf->fields.sfmt_lapcq.f
3045 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3046 const IDESC * UNUSED idesc = abuf->idesc;
3047 int cycles = 0;
3049 int referenced = 0;
3050 int UNUSED insn_referenced = abuf->written;
3051 INT in_Rd = -1;
3052 INT in_Rs = -1;
3053 INT out_Rd = -1;
3054 out_Rd = FLD (out_Rd);
3055 referenced |= 1 << 2;
3056 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3058 return cycles;
3059 #undef FLD
3062 static int
3063 model_crisv32_addi_b_r (SIM_CPU *current_cpu, void *sem_arg)
3065 #define FLD(f) abuf->fields.sfmt_addc_m.f
3066 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3067 const IDESC * UNUSED idesc = abuf->idesc;
3068 int cycles = 0;
3070 int referenced = 0;
3071 int UNUSED insn_referenced = abuf->written;
3072 INT in_Rd = -1;
3073 INT in_Rs = -1;
3074 INT out_Rd = -1;
3075 in_Rd = FLD (in_Rd);
3076 in_Rs = FLD (in_Rs);
3077 referenced |= 1 << 0;
3078 referenced |= 1 << 1;
3079 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3081 return cycles;
3082 #undef FLD
3085 static int
3086 model_crisv32_addi_w_r (SIM_CPU *current_cpu, void *sem_arg)
3088 #define FLD(f) abuf->fields.sfmt_addc_m.f
3089 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3090 const IDESC * UNUSED idesc = abuf->idesc;
3091 int cycles = 0;
3093 int referenced = 0;
3094 int UNUSED insn_referenced = abuf->written;
3095 INT in_Rd = -1;
3096 INT in_Rs = -1;
3097 INT out_Rd = -1;
3098 in_Rd = FLD (in_Rd);
3099 in_Rs = FLD (in_Rs);
3100 referenced |= 1 << 0;
3101 referenced |= 1 << 1;
3102 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3104 return cycles;
3105 #undef FLD
3108 static int
3109 model_crisv32_addi_d_r (SIM_CPU *current_cpu, void *sem_arg)
3111 #define FLD(f) abuf->fields.sfmt_addc_m.f
3112 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3113 const IDESC * UNUSED idesc = abuf->idesc;
3114 int cycles = 0;
3116 int referenced = 0;
3117 int UNUSED insn_referenced = abuf->written;
3118 INT in_Rd = -1;
3119 INT in_Rs = -1;
3120 INT out_Rd = -1;
3121 in_Rd = FLD (in_Rd);
3122 in_Rs = FLD (in_Rs);
3123 referenced |= 1 << 0;
3124 referenced |= 1 << 1;
3125 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3127 return cycles;
3128 #undef FLD
3131 static int
3132 model_crisv32_neg_b_r (SIM_CPU *current_cpu, void *sem_arg)
3134 #define FLD(f) abuf->fields.sfmt_addc_m.f
3135 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3136 const IDESC * UNUSED idesc = abuf->idesc;
3137 int cycles = 0;
3139 int referenced = 0;
3140 int UNUSED insn_referenced = abuf->written;
3141 INT in_Rd = -1;
3142 INT in_Rs = -1;
3143 INT out_Rd = -1;
3144 in_Rs = FLD (in_Rs);
3145 referenced |= 1 << 1;
3146 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3148 return cycles;
3149 #undef FLD
3152 static int
3153 model_crisv32_neg_w_r (SIM_CPU *current_cpu, void *sem_arg)
3155 #define FLD(f) abuf->fields.sfmt_addc_m.f
3156 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3157 const IDESC * UNUSED idesc = abuf->idesc;
3158 int cycles = 0;
3160 int referenced = 0;
3161 int UNUSED insn_referenced = abuf->written;
3162 INT in_Rd = -1;
3163 INT in_Rs = -1;
3164 INT out_Rd = -1;
3165 in_Rs = FLD (in_Rs);
3166 referenced |= 1 << 1;
3167 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3169 return cycles;
3170 #undef FLD
3173 static int
3174 model_crisv32_neg_d_r (SIM_CPU *current_cpu, void *sem_arg)
3176 #define FLD(f) abuf->fields.sfmt_addc_m.f
3177 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3178 const IDESC * UNUSED idesc = abuf->idesc;
3179 int cycles = 0;
3181 int referenced = 0;
3182 int UNUSED insn_referenced = abuf->written;
3183 INT in_Rd = -1;
3184 INT in_Rs = -1;
3185 INT out_Rd = -1;
3186 in_Rs = FLD (in_Rs);
3187 referenced |= 1 << 1;
3188 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3190 return cycles;
3191 #undef FLD
3194 static int
3195 model_crisv32_test_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3197 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3198 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3199 const IDESC * UNUSED idesc = abuf->idesc;
3200 int cycles = 0;
3202 int referenced = 0;
3203 int UNUSED insn_referenced = abuf->written;
3204 INT in_Rs = -1;
3205 in_Rs = FLD (in_Rs);
3206 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3207 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3210 int referenced = 0;
3211 int UNUSED insn_referenced = abuf->written;
3212 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3215 int referenced = 0;
3216 int UNUSED insn_referenced = abuf->written;
3217 INT in_Rd = -1;
3218 INT in_Rs = -1;
3219 INT out_Rd = -1;
3220 in_Rs = FLD (in_Rs);
3221 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3222 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3224 return cycles;
3225 #undef FLD
3228 static int
3229 model_crisv32_test_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3231 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3232 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3233 const IDESC * UNUSED idesc = abuf->idesc;
3234 int cycles = 0;
3236 int referenced = 0;
3237 int UNUSED insn_referenced = abuf->written;
3238 INT in_Rs = -1;
3239 in_Rs = FLD (in_Rs);
3240 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3241 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3244 int referenced = 0;
3245 int UNUSED insn_referenced = abuf->written;
3246 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3249 int referenced = 0;
3250 int UNUSED insn_referenced = abuf->written;
3251 INT in_Rd = -1;
3252 INT in_Rs = -1;
3253 INT out_Rd = -1;
3254 in_Rs = FLD (in_Rs);
3255 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3256 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3258 return cycles;
3259 #undef FLD
3262 static int
3263 model_crisv32_test_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3265 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3266 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3267 const IDESC * UNUSED idesc = abuf->idesc;
3268 int cycles = 0;
3270 int referenced = 0;
3271 int UNUSED insn_referenced = abuf->written;
3272 INT in_Rs = -1;
3273 in_Rs = FLD (in_Rs);
3274 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3275 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3278 int referenced = 0;
3279 int UNUSED insn_referenced = abuf->written;
3280 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3283 int referenced = 0;
3284 int UNUSED insn_referenced = abuf->written;
3285 INT in_Rd = -1;
3286 INT in_Rs = -1;
3287 INT out_Rd = -1;
3288 in_Rs = FLD (in_Rs);
3289 if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3290 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3292 return cycles;
3293 #undef FLD
3296 static int
3297 model_crisv32_move_r_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3299 #define FLD(f) abuf->fields.sfmt_addc_m.f
3300 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3301 const IDESC * UNUSED idesc = abuf->idesc;
3302 int cycles = 0;
3304 int referenced = 0;
3305 int UNUSED insn_referenced = abuf->written;
3306 INT in_Rs = -1;
3307 in_Rs = FLD (in_Rs);
3308 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3309 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3312 int referenced = 0;
3313 int UNUSED insn_referenced = abuf->written;
3314 INT in_Rd = -1;
3315 INT in_Rs = -1;
3316 INT out_Rd = -1;
3317 in_Rd = FLD (in_Rd);
3318 in_Rs = FLD (in_Rs);
3319 referenced |= 1 << 0;
3320 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3321 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3324 int referenced = 0;
3325 int UNUSED insn_referenced = abuf->written;
3326 cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3328 return cycles;
3329 #undef FLD
3332 static int
3333 model_crisv32_move_r_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3335 #define FLD(f) abuf->fields.sfmt_addc_m.f
3336 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3337 const IDESC * UNUSED idesc = abuf->idesc;
3338 int cycles = 0;
3340 int referenced = 0;
3341 int UNUSED insn_referenced = abuf->written;
3342 INT in_Rs = -1;
3343 in_Rs = FLD (in_Rs);
3344 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3345 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3348 int referenced = 0;
3349 int UNUSED insn_referenced = abuf->written;
3350 INT in_Rd = -1;
3351 INT in_Rs = -1;
3352 INT out_Rd = -1;
3353 in_Rd = FLD (in_Rd);
3354 in_Rs = FLD (in_Rs);
3355 referenced |= 1 << 0;
3356 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3357 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3360 int referenced = 0;
3361 int UNUSED insn_referenced = abuf->written;
3362 cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3364 return cycles;
3365 #undef FLD
3368 static int
3369 model_crisv32_move_r_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3371 #define FLD(f) abuf->fields.sfmt_addc_m.f
3372 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3373 const IDESC * UNUSED idesc = abuf->idesc;
3374 int cycles = 0;
3376 int referenced = 0;
3377 int UNUSED insn_referenced = abuf->written;
3378 INT in_Rs = -1;
3379 in_Rs = FLD (in_Rs);
3380 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3381 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3384 int referenced = 0;
3385 int UNUSED insn_referenced = abuf->written;
3386 INT in_Rd = -1;
3387 INT in_Rs = -1;
3388 INT out_Rd = -1;
3389 in_Rd = FLD (in_Rd);
3390 in_Rs = FLD (in_Rs);
3391 referenced |= 1 << 0;
3392 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3393 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3396 int referenced = 0;
3397 int UNUSED insn_referenced = abuf->written;
3398 cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3400 return cycles;
3401 #undef FLD
3404 static int
3405 model_crisv32_muls_b (SIM_CPU *current_cpu, void *sem_arg)
3407 #define FLD(f) abuf->fields.sfmt_muls_b.f
3408 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3409 const IDESC * UNUSED idesc = abuf->idesc;
3410 int cycles = 0;
3412 int referenced = 0;
3413 int UNUSED insn_referenced = abuf->written;
3414 INT in_Rs = -1;
3415 INT in_Rd = -1;
3416 in_Rs = FLD (in_Rs);
3417 in_Rd = FLD (in_Rd);
3418 referenced |= 1 << 0;
3419 referenced |= 1 << 1;
3420 cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3423 int referenced = 0;
3424 int UNUSED insn_referenced = abuf->written;
3425 INT in_Rd = -1;
3426 INT in_Rs = -1;
3427 INT out_Rd = -1;
3428 in_Rd = FLD (in_Rd);
3429 in_Rs = FLD (in_Rs);
3430 out_Rd = FLD (out_Rd);
3431 referenced |= 1 << 0;
3432 referenced |= 1 << 1;
3433 referenced |= 1 << 2;
3434 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3436 return cycles;
3437 #undef FLD
3440 static int
3441 model_crisv32_muls_w (SIM_CPU *current_cpu, void *sem_arg)
3443 #define FLD(f) abuf->fields.sfmt_muls_b.f
3444 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3445 const IDESC * UNUSED idesc = abuf->idesc;
3446 int cycles = 0;
3448 int referenced = 0;
3449 int UNUSED insn_referenced = abuf->written;
3450 INT in_Rs = -1;
3451 INT in_Rd = -1;
3452 in_Rs = FLD (in_Rs);
3453 in_Rd = FLD (in_Rd);
3454 referenced |= 1 << 0;
3455 referenced |= 1 << 1;
3456 cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3459 int referenced = 0;
3460 int UNUSED insn_referenced = abuf->written;
3461 INT in_Rd = -1;
3462 INT in_Rs = -1;
3463 INT out_Rd = -1;
3464 in_Rd = FLD (in_Rd);
3465 in_Rs = FLD (in_Rs);
3466 out_Rd = FLD (out_Rd);
3467 referenced |= 1 << 0;
3468 referenced |= 1 << 1;
3469 referenced |= 1 << 2;
3470 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3472 return cycles;
3473 #undef FLD
3476 static int
3477 model_crisv32_muls_d (SIM_CPU *current_cpu, void *sem_arg)
3479 #define FLD(f) abuf->fields.sfmt_muls_b.f
3480 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3481 const IDESC * UNUSED idesc = abuf->idesc;
3482 int cycles = 0;
3484 int referenced = 0;
3485 int UNUSED insn_referenced = abuf->written;
3486 INT in_Rs = -1;
3487 INT in_Rd = -1;
3488 in_Rs = FLD (in_Rs);
3489 in_Rd = FLD (in_Rd);
3490 referenced |= 1 << 0;
3491 referenced |= 1 << 1;
3492 cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3495 int referenced = 0;
3496 int UNUSED insn_referenced = abuf->written;
3497 INT in_Rd = -1;
3498 INT in_Rs = -1;
3499 INT out_Rd = -1;
3500 in_Rd = FLD (in_Rd);
3501 in_Rs = FLD (in_Rs);
3502 out_Rd = FLD (out_Rd);
3503 referenced |= 1 << 0;
3504 referenced |= 1 << 1;
3505 referenced |= 1 << 2;
3506 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3508 return cycles;
3509 #undef FLD
3512 static int
3513 model_crisv32_mulu_b (SIM_CPU *current_cpu, void *sem_arg)
3515 #define FLD(f) abuf->fields.sfmt_muls_b.f
3516 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3517 const IDESC * UNUSED idesc = abuf->idesc;
3518 int cycles = 0;
3520 int referenced = 0;
3521 int UNUSED insn_referenced = abuf->written;
3522 INT in_Rs = -1;
3523 INT in_Rd = -1;
3524 in_Rs = FLD (in_Rs);
3525 in_Rd = FLD (in_Rd);
3526 referenced |= 1 << 0;
3527 referenced |= 1 << 1;
3528 cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3531 int referenced = 0;
3532 int UNUSED insn_referenced = abuf->written;
3533 INT in_Rd = -1;
3534 INT in_Rs = -1;
3535 INT out_Rd = -1;
3536 in_Rd = FLD (in_Rd);
3537 in_Rs = FLD (in_Rs);
3538 out_Rd = FLD (out_Rd);
3539 referenced |= 1 << 0;
3540 referenced |= 1 << 1;
3541 referenced |= 1 << 2;
3542 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3544 return cycles;
3545 #undef FLD
3548 static int
3549 model_crisv32_mulu_w (SIM_CPU *current_cpu, void *sem_arg)
3551 #define FLD(f) abuf->fields.sfmt_muls_b.f
3552 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3553 const IDESC * UNUSED idesc = abuf->idesc;
3554 int cycles = 0;
3556 int referenced = 0;
3557 int UNUSED insn_referenced = abuf->written;
3558 INT in_Rs = -1;
3559 INT in_Rd = -1;
3560 in_Rs = FLD (in_Rs);
3561 in_Rd = FLD (in_Rd);
3562 referenced |= 1 << 0;
3563 referenced |= 1 << 1;
3564 cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3567 int referenced = 0;
3568 int UNUSED insn_referenced = abuf->written;
3569 INT in_Rd = -1;
3570 INT in_Rs = -1;
3571 INT out_Rd = -1;
3572 in_Rd = FLD (in_Rd);
3573 in_Rs = FLD (in_Rs);
3574 out_Rd = FLD (out_Rd);
3575 referenced |= 1 << 0;
3576 referenced |= 1 << 1;
3577 referenced |= 1 << 2;
3578 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3580 return cycles;
3581 #undef FLD
3584 static int
3585 model_crisv32_mulu_d (SIM_CPU *current_cpu, void *sem_arg)
3587 #define FLD(f) abuf->fields.sfmt_muls_b.f
3588 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3589 const IDESC * UNUSED idesc = abuf->idesc;
3590 int cycles = 0;
3592 int referenced = 0;
3593 int UNUSED insn_referenced = abuf->written;
3594 INT in_Rs = -1;
3595 INT in_Rd = -1;
3596 in_Rs = FLD (in_Rs);
3597 in_Rd = FLD (in_Rd);
3598 referenced |= 1 << 0;
3599 referenced |= 1 << 1;
3600 cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3603 int referenced = 0;
3604 int UNUSED insn_referenced = abuf->written;
3605 INT in_Rd = -1;
3606 INT in_Rs = -1;
3607 INT out_Rd = -1;
3608 in_Rd = FLD (in_Rd);
3609 in_Rs = FLD (in_Rs);
3610 out_Rd = FLD (out_Rd);
3611 referenced |= 1 << 0;
3612 referenced |= 1 << 1;
3613 referenced |= 1 << 2;
3614 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3616 return cycles;
3617 #undef FLD
3620 static int
3621 model_crisv32_mcp (SIM_CPU *current_cpu, void *sem_arg)
3623 #define FLD(f) abuf->fields.sfmt_mcp.f
3624 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3625 const IDESC * UNUSED idesc = abuf->idesc;
3626 int cycles = 0;
3628 int referenced = 0;
3629 int UNUSED insn_referenced = abuf->written;
3630 INT in_Rd = -1;
3631 INT in_Rs = -1;
3632 INT out_Rd = -1;
3633 in_Rs = FLD (in_Rs);
3634 referenced |= 1 << 1;
3635 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3637 return cycles;
3638 #undef FLD
3641 static int
3642 model_crisv32_dstep (SIM_CPU *current_cpu, void *sem_arg)
3644 #define FLD(f) abuf->fields.sfmt_muls_b.f
3645 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3646 const IDESC * UNUSED idesc = abuf->idesc;
3647 int cycles = 0;
3649 int referenced = 0;
3650 int UNUSED insn_referenced = abuf->written;
3651 INT in_Rd = -1;
3652 INT in_Rs = -1;
3653 INT out_Rd = -1;
3654 in_Rd = FLD (in_Rd);
3655 in_Rs = FLD (in_Rs);
3656 out_Rd = FLD (out_Rd);
3657 referenced |= 1 << 0;
3658 referenced |= 1 << 1;
3659 referenced |= 1 << 2;
3660 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3662 return cycles;
3663 #undef FLD
3666 static int
3667 model_crisv32_abs (SIM_CPU *current_cpu, void *sem_arg)
3669 #define FLD(f) abuf->fields.sfmt_muls_b.f
3670 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3671 const IDESC * UNUSED idesc = abuf->idesc;
3672 int cycles = 0;
3674 int referenced = 0;
3675 int UNUSED insn_referenced = abuf->written;
3676 INT in_Rd = -1;
3677 INT in_Rs = -1;
3678 INT out_Rd = -1;
3679 in_Rs = FLD (in_Rs);
3680 out_Rd = FLD (out_Rd);
3681 referenced |= 1 << 1;
3682 referenced |= 1 << 2;
3683 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3685 return cycles;
3686 #undef FLD
3689 static int
3690 model_crisv32_and_b_r (SIM_CPU *current_cpu, void *sem_arg)
3692 #define FLD(f) abuf->fields.sfmt_addc_m.f
3693 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3694 const IDESC * UNUSED idesc = abuf->idesc;
3695 int cycles = 0;
3697 int referenced = 0;
3698 int UNUSED insn_referenced = abuf->written;
3699 INT in_Rd = -1;
3700 INT in_Rs = -1;
3701 INT out_Rd = -1;
3702 in_Rd = FLD (in_Rd);
3703 in_Rs = FLD (in_Rs);
3704 referenced |= 1 << 0;
3705 referenced |= 1 << 1;
3706 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3708 return cycles;
3709 #undef FLD
3712 static int
3713 model_crisv32_and_w_r (SIM_CPU *current_cpu, void *sem_arg)
3715 #define FLD(f) abuf->fields.sfmt_addc_m.f
3716 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3717 const IDESC * UNUSED idesc = abuf->idesc;
3718 int cycles = 0;
3720 int referenced = 0;
3721 int UNUSED insn_referenced = abuf->written;
3722 INT in_Rd = -1;
3723 INT in_Rs = -1;
3724 INT out_Rd = -1;
3725 in_Rd = FLD (in_Rd);
3726 in_Rs = FLD (in_Rs);
3727 referenced |= 1 << 0;
3728 referenced |= 1 << 1;
3729 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3731 return cycles;
3732 #undef FLD
3735 static int
3736 model_crisv32_and_d_r (SIM_CPU *current_cpu, void *sem_arg)
3738 #define FLD(f) abuf->fields.sfmt_addc_m.f
3739 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3740 const IDESC * UNUSED idesc = abuf->idesc;
3741 int cycles = 0;
3743 int referenced = 0;
3744 int UNUSED insn_referenced = abuf->written;
3745 INT in_Rd = -1;
3746 INT in_Rs = -1;
3747 INT out_Rd = -1;
3748 in_Rd = FLD (in_Rd);
3749 in_Rs = FLD (in_Rs);
3750 referenced |= 1 << 0;
3751 referenced |= 1 << 1;
3752 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3754 return cycles;
3755 #undef FLD
3758 static int
3759 model_crisv32_and_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3761 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3762 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3763 const IDESC * UNUSED idesc = abuf->idesc;
3764 int cycles = 0;
3766 int referenced = 0;
3767 int UNUSED insn_referenced = abuf->written;
3768 INT in_Rs = -1;
3769 in_Rs = FLD (in_Rs);
3770 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3771 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3774 int referenced = 0;
3775 int UNUSED insn_referenced = abuf->written;
3776 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3779 int referenced = 0;
3780 int UNUSED insn_referenced = abuf->written;
3781 INT in_Rd = -1;
3782 INT in_Rs = -1;
3783 INT out_Rd = -1;
3784 in_Rd = FLD (in_Rd);
3785 in_Rs = FLD (in_Rs);
3786 referenced |= 1 << 0;
3787 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3788 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3790 return cycles;
3791 #undef FLD
3794 static int
3795 model_crisv32_and_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3797 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3798 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3799 const IDESC * UNUSED idesc = abuf->idesc;
3800 int cycles = 0;
3802 int referenced = 0;
3803 int UNUSED insn_referenced = abuf->written;
3804 INT in_Rs = -1;
3805 in_Rs = FLD (in_Rs);
3806 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3807 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3810 int referenced = 0;
3811 int UNUSED insn_referenced = abuf->written;
3812 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3815 int referenced = 0;
3816 int UNUSED insn_referenced = abuf->written;
3817 INT in_Rd = -1;
3818 INT in_Rs = -1;
3819 INT out_Rd = -1;
3820 in_Rd = FLD (in_Rd);
3821 in_Rs = FLD (in_Rs);
3822 referenced |= 1 << 0;
3823 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3824 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3826 return cycles;
3827 #undef FLD
3830 static int
3831 model_crisv32_and_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3833 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3834 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3835 const IDESC * UNUSED idesc = abuf->idesc;
3836 int cycles = 0;
3838 int referenced = 0;
3839 int UNUSED insn_referenced = abuf->written;
3840 INT in_Rs = -1;
3841 in_Rs = FLD (in_Rs);
3842 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3843 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3846 int referenced = 0;
3847 int UNUSED insn_referenced = abuf->written;
3848 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3851 int referenced = 0;
3852 int UNUSED insn_referenced = abuf->written;
3853 INT in_Rd = -1;
3854 INT in_Rs = -1;
3855 INT out_Rd = -1;
3856 in_Rd = FLD (in_Rd);
3857 in_Rs = FLD (in_Rs);
3858 referenced |= 1 << 0;
3859 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3860 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3862 return cycles;
3863 #undef FLD
3866 static int
3867 model_crisv32_andcbr (SIM_CPU *current_cpu, void *sem_arg)
3869 #define FLD(f) abuf->fields.sfmt_addcbr.f
3870 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3871 const IDESC * UNUSED idesc = abuf->idesc;
3872 int cycles = 0;
3874 int referenced = 0;
3875 int UNUSED insn_referenced = abuf->written;
3876 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
3879 int referenced = 0;
3880 int UNUSED insn_referenced = abuf->written;
3881 INT in_Rd = -1;
3882 INT in_Rs = -1;
3883 INT out_Rd = -1;
3884 in_Rd = FLD (in_Rd);
3885 referenced |= 1 << 0;
3886 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3888 return cycles;
3889 #undef FLD
3892 static int
3893 model_crisv32_andcwr (SIM_CPU *current_cpu, void *sem_arg)
3895 #define FLD(f) abuf->fields.sfmt_addcwr.f
3896 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3897 const IDESC * UNUSED idesc = abuf->idesc;
3898 int cycles = 0;
3900 int referenced = 0;
3901 int UNUSED insn_referenced = abuf->written;
3902 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
3905 int referenced = 0;
3906 int UNUSED insn_referenced = abuf->written;
3907 INT in_Rd = -1;
3908 INT in_Rs = -1;
3909 INT out_Rd = -1;
3910 in_Rd = FLD (in_Rd);
3911 referenced |= 1 << 0;
3912 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3914 return cycles;
3915 #undef FLD
3918 static int
3919 model_crisv32_andcdr (SIM_CPU *current_cpu, void *sem_arg)
3921 #define FLD(f) abuf->fields.sfmt_addcdr.f
3922 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3923 const IDESC * UNUSED idesc = abuf->idesc;
3924 int cycles = 0;
3926 int referenced = 0;
3927 int UNUSED insn_referenced = abuf->written;
3928 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3931 int referenced = 0;
3932 int UNUSED insn_referenced = abuf->written;
3933 INT in_Rd = -1;
3934 INT in_Rs = -1;
3935 INT out_Rd = -1;
3936 in_Rd = FLD (in_Rd);
3937 referenced |= 1 << 0;
3938 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3940 return cycles;
3941 #undef FLD
3944 static int
3945 model_crisv32_andq (SIM_CPU *current_cpu, void *sem_arg)
3947 #define FLD(f) abuf->fields.sfmt_andq.f
3948 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3949 const IDESC * UNUSED idesc = abuf->idesc;
3950 int cycles = 0;
3952 int referenced = 0;
3953 int UNUSED insn_referenced = abuf->written;
3954 INT in_Rd = -1;
3955 INT in_Rs = -1;
3956 INT out_Rd = -1;
3957 in_Rd = FLD (in_Rd);
3958 referenced |= 1 << 0;
3959 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3961 return cycles;
3962 #undef FLD
3965 static int
3966 model_crisv32_orr_b_r (SIM_CPU *current_cpu, void *sem_arg)
3968 #define FLD(f) abuf->fields.sfmt_addc_m.f
3969 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3970 const IDESC * UNUSED idesc = abuf->idesc;
3971 int cycles = 0;
3973 int referenced = 0;
3974 int UNUSED insn_referenced = abuf->written;
3975 INT in_Rd = -1;
3976 INT in_Rs = -1;
3977 INT out_Rd = -1;
3978 in_Rd = FLD (in_Rd);
3979 in_Rs = FLD (in_Rs);
3980 referenced |= 1 << 0;
3981 referenced |= 1 << 1;
3982 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3984 return cycles;
3985 #undef FLD
3988 static int
3989 model_crisv32_orr_w_r (SIM_CPU *current_cpu, void *sem_arg)
3991 #define FLD(f) abuf->fields.sfmt_addc_m.f
3992 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3993 const IDESC * UNUSED idesc = abuf->idesc;
3994 int cycles = 0;
3996 int referenced = 0;
3997 int UNUSED insn_referenced = abuf->written;
3998 INT in_Rd = -1;
3999 INT in_Rs = -1;
4000 INT out_Rd = -1;
4001 in_Rd = FLD (in_Rd);
4002 in_Rs = FLD (in_Rs);
4003 referenced |= 1 << 0;
4004 referenced |= 1 << 1;
4005 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4007 return cycles;
4008 #undef FLD
4011 static int
4012 model_crisv32_orr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4014 #define FLD(f) abuf->fields.sfmt_addc_m.f
4015 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4016 const IDESC * UNUSED idesc = abuf->idesc;
4017 int cycles = 0;
4019 int referenced = 0;
4020 int UNUSED insn_referenced = abuf->written;
4021 INT in_Rd = -1;
4022 INT in_Rs = -1;
4023 INT out_Rd = -1;
4024 in_Rd = FLD (in_Rd);
4025 in_Rs = FLD (in_Rs);
4026 referenced |= 1 << 0;
4027 referenced |= 1 << 1;
4028 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4030 return cycles;
4031 #undef FLD
4034 static int
4035 model_crisv32_or_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
4037 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4038 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4039 const IDESC * UNUSED idesc = abuf->idesc;
4040 int cycles = 0;
4042 int referenced = 0;
4043 int UNUSED insn_referenced = abuf->written;
4044 INT in_Rs = -1;
4045 in_Rs = FLD (in_Rs);
4046 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4047 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4050 int referenced = 0;
4051 int UNUSED insn_referenced = abuf->written;
4052 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4055 int referenced = 0;
4056 int UNUSED insn_referenced = abuf->written;
4057 INT in_Rd = -1;
4058 INT in_Rs = -1;
4059 INT out_Rd = -1;
4060 in_Rd = FLD (in_Rd);
4061 in_Rs = FLD (in_Rs);
4062 referenced |= 1 << 0;
4063 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4064 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4066 return cycles;
4067 #undef FLD
4070 static int
4071 model_crisv32_or_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
4073 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4074 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4075 const IDESC * UNUSED idesc = abuf->idesc;
4076 int cycles = 0;
4078 int referenced = 0;
4079 int UNUSED insn_referenced = abuf->written;
4080 INT in_Rs = -1;
4081 in_Rs = FLD (in_Rs);
4082 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4083 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4086 int referenced = 0;
4087 int UNUSED insn_referenced = abuf->written;
4088 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4091 int referenced = 0;
4092 int UNUSED insn_referenced = abuf->written;
4093 INT in_Rd = -1;
4094 INT in_Rs = -1;
4095 INT out_Rd = -1;
4096 in_Rd = FLD (in_Rd);
4097 in_Rs = FLD (in_Rs);
4098 referenced |= 1 << 0;
4099 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4100 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4102 return cycles;
4103 #undef FLD
4106 static int
4107 model_crisv32_or_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
4109 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4110 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4111 const IDESC * UNUSED idesc = abuf->idesc;
4112 int cycles = 0;
4114 int referenced = 0;
4115 int UNUSED insn_referenced = abuf->written;
4116 INT in_Rs = -1;
4117 in_Rs = FLD (in_Rs);
4118 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4119 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4122 int referenced = 0;
4123 int UNUSED insn_referenced = abuf->written;
4124 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4127 int referenced = 0;
4128 int UNUSED insn_referenced = abuf->written;
4129 INT in_Rd = -1;
4130 INT in_Rs = -1;
4131 INT out_Rd = -1;
4132 in_Rd = FLD (in_Rd);
4133 in_Rs = FLD (in_Rs);
4134 referenced |= 1 << 0;
4135 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4136 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4138 return cycles;
4139 #undef FLD
4142 static int
4143 model_crisv32_orcbr (SIM_CPU *current_cpu, void *sem_arg)
4145 #define FLD(f) abuf->fields.sfmt_addcbr.f
4146 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4147 const IDESC * UNUSED idesc = abuf->idesc;
4148 int cycles = 0;
4150 int referenced = 0;
4151 int UNUSED insn_referenced = abuf->written;
4152 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4155 int referenced = 0;
4156 int UNUSED insn_referenced = abuf->written;
4157 INT in_Rd = -1;
4158 INT in_Rs = -1;
4159 INT out_Rd = -1;
4160 in_Rd = FLD (in_Rd);
4161 referenced |= 1 << 0;
4162 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4164 return cycles;
4165 #undef FLD
4168 static int
4169 model_crisv32_orcwr (SIM_CPU *current_cpu, void *sem_arg)
4171 #define FLD(f) abuf->fields.sfmt_addcwr.f
4172 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4173 const IDESC * UNUSED idesc = abuf->idesc;
4174 int cycles = 0;
4176 int referenced = 0;
4177 int UNUSED insn_referenced = abuf->written;
4178 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4181 int referenced = 0;
4182 int UNUSED insn_referenced = abuf->written;
4183 INT in_Rd = -1;
4184 INT in_Rs = -1;
4185 INT out_Rd = -1;
4186 in_Rd = FLD (in_Rd);
4187 referenced |= 1 << 0;
4188 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4190 return cycles;
4191 #undef FLD
4194 static int
4195 model_crisv32_orcdr (SIM_CPU *current_cpu, void *sem_arg)
4197 #define FLD(f) abuf->fields.sfmt_addcdr.f
4198 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4199 const IDESC * UNUSED idesc = abuf->idesc;
4200 int cycles = 0;
4202 int referenced = 0;
4203 int UNUSED insn_referenced = abuf->written;
4204 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4207 int referenced = 0;
4208 int UNUSED insn_referenced = abuf->written;
4209 INT in_Rd = -1;
4210 INT in_Rs = -1;
4211 INT out_Rd = -1;
4212 in_Rd = FLD (in_Rd);
4213 referenced |= 1 << 0;
4214 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4216 return cycles;
4217 #undef FLD
4220 static int
4221 model_crisv32_orq (SIM_CPU *current_cpu, void *sem_arg)
4223 #define FLD(f) abuf->fields.sfmt_andq.f
4224 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4225 const IDESC * UNUSED idesc = abuf->idesc;
4226 int cycles = 0;
4228 int referenced = 0;
4229 int UNUSED insn_referenced = abuf->written;
4230 INT in_Rd = -1;
4231 INT in_Rs = -1;
4232 INT out_Rd = -1;
4233 in_Rd = FLD (in_Rd);
4234 referenced |= 1 << 0;
4235 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4237 return cycles;
4238 #undef FLD
4241 static int
4242 model_crisv32_xor (SIM_CPU *current_cpu, void *sem_arg)
4244 #define FLD(f) abuf->fields.sfmt_muls_b.f
4245 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4246 const IDESC * UNUSED idesc = abuf->idesc;
4247 int cycles = 0;
4249 int referenced = 0;
4250 int UNUSED insn_referenced = abuf->written;
4251 INT in_Rd = -1;
4252 INT in_Rs = -1;
4253 INT out_Rd = -1;
4254 in_Rd = FLD (in_Rd);
4255 in_Rs = FLD (in_Rs);
4256 out_Rd = FLD (out_Rd);
4257 referenced |= 1 << 0;
4258 referenced |= 1 << 1;
4259 referenced |= 1 << 2;
4260 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4262 return cycles;
4263 #undef FLD
4266 static int
4267 model_crisv32_swap (SIM_CPU *current_cpu, void *sem_arg)
4269 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4270 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4271 const IDESC * UNUSED idesc = abuf->idesc;
4272 int cycles = 0;
4274 int referenced = 0;
4275 int UNUSED insn_referenced = abuf->written;
4276 INT in_Rd = -1;
4277 INT in_Rs = -1;
4278 INT out_Rd = -1;
4279 in_Rs = FLD (in_Rs);
4280 referenced |= 1 << 1;
4281 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4283 return cycles;
4284 #undef FLD
4287 static int
4288 model_crisv32_asrr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4290 #define FLD(f) abuf->fields.sfmt_addc_m.f
4291 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4292 const IDESC * UNUSED idesc = abuf->idesc;
4293 int cycles = 0;
4295 int referenced = 0;
4296 int UNUSED insn_referenced = abuf->written;
4297 INT in_Rd = -1;
4298 INT in_Rs = -1;
4299 INT out_Rd = -1;
4300 in_Rd = FLD (in_Rd);
4301 in_Rs = FLD (in_Rs);
4302 referenced |= 1 << 0;
4303 referenced |= 1 << 1;
4304 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4306 return cycles;
4307 #undef FLD
4310 static int
4311 model_crisv32_asrr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4313 #define FLD(f) abuf->fields.sfmt_addc_m.f
4314 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4315 const IDESC * UNUSED idesc = abuf->idesc;
4316 int cycles = 0;
4318 int referenced = 0;
4319 int UNUSED insn_referenced = abuf->written;
4320 INT in_Rd = -1;
4321 INT in_Rs = -1;
4322 INT out_Rd = -1;
4323 in_Rd = FLD (in_Rd);
4324 in_Rs = FLD (in_Rs);
4325 referenced |= 1 << 0;
4326 referenced |= 1 << 1;
4327 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4329 return cycles;
4330 #undef FLD
4333 static int
4334 model_crisv32_asrr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4336 #define FLD(f) abuf->fields.sfmt_addc_m.f
4337 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4338 const IDESC * UNUSED idesc = abuf->idesc;
4339 int cycles = 0;
4341 int referenced = 0;
4342 int UNUSED insn_referenced = abuf->written;
4343 INT in_Rd = -1;
4344 INT in_Rs = -1;
4345 INT out_Rd = -1;
4346 in_Rd = FLD (in_Rd);
4347 in_Rs = FLD (in_Rs);
4348 referenced |= 1 << 0;
4349 referenced |= 1 << 1;
4350 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4352 return cycles;
4353 #undef FLD
4356 static int
4357 model_crisv32_asrq (SIM_CPU *current_cpu, void *sem_arg)
4359 #define FLD(f) abuf->fields.sfmt_asrq.f
4360 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4361 const IDESC * UNUSED idesc = abuf->idesc;
4362 int cycles = 0;
4364 int referenced = 0;
4365 int UNUSED insn_referenced = abuf->written;
4366 INT in_Rd = -1;
4367 INT in_Rs = -1;
4368 INT out_Rd = -1;
4369 in_Rd = FLD (in_Rd);
4370 out_Rd = FLD (out_Rd);
4371 referenced |= 1 << 0;
4372 referenced |= 1 << 2;
4373 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4375 return cycles;
4376 #undef FLD
4379 static int
4380 model_crisv32_lsrr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4382 #define FLD(f) abuf->fields.sfmt_addc_m.f
4383 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4384 const IDESC * UNUSED idesc = abuf->idesc;
4385 int cycles = 0;
4387 int referenced = 0;
4388 int UNUSED insn_referenced = abuf->written;
4389 INT in_Rd = -1;
4390 INT in_Rs = -1;
4391 INT out_Rd = -1;
4392 in_Rd = FLD (in_Rd);
4393 in_Rs = FLD (in_Rs);
4394 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4395 referenced |= 1 << 1;
4396 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4398 return cycles;
4399 #undef FLD
4402 static int
4403 model_crisv32_lsrr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4405 #define FLD(f) abuf->fields.sfmt_addc_m.f
4406 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4407 const IDESC * UNUSED idesc = abuf->idesc;
4408 int cycles = 0;
4410 int referenced = 0;
4411 int UNUSED insn_referenced = abuf->written;
4412 INT in_Rd = -1;
4413 INT in_Rs = -1;
4414 INT out_Rd = -1;
4415 in_Rd = FLD (in_Rd);
4416 in_Rs = FLD (in_Rs);
4417 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4418 referenced |= 1 << 1;
4419 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4421 return cycles;
4422 #undef FLD
4425 static int
4426 model_crisv32_lsrr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4428 #define FLD(f) abuf->fields.sfmt_addc_m.f
4429 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4430 const IDESC * UNUSED idesc = abuf->idesc;
4431 int cycles = 0;
4433 int referenced = 0;
4434 int UNUSED insn_referenced = abuf->written;
4435 INT in_Rd = -1;
4436 INT in_Rs = -1;
4437 INT out_Rd = -1;
4438 in_Rd = FLD (in_Rd);
4439 in_Rs = FLD (in_Rs);
4440 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4441 referenced |= 1 << 1;
4442 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4444 return cycles;
4445 #undef FLD
4448 static int
4449 model_crisv32_lsrq (SIM_CPU *current_cpu, void *sem_arg)
4451 #define FLD(f) abuf->fields.sfmt_asrq.f
4452 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4453 const IDESC * UNUSED idesc = abuf->idesc;
4454 int cycles = 0;
4456 int referenced = 0;
4457 int UNUSED insn_referenced = abuf->written;
4458 INT in_Rd = -1;
4459 INT in_Rs = -1;
4460 INT out_Rd = -1;
4461 in_Rd = FLD (in_Rd);
4462 out_Rd = FLD (out_Rd);
4463 referenced |= 1 << 0;
4464 referenced |= 1 << 2;
4465 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4467 return cycles;
4468 #undef FLD
4471 static int
4472 model_crisv32_lslr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4474 #define FLD(f) abuf->fields.sfmt_addc_m.f
4475 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4476 const IDESC * UNUSED idesc = abuf->idesc;
4477 int cycles = 0;
4479 int referenced = 0;
4480 int UNUSED insn_referenced = abuf->written;
4481 INT in_Rd = -1;
4482 INT in_Rs = -1;
4483 INT out_Rd = -1;
4484 in_Rd = FLD (in_Rd);
4485 in_Rs = FLD (in_Rs);
4486 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4487 referenced |= 1 << 1;
4488 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4490 return cycles;
4491 #undef FLD
4494 static int
4495 model_crisv32_lslr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4497 #define FLD(f) abuf->fields.sfmt_addc_m.f
4498 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4499 const IDESC * UNUSED idesc = abuf->idesc;
4500 int cycles = 0;
4502 int referenced = 0;
4503 int UNUSED insn_referenced = abuf->written;
4504 INT in_Rd = -1;
4505 INT in_Rs = -1;
4506 INT out_Rd = -1;
4507 in_Rd = FLD (in_Rd);
4508 in_Rs = FLD (in_Rs);
4509 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4510 referenced |= 1 << 1;
4511 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4513 return cycles;
4514 #undef FLD
4517 static int
4518 model_crisv32_lslr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4520 #define FLD(f) abuf->fields.sfmt_addc_m.f
4521 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4522 const IDESC * UNUSED idesc = abuf->idesc;
4523 int cycles = 0;
4525 int referenced = 0;
4526 int UNUSED insn_referenced = abuf->written;
4527 INT in_Rd = -1;
4528 INT in_Rs = -1;
4529 INT out_Rd = -1;
4530 in_Rd = FLD (in_Rd);
4531 in_Rs = FLD (in_Rs);
4532 if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4533 referenced |= 1 << 1;
4534 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4536 return cycles;
4537 #undef FLD
4540 static int
4541 model_crisv32_lslq (SIM_CPU *current_cpu, void *sem_arg)
4543 #define FLD(f) abuf->fields.sfmt_asrq.f
4544 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4545 const IDESC * UNUSED idesc = abuf->idesc;
4546 int cycles = 0;
4548 int referenced = 0;
4549 int UNUSED insn_referenced = abuf->written;
4550 INT in_Rd = -1;
4551 INT in_Rs = -1;
4552 INT out_Rd = -1;
4553 in_Rd = FLD (in_Rd);
4554 out_Rd = FLD (out_Rd);
4555 referenced |= 1 << 0;
4556 referenced |= 1 << 2;
4557 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4559 return cycles;
4560 #undef FLD
4563 static int
4564 model_crisv32_btst (SIM_CPU *current_cpu, void *sem_arg)
4566 #define FLD(f) abuf->fields.sfmt_muls_b.f
4567 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4568 const IDESC * UNUSED idesc = abuf->idesc;
4569 int cycles = 0;
4571 int referenced = 0;
4572 int UNUSED insn_referenced = abuf->written;
4573 INT in_Rd = -1;
4574 INT in_Rs = -1;
4575 INT out_Rd = -1;
4576 in_Rd = FLD (in_Rd);
4577 in_Rs = FLD (in_Rs);
4578 referenced |= 1 << 0;
4579 referenced |= 1 << 1;
4580 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4582 return cycles;
4583 #undef FLD
4586 static int
4587 model_crisv32_btstq (SIM_CPU *current_cpu, void *sem_arg)
4589 #define FLD(f) abuf->fields.sfmt_asrq.f
4590 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4591 const IDESC * UNUSED idesc = abuf->idesc;
4592 int cycles = 0;
4594 int referenced = 0;
4595 int UNUSED insn_referenced = abuf->written;
4596 INT in_Rd = -1;
4597 INT in_Rs = -1;
4598 INT out_Rd = -1;
4599 in_Rd = FLD (in_Rd);
4600 referenced |= 1 << 0;
4601 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4603 return cycles;
4604 #undef FLD
4607 static int
4608 model_crisv32_setf (SIM_CPU *current_cpu, void *sem_arg)
4610 #define FLD(f) abuf->fields.sfmt_setf.f
4611 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4612 const IDESC * UNUSED idesc = abuf->idesc;
4613 int cycles = 0;
4615 int referenced = 0;
4616 int UNUSED insn_referenced = abuf->written;
4617 INT in_Rd = -1;
4618 INT in_Rs = -1;
4619 INT out_Rd = -1;
4620 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4622 return cycles;
4623 #undef FLD
4626 static int
4627 model_crisv32_clearf (SIM_CPU *current_cpu, void *sem_arg)
4629 #define FLD(f) abuf->fields.sfmt_setf.f
4630 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4631 const IDESC * UNUSED idesc = abuf->idesc;
4632 int cycles = 0;
4634 int referenced = 0;
4635 int UNUSED insn_referenced = abuf->written;
4636 INT in_Rd = -1;
4637 INT in_Rs = -1;
4638 INT out_Rd = -1;
4639 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4641 return cycles;
4642 #undef FLD
4645 static int
4646 model_crisv32_rfe (SIM_CPU *current_cpu, void *sem_arg)
4648 #define FLD(f) abuf->fields.sfmt_rfe.f
4649 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4650 const IDESC * UNUSED idesc = abuf->idesc;
4651 int cycles = 0;
4653 int referenced = 0;
4654 int UNUSED insn_referenced = abuf->written;
4655 INT in_Rd = -1;
4656 INT in_Rs = -1;
4657 INT out_Rd = -1;
4658 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4660 return cycles;
4661 #undef FLD
4664 static int
4665 model_crisv32_sfe (SIM_CPU *current_cpu, void *sem_arg)
4667 #define FLD(f) abuf->fields.sfmt_rfe.f
4668 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4669 const IDESC * UNUSED idesc = abuf->idesc;
4670 int cycles = 0;
4672 int referenced = 0;
4673 int UNUSED insn_referenced = abuf->written;
4674 INT in_Rd = -1;
4675 INT in_Rs = -1;
4676 INT out_Rd = -1;
4677 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4679 return cycles;
4680 #undef FLD
4683 static int
4684 model_crisv32_rfg (SIM_CPU *current_cpu, void *sem_arg)
4686 #define FLD(f) abuf->fields.sfmt_empty.f
4687 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4688 const IDESC * UNUSED idesc = abuf->idesc;
4689 int cycles = 0;
4691 int referenced = 0;
4692 int UNUSED insn_referenced = abuf->written;
4693 INT in_Rd = -1;
4694 INT in_Rs = -1;
4695 INT out_Rd = -1;
4696 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4698 return cycles;
4699 #undef FLD
4702 static int
4703 model_crisv32_rfn (SIM_CPU *current_cpu, void *sem_arg)
4705 #define FLD(f) abuf->fields.sfmt_rfe.f
4706 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4707 const IDESC * UNUSED idesc = abuf->idesc;
4708 int cycles = 0;
4710 int referenced = 0;
4711 int UNUSED insn_referenced = abuf->written;
4712 INT in_Rd = -1;
4713 INT in_Rs = -1;
4714 INT out_Rd = -1;
4715 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4717 return cycles;
4718 #undef FLD
4721 static int
4722 model_crisv32_halt (SIM_CPU *current_cpu, void *sem_arg)
4724 #define FLD(f) abuf->fields.sfmt_empty.f
4725 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4726 const IDESC * UNUSED idesc = abuf->idesc;
4727 int cycles = 0;
4729 int referenced = 0;
4730 int UNUSED insn_referenced = abuf->written;
4731 INT in_Rd = -1;
4732 INT in_Rs = -1;
4733 INT out_Rd = -1;
4734 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4736 return cycles;
4737 #undef FLD
4740 static int
4741 model_crisv32_bcc_b (SIM_CPU *current_cpu, void *sem_arg)
4743 #define FLD(f) abuf->fields.sfmt_bcc_b.f
4744 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4745 const IDESC * UNUSED idesc = abuf->idesc;
4746 int cycles = 0;
4748 int referenced = 0;
4749 int UNUSED insn_referenced = abuf->written;
4750 cycles += crisv32f_model_crisv32_u_branch (current_cpu, idesc, 0, referenced);
4753 int referenced = 0;
4754 int UNUSED insn_referenced = abuf->written;
4755 INT in_Rd = -1;
4756 INT in_Rs = -1;
4757 INT out_Rd = -1;
4758 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4760 return cycles;
4761 #undef FLD
4764 static int
4765 model_crisv32_ba_b (SIM_CPU *current_cpu, void *sem_arg)
4767 #define FLD(f) abuf->fields.sfmt_bcc_b.f
4768 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4769 const IDESC * UNUSED idesc = abuf->idesc;
4770 int cycles = 0;
4772 int referenced = 0;
4773 int UNUSED insn_referenced = abuf->written;
4774 INT out_Pd = -1;
4775 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 0, referenced, out_Pd);
4778 int referenced = 0;
4779 int UNUSED insn_referenced = abuf->written;
4780 INT in_Rd = -1;
4781 INT in_Rs = -1;
4782 INT out_Rd = -1;
4783 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4785 return cycles;
4786 #undef FLD
4789 static int
4790 model_crisv32_bcc_w (SIM_CPU *current_cpu, void *sem_arg)
4792 #define FLD(f) abuf->fields.sfmt_bcc_w.f
4793 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4794 const IDESC * UNUSED idesc = abuf->idesc;
4795 int cycles = 0;
4797 int referenced = 0;
4798 int UNUSED insn_referenced = abuf->written;
4799 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4802 int referenced = 0;
4803 int UNUSED insn_referenced = abuf->written;
4804 cycles += crisv32f_model_crisv32_u_branch (current_cpu, idesc, 1, referenced);
4807 int referenced = 0;
4808 int UNUSED insn_referenced = abuf->written;
4809 INT in_Rd = -1;
4810 INT in_Rs = -1;
4811 INT out_Rd = -1;
4812 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4814 return cycles;
4815 #undef FLD
4818 static int
4819 model_crisv32_ba_w (SIM_CPU *current_cpu, void *sem_arg)
4821 #define FLD(f) abuf->fields.sfmt_bcc_w.f
4822 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4823 const IDESC * UNUSED idesc = abuf->idesc;
4824 int cycles = 0;
4826 int referenced = 0;
4827 int UNUSED insn_referenced = abuf->written;
4828 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4831 int referenced = 0;
4832 int UNUSED insn_referenced = abuf->written;
4833 INT out_Pd = -1;
4834 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4837 int referenced = 0;
4838 int UNUSED insn_referenced = abuf->written;
4839 INT in_Rd = -1;
4840 INT in_Rs = -1;
4841 INT out_Rd = -1;
4842 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4844 return cycles;
4845 #undef FLD
4848 static int
4849 model_crisv32_jas_r (SIM_CPU *current_cpu, void *sem_arg)
4851 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
4852 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4853 const IDESC * UNUSED idesc = abuf->idesc;
4854 int cycles = 0;
4856 int referenced = 0;
4857 int UNUSED insn_referenced = abuf->written;
4858 INT in_Rs = -1;
4859 in_Rs = FLD (in_Rs);
4860 referenced |= 1 << 0;
4861 cycles += crisv32f_model_crisv32_u_jump_r (current_cpu, idesc, 0, referenced, in_Rs);
4864 int referenced = 0;
4865 int UNUSED insn_referenced = abuf->written;
4866 INT out_Pd = -1;
4867 out_Pd = FLD (out_Pd);
4868 referenced |= 1 << 0;
4869 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4872 int referenced = 0;
4873 int UNUSED insn_referenced = abuf->written;
4874 INT in_Rd = -1;
4875 INT in_Rs = -1;
4876 INT out_Rd = -1;
4877 in_Rs = FLD (in_Rs);
4878 referenced |= 1 << 1;
4879 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4881 return cycles;
4882 #undef FLD
4885 static int
4886 model_crisv32_jas_c (SIM_CPU *current_cpu, void *sem_arg)
4888 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
4889 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4890 const IDESC * UNUSED idesc = abuf->idesc;
4891 int cycles = 0;
4893 int referenced = 0;
4894 int UNUSED insn_referenced = abuf->written;
4895 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4898 int referenced = 0;
4899 int UNUSED insn_referenced = abuf->written;
4900 INT out_Pd = -1;
4901 out_Pd = FLD (out_Pd);
4902 referenced |= 1 << 0;
4903 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4906 int referenced = 0;
4907 int UNUSED insn_referenced = abuf->written;
4908 INT in_Rd = -1;
4909 INT in_Rs = -1;
4910 INT out_Rd = -1;
4911 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4913 return cycles;
4914 #undef FLD
4917 static int
4918 model_crisv32_jump_p (SIM_CPU *current_cpu, void *sem_arg)
4920 #define FLD(f) abuf->fields.sfmt_mcp.f
4921 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4922 const IDESC * UNUSED idesc = abuf->idesc;
4923 int cycles = 0;
4925 int referenced = 0;
4926 int UNUSED insn_referenced = abuf->written;
4927 INT in_Ps = -1;
4928 in_Ps = FLD (in_Ps);
4929 referenced |= 1 << 0;
4930 cycles += crisv32f_model_crisv32_u_jump_sr (current_cpu, idesc, 0, referenced, in_Ps);
4933 int referenced = 0;
4934 int UNUSED insn_referenced = abuf->written;
4935 INT in_Rd = -1;
4936 INT in_Rs = -1;
4937 INT out_Rd = -1;
4938 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4940 return cycles;
4941 #undef FLD
4944 static int
4945 model_crisv32_bas_c (SIM_CPU *current_cpu, void *sem_arg)
4947 #define FLD(f) abuf->fields.sfmt_bas_c.f
4948 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4949 const IDESC * UNUSED idesc = abuf->idesc;
4950 int cycles = 0;
4952 int referenced = 0;
4953 int UNUSED insn_referenced = abuf->written;
4954 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4957 int referenced = 0;
4958 int UNUSED insn_referenced = abuf->written;
4959 INT out_Pd = -1;
4960 out_Pd = FLD (out_Pd);
4961 referenced |= 1 << 0;
4962 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4965 int referenced = 0;
4966 int UNUSED insn_referenced = abuf->written;
4967 INT in_Rd = -1;
4968 INT in_Rs = -1;
4969 INT out_Rd = -1;
4970 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4972 return cycles;
4973 #undef FLD
4976 static int
4977 model_crisv32_jasc_r (SIM_CPU *current_cpu, void *sem_arg)
4979 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
4980 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4981 const IDESC * UNUSED idesc = abuf->idesc;
4982 int cycles = 0;
4984 int referenced = 0;
4985 int UNUSED insn_referenced = abuf->written;
4986 INT in_Rs = -1;
4987 in_Rs = FLD (in_Rs);
4988 referenced |= 1 << 0;
4989 cycles += crisv32f_model_crisv32_u_jump_r (current_cpu, idesc, 0, referenced, in_Rs);
4992 int referenced = 0;
4993 int UNUSED insn_referenced = abuf->written;
4994 cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
4997 int referenced = 0;
4998 int UNUSED insn_referenced = abuf->written;
4999 INT out_Pd = -1;
5000 out_Pd = FLD (out_Pd);
5001 referenced |= 1 << 0;
5002 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5005 int referenced = 0;
5006 int UNUSED insn_referenced = abuf->written;
5007 INT in_Rd = -1;
5008 INT in_Rs = -1;
5009 INT out_Rd = -1;
5010 in_Rs = FLD (in_Rs);
5011 referenced |= 1 << 1;
5012 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5014 return cycles;
5015 #undef FLD
5018 static int
5019 model_crisv32_jasc_c (SIM_CPU *current_cpu, void *sem_arg)
5021 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
5022 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5023 const IDESC * UNUSED idesc = abuf->idesc;
5024 int cycles = 0;
5026 int referenced = 0;
5027 int UNUSED insn_referenced = abuf->written;
5028 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5031 int referenced = 0;
5032 int UNUSED insn_referenced = abuf->written;
5033 cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
5036 int referenced = 0;
5037 int UNUSED insn_referenced = abuf->written;
5038 INT out_Pd = -1;
5039 out_Pd = FLD (out_Pd);
5040 referenced |= 1 << 0;
5041 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5044 int referenced = 0;
5045 int UNUSED insn_referenced = abuf->written;
5046 INT in_Rd = -1;
5047 INT in_Rs = -1;
5048 INT out_Rd = -1;
5049 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5051 return cycles;
5052 #undef FLD
5055 static int
5056 model_crisv32_basc_c (SIM_CPU *current_cpu, void *sem_arg)
5058 #define FLD(f) abuf->fields.sfmt_bas_c.f
5059 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5060 const IDESC * UNUSED idesc = abuf->idesc;
5061 int cycles = 0;
5063 int referenced = 0;
5064 int UNUSED insn_referenced = abuf->written;
5065 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5068 int referenced = 0;
5069 int UNUSED insn_referenced = abuf->written;
5070 cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
5073 int referenced = 0;
5074 int UNUSED insn_referenced = abuf->written;
5075 INT out_Pd = -1;
5076 out_Pd = FLD (out_Pd);
5077 referenced |= 1 << 0;
5078 cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5081 int referenced = 0;
5082 int UNUSED insn_referenced = abuf->written;
5083 INT in_Rd = -1;
5084 INT in_Rs = -1;
5085 INT out_Rd = -1;
5086 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5088 return cycles;
5089 #undef FLD
5092 static int
5093 model_crisv32_break (SIM_CPU *current_cpu, void *sem_arg)
5095 #define FLD(f) abuf->fields.sfmt_break.f
5096 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5097 const IDESC * UNUSED idesc = abuf->idesc;
5098 int cycles = 0;
5100 int referenced = 0;
5101 int UNUSED insn_referenced = abuf->written;
5102 INT in_Rd = -1;
5103 INT in_Rs = -1;
5104 INT out_Rd = -1;
5105 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5107 return cycles;
5108 #undef FLD
5111 static int
5112 model_crisv32_bound_r_b_r (SIM_CPU *current_cpu, void *sem_arg)
5114 #define FLD(f) abuf->fields.sfmt_muls_b.f
5115 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5116 const IDESC * UNUSED idesc = abuf->idesc;
5117 int cycles = 0;
5119 int referenced = 0;
5120 int UNUSED insn_referenced = abuf->written;
5121 INT in_Rd = -1;
5122 INT in_Rs = -1;
5123 INT out_Rd = -1;
5124 in_Rd = FLD (in_Rd);
5125 in_Rs = FLD (in_Rs);
5126 out_Rd = FLD (out_Rd);
5127 referenced |= 1 << 0;
5128 referenced |= 1 << 1;
5129 referenced |= 1 << 2;
5130 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5132 return cycles;
5133 #undef FLD
5136 static int
5137 model_crisv32_bound_r_w_r (SIM_CPU *current_cpu, void *sem_arg)
5139 #define FLD(f) abuf->fields.sfmt_muls_b.f
5140 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5141 const IDESC * UNUSED idesc = abuf->idesc;
5142 int cycles = 0;
5144 int referenced = 0;
5145 int UNUSED insn_referenced = abuf->written;
5146 INT in_Rd = -1;
5147 INT in_Rs = -1;
5148 INT out_Rd = -1;
5149 in_Rd = FLD (in_Rd);
5150 in_Rs = FLD (in_Rs);
5151 out_Rd = FLD (out_Rd);
5152 referenced |= 1 << 0;
5153 referenced |= 1 << 1;
5154 referenced |= 1 << 2;
5155 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5157 return cycles;
5158 #undef FLD
5161 static int
5162 model_crisv32_bound_r_d_r (SIM_CPU *current_cpu, void *sem_arg)
5164 #define FLD(f) abuf->fields.sfmt_muls_b.f
5165 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5166 const IDESC * UNUSED idesc = abuf->idesc;
5167 int cycles = 0;
5169 int referenced = 0;
5170 int UNUSED insn_referenced = abuf->written;
5171 INT in_Rd = -1;
5172 INT in_Rs = -1;
5173 INT out_Rd = -1;
5174 in_Rd = FLD (in_Rd);
5175 in_Rs = FLD (in_Rs);
5176 out_Rd = FLD (out_Rd);
5177 referenced |= 1 << 0;
5178 referenced |= 1 << 1;
5179 referenced |= 1 << 2;
5180 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5182 return cycles;
5183 #undef FLD
5186 static int
5187 model_crisv32_bound_cb (SIM_CPU *current_cpu, void *sem_arg)
5189 #define FLD(f) abuf->fields.sfmt_bound_cb.f
5190 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5191 const IDESC * UNUSED idesc = abuf->idesc;
5192 int cycles = 0;
5194 int referenced = 0;
5195 int UNUSED insn_referenced = abuf->written;
5196 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5199 int referenced = 0;
5200 int UNUSED insn_referenced = abuf->written;
5201 INT in_Rd = -1;
5202 INT in_Rs = -1;
5203 INT out_Rd = -1;
5204 in_Rd = FLD (in_Rd);
5205 out_Rd = FLD (out_Rd);
5206 referenced |= 1 << 0;
5207 referenced |= 1 << 2;
5208 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5210 return cycles;
5211 #undef FLD
5214 static int
5215 model_crisv32_bound_cw (SIM_CPU *current_cpu, void *sem_arg)
5217 #define FLD(f) abuf->fields.sfmt_bound_cw.f
5218 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5219 const IDESC * UNUSED idesc = abuf->idesc;
5220 int cycles = 0;
5222 int referenced = 0;
5223 int UNUSED insn_referenced = abuf->written;
5224 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5227 int referenced = 0;
5228 int UNUSED insn_referenced = abuf->written;
5229 INT in_Rd = -1;
5230 INT in_Rs = -1;
5231 INT out_Rd = -1;
5232 in_Rd = FLD (in_Rd);
5233 out_Rd = FLD (out_Rd);
5234 referenced |= 1 << 0;
5235 referenced |= 1 << 2;
5236 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5238 return cycles;
5239 #undef FLD
5242 static int
5243 model_crisv32_bound_cd (SIM_CPU *current_cpu, void *sem_arg)
5245 #define FLD(f) abuf->fields.sfmt_bound_cd.f
5246 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5247 const IDESC * UNUSED idesc = abuf->idesc;
5248 int cycles = 0;
5250 int referenced = 0;
5251 int UNUSED insn_referenced = abuf->written;
5252 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5255 int referenced = 0;
5256 int UNUSED insn_referenced = abuf->written;
5257 INT in_Rd = -1;
5258 INT in_Rs = -1;
5259 INT out_Rd = -1;
5260 in_Rd = FLD (in_Rd);
5261 out_Rd = FLD (out_Rd);
5262 referenced |= 1 << 0;
5263 referenced |= 1 << 2;
5264 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5266 return cycles;
5267 #undef FLD
5270 static int
5271 model_crisv32_scc (SIM_CPU *current_cpu, void *sem_arg)
5273 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
5274 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5275 const IDESC * UNUSED idesc = abuf->idesc;
5276 int cycles = 0;
5278 int referenced = 0;
5279 int UNUSED insn_referenced = abuf->written;
5280 INT in_Rd = -1;
5281 INT in_Rs = -1;
5282 INT out_Rd = -1;
5283 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5285 return cycles;
5286 #undef FLD
5289 static int
5290 model_crisv32_lz (SIM_CPU *current_cpu, void *sem_arg)
5292 #define FLD(f) abuf->fields.sfmt_muls_b.f
5293 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5294 const IDESC * UNUSED idesc = abuf->idesc;
5295 int cycles = 0;
5297 int referenced = 0;
5298 int UNUSED insn_referenced = abuf->written;
5299 INT in_Rd = -1;
5300 INT in_Rs = -1;
5301 INT out_Rd = -1;
5302 in_Rs = FLD (in_Rs);
5303 out_Rd = FLD (out_Rd);
5304 referenced |= 1 << 1;
5305 referenced |= 1 << 2;
5306 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5308 return cycles;
5309 #undef FLD
5312 static int
5313 model_crisv32_addoq (SIM_CPU *current_cpu, void *sem_arg)
5315 #define FLD(f) abuf->fields.sfmt_addoq.f
5316 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5317 const IDESC * UNUSED idesc = abuf->idesc;
5318 int cycles = 0;
5320 int referenced = 0;
5321 int UNUSED insn_referenced = abuf->written;
5322 INT in_Rd = -1;
5323 INT in_Rs = -1;
5324 INT out_Rd = -1;
5325 in_Rd = FLD (in_Rd);
5326 referenced |= 1 << 0;
5327 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5329 return cycles;
5330 #undef FLD
5333 static int
5334 model_crisv32_addo_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
5336 #define FLD(f) abuf->fields.sfmt_addc_m.f
5337 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5338 const IDESC * UNUSED idesc = abuf->idesc;
5339 int cycles = 0;
5341 int referenced = 0;
5342 int UNUSED insn_referenced = abuf->written;
5343 INT in_Rs = -1;
5344 in_Rs = FLD (in_Rs);
5345 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5346 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5349 int referenced = 0;
5350 int UNUSED insn_referenced = abuf->written;
5351 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5354 int referenced = 0;
5355 int UNUSED insn_referenced = abuf->written;
5356 INT in_Rd = -1;
5357 INT in_Rs = -1;
5358 INT out_Rd = -1;
5359 in_Rd = FLD (in_Rd);
5360 in_Rs = FLD (in_Rs);
5361 referenced |= 1 << 0;
5362 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5363 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5365 return cycles;
5366 #undef FLD
5369 static int
5370 model_crisv32_addo_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
5372 #define FLD(f) abuf->fields.sfmt_addc_m.f
5373 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5374 const IDESC * UNUSED idesc = abuf->idesc;
5375 int cycles = 0;
5377 int referenced = 0;
5378 int UNUSED insn_referenced = abuf->written;
5379 INT in_Rs = -1;
5380 in_Rs = FLD (in_Rs);
5381 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5382 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5385 int referenced = 0;
5386 int UNUSED insn_referenced = abuf->written;
5387 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5390 int referenced = 0;
5391 int UNUSED insn_referenced = abuf->written;
5392 INT in_Rd = -1;
5393 INT in_Rs = -1;
5394 INT out_Rd = -1;
5395 in_Rd = FLD (in_Rd);
5396 in_Rs = FLD (in_Rs);
5397 referenced |= 1 << 0;
5398 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5399 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5401 return cycles;
5402 #undef FLD
5405 static int
5406 model_crisv32_addo_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
5408 #define FLD(f) abuf->fields.sfmt_addc_m.f
5409 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5410 const IDESC * UNUSED idesc = abuf->idesc;
5411 int cycles = 0;
5413 int referenced = 0;
5414 int UNUSED insn_referenced = abuf->written;
5415 INT in_Rs = -1;
5416 in_Rs = FLD (in_Rs);
5417 if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5418 cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5421 int referenced = 0;
5422 int UNUSED insn_referenced = abuf->written;
5423 cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5426 int referenced = 0;
5427 int UNUSED insn_referenced = abuf->written;
5428 INT in_Rd = -1;
5429 INT in_Rs = -1;
5430 INT out_Rd = -1;
5431 in_Rd = FLD (in_Rd);
5432 in_Rs = FLD (in_Rs);
5433 referenced |= 1 << 0;
5434 if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5435 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5437 return cycles;
5438 #undef FLD
5441 static int
5442 model_crisv32_addo_cb (SIM_CPU *current_cpu, void *sem_arg)
5444 #define FLD(f) abuf->fields.sfmt_bound_cb.f
5445 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5446 const IDESC * UNUSED idesc = abuf->idesc;
5447 int cycles = 0;
5449 int referenced = 0;
5450 int UNUSED insn_referenced = abuf->written;
5451 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5454 int referenced = 0;
5455 int UNUSED insn_referenced = abuf->written;
5456 INT in_Rd = -1;
5457 INT in_Rs = -1;
5458 INT out_Rd = -1;
5459 in_Rd = FLD (in_Rd);
5460 referenced |= 1 << 0;
5461 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5463 return cycles;
5464 #undef FLD
5467 static int
5468 model_crisv32_addo_cw (SIM_CPU *current_cpu, void *sem_arg)
5470 #define FLD(f) abuf->fields.sfmt_bound_cw.f
5471 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5472 const IDESC * UNUSED idesc = abuf->idesc;
5473 int cycles = 0;
5475 int referenced = 0;
5476 int UNUSED insn_referenced = abuf->written;
5477 cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5480 int referenced = 0;
5481 int UNUSED insn_referenced = abuf->written;
5482 INT in_Rd = -1;
5483 INT in_Rs = -1;
5484 INT out_Rd = -1;
5485 in_Rd = FLD (in_Rd);
5486 referenced |= 1 << 0;
5487 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5489 return cycles;
5490 #undef FLD
5493 static int
5494 model_crisv32_addo_cd (SIM_CPU *current_cpu, void *sem_arg)
5496 #define FLD(f) abuf->fields.sfmt_bound_cd.f
5497 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5498 const IDESC * UNUSED idesc = abuf->idesc;
5499 int cycles = 0;
5501 int referenced = 0;
5502 int UNUSED insn_referenced = abuf->written;
5503 cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5506 int referenced = 0;
5507 int UNUSED insn_referenced = abuf->written;
5508 INT in_Rd = -1;
5509 INT in_Rs = -1;
5510 INT out_Rd = -1;
5511 in_Rd = FLD (in_Rd);
5512 referenced |= 1 << 0;
5513 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5515 return cycles;
5516 #undef FLD
5519 static int
5520 model_crisv32_addi_acr_b_r (SIM_CPU *current_cpu, void *sem_arg)
5522 #define FLD(f) abuf->fields.sfmt_muls_b.f
5523 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5524 const IDESC * UNUSED idesc = abuf->idesc;
5525 int cycles = 0;
5527 int referenced = 0;
5528 int UNUSED insn_referenced = abuf->written;
5529 INT in_Rd = -1;
5530 INT in_Rs = -1;
5531 INT out_Rd = -1;
5532 in_Rd = FLD (in_Rd);
5533 in_Rs = FLD (in_Rs);
5534 referenced |= 1 << 0;
5535 referenced |= 1 << 1;
5536 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5538 return cycles;
5539 #undef FLD
5542 static int
5543 model_crisv32_addi_acr_w_r (SIM_CPU *current_cpu, void *sem_arg)
5545 #define FLD(f) abuf->fields.sfmt_muls_b.f
5546 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5547 const IDESC * UNUSED idesc = abuf->idesc;
5548 int cycles = 0;
5550 int referenced = 0;
5551 int UNUSED insn_referenced = abuf->written;
5552 INT in_Rd = -1;
5553 INT in_Rs = -1;
5554 INT out_Rd = -1;
5555 in_Rd = FLD (in_Rd);
5556 in_Rs = FLD (in_Rs);
5557 referenced |= 1 << 0;
5558 referenced |= 1 << 1;
5559 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5561 return cycles;
5562 #undef FLD
5565 static int
5566 model_crisv32_addi_acr_d_r (SIM_CPU *current_cpu, void *sem_arg)
5568 #define FLD(f) abuf->fields.sfmt_muls_b.f
5569 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5570 const IDESC * UNUSED idesc = abuf->idesc;
5571 int cycles = 0;
5573 int referenced = 0;
5574 int UNUSED insn_referenced = abuf->written;
5575 INT in_Rd = -1;
5576 INT in_Rs = -1;
5577 INT out_Rd = -1;
5578 in_Rd = FLD (in_Rd);
5579 in_Rs = FLD (in_Rs);
5580 referenced |= 1 << 0;
5581 referenced |= 1 << 1;
5582 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5584 return cycles;
5585 #undef FLD
5588 static int
5589 model_crisv32_fidxi (SIM_CPU *current_cpu, void *sem_arg)
5591 #define FLD(f) abuf->fields.sfmt_mcp.f
5592 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5593 const IDESC * UNUSED idesc = abuf->idesc;
5594 int cycles = 0;
5596 int referenced = 0;
5597 int UNUSED insn_referenced = abuf->written;
5598 INT in_Rd = -1;
5599 INT in_Rs = -1;
5600 INT out_Rd = -1;
5601 in_Rs = FLD (in_Rs);
5602 referenced |= 1 << 1;
5603 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5605 return cycles;
5606 #undef FLD
5609 static int
5610 model_crisv32_ftagi (SIM_CPU *current_cpu, void *sem_arg)
5612 #define FLD(f) abuf->fields.sfmt_mcp.f
5613 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5614 const IDESC * UNUSED idesc = abuf->idesc;
5615 int cycles = 0;
5617 int referenced = 0;
5618 int UNUSED insn_referenced = abuf->written;
5619 INT in_Rd = -1;
5620 INT in_Rs = -1;
5621 INT out_Rd = -1;
5622 in_Rs = FLD (in_Rs);
5623 referenced |= 1 << 1;
5624 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5626 return cycles;
5627 #undef FLD
5630 static int
5631 model_crisv32_fidxd (SIM_CPU *current_cpu, void *sem_arg)
5633 #define FLD(f) abuf->fields.sfmt_mcp.f
5634 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5635 const IDESC * UNUSED idesc = abuf->idesc;
5636 int cycles = 0;
5638 int referenced = 0;
5639 int UNUSED insn_referenced = abuf->written;
5640 INT in_Rd = -1;
5641 INT in_Rs = -1;
5642 INT out_Rd = -1;
5643 in_Rs = FLD (in_Rs);
5644 referenced |= 1 << 1;
5645 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5647 return cycles;
5648 #undef FLD
5651 static int
5652 model_crisv32_ftagd (SIM_CPU *current_cpu, void *sem_arg)
5654 #define FLD(f) abuf->fields.sfmt_mcp.f
5655 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5656 const IDESC * UNUSED idesc = abuf->idesc;
5657 int cycles = 0;
5659 int referenced = 0;
5660 int UNUSED insn_referenced = abuf->written;
5661 INT in_Rd = -1;
5662 INT in_Rs = -1;
5663 INT out_Rd = -1;
5664 in_Rs = FLD (in_Rs);
5665 referenced |= 1 << 1;
5666 cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5668 return cycles;
5669 #undef FLD
5672 /* We assume UNIT_NONE == 0 because the tables don't always terminate
5673 entries with it. */
5675 /* Model timing data for `crisv32'. */
5677 static const INSN_TIMING crisv32_timing[] = {
5678 { CRISV32F_INSN_X_INVALID, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5679 { CRISV32F_INSN_X_AFTER, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5680 { CRISV32F_INSN_X_BEFORE, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5681 { CRISV32F_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5682 { CRISV32F_INSN_X_CHAIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5683 { CRISV32F_INSN_X_BEGIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5684 { CRISV32F_INSN_MOVE_B_R, model_crisv32_move_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5685 { CRISV32F_INSN_MOVE_W_R, model_crisv32_move_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5686 { CRISV32F_INSN_MOVE_D_R, model_crisv32_move_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5687 { CRISV32F_INSN_MOVEQ, model_crisv32_moveq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5688 { CRISV32F_INSN_MOVS_B_R, model_crisv32_movs_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5689 { CRISV32F_INSN_MOVS_W_R, model_crisv32_movs_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5690 { CRISV32F_INSN_MOVU_B_R, model_crisv32_movu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5691 { CRISV32F_INSN_MOVU_W_R, model_crisv32_movu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5692 { CRISV32F_INSN_MOVECBR, model_crisv32_movecbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5693 { CRISV32F_INSN_MOVECWR, model_crisv32_movecwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5694 { CRISV32F_INSN_MOVECDR, model_crisv32_movecdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5695 { CRISV32F_INSN_MOVSCBR, model_crisv32_movscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5696 { CRISV32F_INSN_MOVSCWR, model_crisv32_movscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5697 { CRISV32F_INSN_MOVUCBR, model_crisv32_movucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5698 { CRISV32F_INSN_MOVUCWR, model_crisv32_movucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5699 { CRISV32F_INSN_ADDQ, model_crisv32_addq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5700 { CRISV32F_INSN_SUBQ, model_crisv32_subq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5701 { CRISV32F_INSN_CMP_R_B_R, model_crisv32_cmp_r_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5702 { CRISV32F_INSN_CMP_R_W_R, model_crisv32_cmp_r_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5703 { CRISV32F_INSN_CMP_R_D_R, model_crisv32_cmp_r_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5704 { CRISV32F_INSN_CMP_M_B_M, model_crisv32_cmp_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5705 { CRISV32F_INSN_CMP_M_W_M, model_crisv32_cmp_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5706 { CRISV32F_INSN_CMP_M_D_M, model_crisv32_cmp_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5707 { CRISV32F_INSN_CMPCBR, model_crisv32_cmpcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5708 { CRISV32F_INSN_CMPCWR, model_crisv32_cmpcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5709 { CRISV32F_INSN_CMPCDR, model_crisv32_cmpcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5710 { CRISV32F_INSN_CMPQ, model_crisv32_cmpq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5711 { CRISV32F_INSN_CMPS_M_B_M, model_crisv32_cmps_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5712 { CRISV32F_INSN_CMPS_M_W_M, model_crisv32_cmps_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5713 { CRISV32F_INSN_CMPSCBR, model_crisv32_cmpscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5714 { CRISV32F_INSN_CMPSCWR, model_crisv32_cmpscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5715 { CRISV32F_INSN_CMPU_M_B_M, model_crisv32_cmpu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5716 { CRISV32F_INSN_CMPU_M_W_M, model_crisv32_cmpu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5717 { CRISV32F_INSN_CMPUCBR, model_crisv32_cmpucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5718 { CRISV32F_INSN_CMPUCWR, model_crisv32_cmpucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5719 { CRISV32F_INSN_MOVE_M_B_M, model_crisv32_move_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5720 { CRISV32F_INSN_MOVE_M_W_M, model_crisv32_move_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5721 { CRISV32F_INSN_MOVE_M_D_M, model_crisv32_move_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5722 { CRISV32F_INSN_MOVS_M_B_M, model_crisv32_movs_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5723 { CRISV32F_INSN_MOVS_M_W_M, model_crisv32_movs_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5724 { CRISV32F_INSN_MOVU_M_B_M, model_crisv32_movu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5725 { CRISV32F_INSN_MOVU_M_W_M, model_crisv32_movu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5726 { CRISV32F_INSN_MOVE_R_SPRV32, model_crisv32_move_r_sprv32, { { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5727 { CRISV32F_INSN_MOVE_SPR_RV32, model_crisv32_move_spr_rv32, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5728 { CRISV32F_INSN_MOVE_M_SPRV32, model_crisv32_move_m_sprv32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5729 { CRISV32F_INSN_MOVE_C_SPRV32_P2, model_crisv32_move_c_sprv32_p2, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5730 { CRISV32F_INSN_MOVE_C_SPRV32_P3, model_crisv32_move_c_sprv32_p3, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5731 { CRISV32F_INSN_MOVE_C_SPRV32_P5, model_crisv32_move_c_sprv32_p5, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5732 { CRISV32F_INSN_MOVE_C_SPRV32_P6, model_crisv32_move_c_sprv32_p6, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5733 { CRISV32F_INSN_MOVE_C_SPRV32_P7, model_crisv32_move_c_sprv32_p7, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5734 { CRISV32F_INSN_MOVE_C_SPRV32_P9, model_crisv32_move_c_sprv32_p9, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5735 { CRISV32F_INSN_MOVE_C_SPRV32_P10, model_crisv32_move_c_sprv32_p10, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5736 { CRISV32F_INSN_MOVE_C_SPRV32_P11, model_crisv32_move_c_sprv32_p11, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5737 { CRISV32F_INSN_MOVE_C_SPRV32_P12, model_crisv32_move_c_sprv32_p12, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5738 { CRISV32F_INSN_MOVE_C_SPRV32_P13, model_crisv32_move_c_sprv32_p13, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5739 { CRISV32F_INSN_MOVE_C_SPRV32_P14, model_crisv32_move_c_sprv32_p14, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5740 { CRISV32F_INSN_MOVE_C_SPRV32_P15, model_crisv32_move_c_sprv32_p15, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5741 { CRISV32F_INSN_MOVE_SPR_MV32, model_crisv32_move_spr_mv32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5742 { CRISV32F_INSN_MOVE_SS_R, model_crisv32_move_ss_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5743 { CRISV32F_INSN_MOVE_R_SS, model_crisv32_move_r_ss, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5744 { CRISV32F_INSN_MOVEM_R_M_V32, model_crisv32_movem_r_m_v32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MOVEM_RTOM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_MOVEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5745 { CRISV32F_INSN_MOVEM_M_R_V32, model_crisv32_movem_m_r_v32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_MOVEM_MTOR, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_MOVEM, 1, 1 } } },
5746 { CRISV32F_INSN_ADD_B_R, model_crisv32_add_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5747 { CRISV32F_INSN_ADD_W_R, model_crisv32_add_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5748 { CRISV32F_INSN_ADD_D_R, model_crisv32_add_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5749 { CRISV32F_INSN_ADD_M_B_M, model_crisv32_add_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5750 { CRISV32F_INSN_ADD_M_W_M, model_crisv32_add_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5751 { CRISV32F_INSN_ADD_M_D_M, model_crisv32_add_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5752 { CRISV32F_INSN_ADDCBR, model_crisv32_addcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5753 { CRISV32F_INSN_ADDCWR, model_crisv32_addcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5754 { CRISV32F_INSN_ADDCDR, model_crisv32_addcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5755 { CRISV32F_INSN_ADDS_B_R, model_crisv32_adds_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5756 { CRISV32F_INSN_ADDS_W_R, model_crisv32_adds_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5757 { CRISV32F_INSN_ADDS_M_B_M, model_crisv32_adds_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5758 { CRISV32F_INSN_ADDS_M_W_M, model_crisv32_adds_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5759 { CRISV32F_INSN_ADDSCBR, model_crisv32_addscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5760 { CRISV32F_INSN_ADDSCWR, model_crisv32_addscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5761 { CRISV32F_INSN_ADDU_B_R, model_crisv32_addu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5762 { CRISV32F_INSN_ADDU_W_R, model_crisv32_addu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5763 { CRISV32F_INSN_ADDU_M_B_M, model_crisv32_addu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5764 { CRISV32F_INSN_ADDU_M_W_M, model_crisv32_addu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5765 { CRISV32F_INSN_ADDUCBR, model_crisv32_adducbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5766 { CRISV32F_INSN_ADDUCWR, model_crisv32_adducwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5767 { CRISV32F_INSN_SUB_B_R, model_crisv32_sub_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5768 { CRISV32F_INSN_SUB_W_R, model_crisv32_sub_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5769 { CRISV32F_INSN_SUB_D_R, model_crisv32_sub_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5770 { CRISV32F_INSN_SUB_M_B_M, model_crisv32_sub_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5771 { CRISV32F_INSN_SUB_M_W_M, model_crisv32_sub_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5772 { CRISV32F_INSN_SUB_M_D_M, model_crisv32_sub_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5773 { CRISV32F_INSN_SUBCBR, model_crisv32_subcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5774 { CRISV32F_INSN_SUBCWR, model_crisv32_subcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5775 { CRISV32F_INSN_SUBCDR, model_crisv32_subcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5776 { CRISV32F_INSN_SUBS_B_R, model_crisv32_subs_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5777 { CRISV32F_INSN_SUBS_W_R, model_crisv32_subs_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5778 { CRISV32F_INSN_SUBS_M_B_M, model_crisv32_subs_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5779 { CRISV32F_INSN_SUBS_M_W_M, model_crisv32_subs_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5780 { CRISV32F_INSN_SUBSCBR, model_crisv32_subscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5781 { CRISV32F_INSN_SUBSCWR, model_crisv32_subscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5782 { CRISV32F_INSN_SUBU_B_R, model_crisv32_subu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5783 { CRISV32F_INSN_SUBU_W_R, model_crisv32_subu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5784 { CRISV32F_INSN_SUBU_M_B_M, model_crisv32_subu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5785 { CRISV32F_INSN_SUBU_M_W_M, model_crisv32_subu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5786 { CRISV32F_INSN_SUBUCBR, model_crisv32_subucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5787 { CRISV32F_INSN_SUBUCWR, model_crisv32_subucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5788 { CRISV32F_INSN_ADDC_R, model_crisv32_addc_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5789 { CRISV32F_INSN_ADDC_M, model_crisv32_addc_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5790 { CRISV32F_INSN_ADDC_C, model_crisv32_addc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5791 { CRISV32F_INSN_LAPC_D, model_crisv32_lapc_d, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5792 { CRISV32F_INSN_LAPCQ, model_crisv32_lapcq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5793 { CRISV32F_INSN_ADDI_B_R, model_crisv32_addi_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5794 { CRISV32F_INSN_ADDI_W_R, model_crisv32_addi_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5795 { CRISV32F_INSN_ADDI_D_R, model_crisv32_addi_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5796 { CRISV32F_INSN_NEG_B_R, model_crisv32_neg_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5797 { CRISV32F_INSN_NEG_W_R, model_crisv32_neg_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5798 { CRISV32F_INSN_NEG_D_R, model_crisv32_neg_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5799 { CRISV32F_INSN_TEST_M_B_M, model_crisv32_test_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5800 { CRISV32F_INSN_TEST_M_W_M, model_crisv32_test_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5801 { CRISV32F_INSN_TEST_M_D_M, model_crisv32_test_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5802 { CRISV32F_INSN_MOVE_R_M_B_M, model_crisv32_move_r_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5803 { CRISV32F_INSN_MOVE_R_M_W_M, model_crisv32_move_r_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5804 { CRISV32F_INSN_MOVE_R_M_D_M, model_crisv32_move_r_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5805 { CRISV32F_INSN_MULS_B, model_crisv32_muls_b, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5806 { CRISV32F_INSN_MULS_W, model_crisv32_muls_w, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5807 { CRISV32F_INSN_MULS_D, model_crisv32_muls_d, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5808 { CRISV32F_INSN_MULU_B, model_crisv32_mulu_b, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5809 { CRISV32F_INSN_MULU_W, model_crisv32_mulu_w, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5810 { CRISV32F_INSN_MULU_D, model_crisv32_mulu_d, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5811 { CRISV32F_INSN_MCP, model_crisv32_mcp, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5812 { CRISV32F_INSN_DSTEP, model_crisv32_dstep, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5813 { CRISV32F_INSN_ABS, model_crisv32_abs, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5814 { CRISV32F_INSN_AND_B_R, model_crisv32_and_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5815 { CRISV32F_INSN_AND_W_R, model_crisv32_and_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5816 { CRISV32F_INSN_AND_D_R, model_crisv32_and_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5817 { CRISV32F_INSN_AND_M_B_M, model_crisv32_and_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5818 { CRISV32F_INSN_AND_M_W_M, model_crisv32_and_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5819 { CRISV32F_INSN_AND_M_D_M, model_crisv32_and_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5820 { CRISV32F_INSN_ANDCBR, model_crisv32_andcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5821 { CRISV32F_INSN_ANDCWR, model_crisv32_andcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5822 { CRISV32F_INSN_ANDCDR, model_crisv32_andcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5823 { CRISV32F_INSN_ANDQ, model_crisv32_andq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5824 { CRISV32F_INSN_ORR_B_R, model_crisv32_orr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5825 { CRISV32F_INSN_ORR_W_R, model_crisv32_orr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5826 { CRISV32F_INSN_ORR_D_R, model_crisv32_orr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5827 { CRISV32F_INSN_OR_M_B_M, model_crisv32_or_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5828 { CRISV32F_INSN_OR_M_W_M, model_crisv32_or_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5829 { CRISV32F_INSN_OR_M_D_M, model_crisv32_or_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5830 { CRISV32F_INSN_ORCBR, model_crisv32_orcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5831 { CRISV32F_INSN_ORCWR, model_crisv32_orcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5832 { CRISV32F_INSN_ORCDR, model_crisv32_orcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5833 { CRISV32F_INSN_ORQ, model_crisv32_orq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5834 { CRISV32F_INSN_XOR, model_crisv32_xor, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5835 { CRISV32F_INSN_SWAP, model_crisv32_swap, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5836 { CRISV32F_INSN_ASRR_B_R, model_crisv32_asrr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5837 { CRISV32F_INSN_ASRR_W_R, model_crisv32_asrr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5838 { CRISV32F_INSN_ASRR_D_R, model_crisv32_asrr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5839 { CRISV32F_INSN_ASRQ, model_crisv32_asrq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5840 { CRISV32F_INSN_LSRR_B_R, model_crisv32_lsrr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5841 { CRISV32F_INSN_LSRR_W_R, model_crisv32_lsrr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5842 { CRISV32F_INSN_LSRR_D_R, model_crisv32_lsrr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5843 { CRISV32F_INSN_LSRQ, model_crisv32_lsrq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5844 { CRISV32F_INSN_LSLR_B_R, model_crisv32_lslr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5845 { CRISV32F_INSN_LSLR_W_R, model_crisv32_lslr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5846 { CRISV32F_INSN_LSLR_D_R, model_crisv32_lslr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5847 { CRISV32F_INSN_LSLQ, model_crisv32_lslq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5848 { CRISV32F_INSN_BTST, model_crisv32_btst, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5849 { CRISV32F_INSN_BTSTQ, model_crisv32_btstq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5850 { CRISV32F_INSN_SETF, model_crisv32_setf, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5851 { CRISV32F_INSN_CLEARF, model_crisv32_clearf, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5852 { CRISV32F_INSN_RFE, model_crisv32_rfe, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5853 { CRISV32F_INSN_SFE, model_crisv32_sfe, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5854 { CRISV32F_INSN_RFG, model_crisv32_rfg, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5855 { CRISV32F_INSN_RFN, model_crisv32_rfn, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5856 { CRISV32F_INSN_HALT, model_crisv32_halt, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5857 { CRISV32F_INSN_BCC_B, model_crisv32_bcc_b, { { (int) UNIT_CRISV32_U_BRANCH, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5858 { CRISV32F_INSN_BA_B, model_crisv32_ba_b, { { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5859 { CRISV32F_INSN_BCC_W, model_crisv32_bcc_w, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_BRANCH, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5860 { CRISV32F_INSN_BA_W, model_crisv32_ba_w, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5861 { CRISV32F_INSN_JAS_R, model_crisv32_jas_r, { { (int) UNIT_CRISV32_U_JUMP_R, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5862 { CRISV32F_INSN_JAS_C, model_crisv32_jas_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5863 { CRISV32F_INSN_JUMP_P, model_crisv32_jump_p, { { (int) UNIT_CRISV32_U_JUMP_SR, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5864 { CRISV32F_INSN_BAS_C, model_crisv32_bas_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5865 { CRISV32F_INSN_JASC_R, model_crisv32_jasc_r, { { (int) UNIT_CRISV32_U_JUMP_R, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5866 { CRISV32F_INSN_JASC_C, model_crisv32_jasc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5867 { CRISV32F_INSN_BASC_C, model_crisv32_basc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5868 { CRISV32F_INSN_BREAK, model_crisv32_break, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5869 { CRISV32F_INSN_BOUND_R_B_R, model_crisv32_bound_r_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5870 { CRISV32F_INSN_BOUND_R_W_R, model_crisv32_bound_r_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5871 { CRISV32F_INSN_BOUND_R_D_R, model_crisv32_bound_r_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5872 { CRISV32F_INSN_BOUND_CB, model_crisv32_bound_cb, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5873 { CRISV32F_INSN_BOUND_CW, model_crisv32_bound_cw, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5874 { CRISV32F_INSN_BOUND_CD, model_crisv32_bound_cd, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5875 { CRISV32F_INSN_SCC, model_crisv32_scc, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5876 { CRISV32F_INSN_LZ, model_crisv32_lz, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5877 { CRISV32F_INSN_ADDOQ, model_crisv32_addoq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5878 { CRISV32F_INSN_ADDO_M_B_M, model_crisv32_addo_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5879 { CRISV32F_INSN_ADDO_M_W_M, model_crisv32_addo_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5880 { CRISV32F_INSN_ADDO_M_D_M, model_crisv32_addo_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5881 { CRISV32F_INSN_ADDO_CB, model_crisv32_addo_cb, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5882 { CRISV32F_INSN_ADDO_CW, model_crisv32_addo_cw, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5883 { CRISV32F_INSN_ADDO_CD, model_crisv32_addo_cd, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5884 { CRISV32F_INSN_ADDI_ACR_B_R, model_crisv32_addi_acr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5885 { CRISV32F_INSN_ADDI_ACR_W_R, model_crisv32_addi_acr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5886 { CRISV32F_INSN_ADDI_ACR_D_R, model_crisv32_addi_acr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5887 { CRISV32F_INSN_FIDXI, model_crisv32_fidxi, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5888 { CRISV32F_INSN_FTAGI, model_crisv32_ftagi, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5889 { CRISV32F_INSN_FIDXD, model_crisv32_fidxd, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5890 { CRISV32F_INSN_FTAGD, model_crisv32_ftagd, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5893 #endif /* WITH_PROFILE_MODEL_P */
5895 static void
5896 crisv32_model_init (SIM_CPU *cpu)
5898 CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_CRISV32_DATA));
5901 #if WITH_PROFILE_MODEL_P
5902 #define TIMING_DATA(td) td
5903 #else
5904 #define TIMING_DATA(td) 0
5905 #endif
5907 static const MODEL crisv32_models[] =
5909 { "crisv32", & crisv32_mach, MODEL_CRISV32, TIMING_DATA (& crisv32_timing[0]), crisv32_model_init },
5910 { 0 }
5913 /* The properties of this cpu's implementation. */
5915 static const MACH_IMP_PROPERTIES crisv32f_imp_properties =
5917 sizeof (SIM_CPU),
5918 #if WITH_SCACHE
5919 sizeof (SCACHE)
5920 #else
5922 #endif
5926 static void
5927 crisv32f_prepare_run (SIM_CPU *cpu)
5929 if (CPU_IDESC (cpu) == NULL)
5930 crisv32f_init_idesc_table (cpu);
5933 static const CGEN_INSN *
5934 crisv32f_get_idata (SIM_CPU *cpu, int inum)
5936 return CPU_IDESC (cpu) [inum].idata;
5939 static void
5940 crisv32_init_cpu (SIM_CPU *cpu)
5942 CPU_REG_FETCH (cpu) = crisv32f_fetch_register;
5943 CPU_REG_STORE (cpu) = crisv32f_store_register;
5944 CPU_PC_FETCH (cpu) = crisv32f_h_pc_get;
5945 CPU_PC_STORE (cpu) = crisv32f_h_pc_set;
5946 CPU_GET_IDATA (cpu) = crisv32f_get_idata;
5947 CPU_MAX_INSNS (cpu) = CRISV32F_INSN__MAX;
5948 CPU_INSN_NAME (cpu) = cgen_insn_name;
5949 CPU_FULL_ENGINE_FN (cpu) = crisv32f_engine_run_full;
5950 #if WITH_FAST
5951 CPU_FAST_ENGINE_FN (cpu) = crisv32f_engine_run_fast;
5952 #else
5953 CPU_FAST_ENGINE_FN (cpu) = crisv32f_engine_run_full;
5954 #endif
5957 const MACH crisv32_mach =
5959 "crisv32", "crisv32", MACH_CRISV32,
5960 32, 32, & crisv32_models[0], & crisv32f_imp_properties,
5961 crisv32_init_cpu,
5962 crisv32f_prepare_run