1 /* Simulator model support for lm32bf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2005 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
25 #define WANT_CPU lm32bf
26 #define WANT_CPU_LM32BF
30 /* The profiling data is recorded here, but is accessed via the profiling
31 mechanism. After all, this is information for profiling. */
33 #if WITH_PROFILE_MODEL_P
35 /* Model handlers for each insn. */
38 model_lm32_add (SIM_CPU *current_cpu, void *sem_arg)
40 #define FLD(f) abuf->fields.sfmt_user.f
41 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
42 const IDESC * UNUSED idesc = abuf->idesc;
46 int UNUSED insn_referenced = abuf->written;
47 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
54 model_lm32_addi (SIM_CPU *current_cpu, void *sem_arg)
56 #define FLD(f) abuf->fields.sfmt_addi.f
57 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
58 const IDESC * UNUSED idesc = abuf->idesc;
62 int UNUSED insn_referenced = abuf->written;
63 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
70 model_lm32_and (SIM_CPU *current_cpu, void *sem_arg)
72 #define FLD(f) abuf->fields.sfmt_user.f
73 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
74 const IDESC * UNUSED idesc = abuf->idesc;
78 int UNUSED insn_referenced = abuf->written;
79 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
86 model_lm32_andi (SIM_CPU *current_cpu, void *sem_arg)
88 #define FLD(f) abuf->fields.sfmt_andi.f
89 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
90 const IDESC * UNUSED idesc = abuf->idesc;
94 int UNUSED insn_referenced = abuf->written;
95 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
102 model_lm32_andhii (SIM_CPU *current_cpu, void *sem_arg)
104 #define FLD(f) abuf->fields.sfmt_andi.f
105 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
106 const IDESC * UNUSED idesc = abuf->idesc;
110 int UNUSED insn_referenced = abuf->written;
111 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
118 model_lm32_b (SIM_CPU *current_cpu, void *sem_arg)
120 #define FLD(f) abuf->fields.sfmt_be.f
121 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
122 const IDESC * UNUSED idesc = abuf->idesc;
126 int UNUSED insn_referenced = abuf->written;
127 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
134 model_lm32_bi (SIM_CPU *current_cpu, void *sem_arg)
136 #define FLD(f) abuf->fields.sfmt_bi.f
137 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
138 const IDESC * UNUSED idesc = abuf->idesc;
142 int UNUSED insn_referenced = abuf->written;
143 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
150 model_lm32_be (SIM_CPU *current_cpu, void *sem_arg)
152 #define FLD(f) abuf->fields.sfmt_be.f
153 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
154 const IDESC * UNUSED idesc = abuf->idesc;
158 int UNUSED insn_referenced = abuf->written;
159 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
166 model_lm32_bg (SIM_CPU *current_cpu, void *sem_arg)
168 #define FLD(f) abuf->fields.sfmt_be.f
169 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
170 const IDESC * UNUSED idesc = abuf->idesc;
174 int UNUSED insn_referenced = abuf->written;
175 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
182 model_lm32_bge (SIM_CPU *current_cpu, void *sem_arg)
184 #define FLD(f) abuf->fields.sfmt_be.f
185 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
186 const IDESC * UNUSED idesc = abuf->idesc;
190 int UNUSED insn_referenced = abuf->written;
191 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
198 model_lm32_bgeu (SIM_CPU *current_cpu, void *sem_arg)
200 #define FLD(f) abuf->fields.sfmt_be.f
201 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
202 const IDESC * UNUSED idesc = abuf->idesc;
206 int UNUSED insn_referenced = abuf->written;
207 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
214 model_lm32_bgu (SIM_CPU *current_cpu, void *sem_arg)
216 #define FLD(f) abuf->fields.sfmt_be.f
217 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
218 const IDESC * UNUSED idesc = abuf->idesc;
222 int UNUSED insn_referenced = abuf->written;
223 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
230 model_lm32_bne (SIM_CPU *current_cpu, void *sem_arg)
232 #define FLD(f) abuf->fields.sfmt_be.f
233 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
234 const IDESC * UNUSED idesc = abuf->idesc;
238 int UNUSED insn_referenced = abuf->written;
239 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
246 model_lm32_call (SIM_CPU *current_cpu, void *sem_arg)
248 #define FLD(f) abuf->fields.sfmt_be.f
249 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
250 const IDESC * UNUSED idesc = abuf->idesc;
254 int UNUSED insn_referenced = abuf->written;
255 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
262 model_lm32_calli (SIM_CPU *current_cpu, void *sem_arg)
264 #define FLD(f) abuf->fields.sfmt_bi.f
265 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
266 const IDESC * UNUSED idesc = abuf->idesc;
270 int UNUSED insn_referenced = abuf->written;
271 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
278 model_lm32_cmpe (SIM_CPU *current_cpu, void *sem_arg)
280 #define FLD(f) abuf->fields.sfmt_user.f
281 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
282 const IDESC * UNUSED idesc = abuf->idesc;
286 int UNUSED insn_referenced = abuf->written;
287 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
294 model_lm32_cmpei (SIM_CPU *current_cpu, void *sem_arg)
296 #define FLD(f) abuf->fields.sfmt_addi.f
297 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
298 const IDESC * UNUSED idesc = abuf->idesc;
302 int UNUSED insn_referenced = abuf->written;
303 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
310 model_lm32_cmpg (SIM_CPU *current_cpu, void *sem_arg)
312 #define FLD(f) abuf->fields.sfmt_user.f
313 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
314 const IDESC * UNUSED idesc = abuf->idesc;
318 int UNUSED insn_referenced = abuf->written;
319 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
326 model_lm32_cmpgi (SIM_CPU *current_cpu, void *sem_arg)
328 #define FLD(f) abuf->fields.sfmt_addi.f
329 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
330 const IDESC * UNUSED idesc = abuf->idesc;
334 int UNUSED insn_referenced = abuf->written;
335 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
342 model_lm32_cmpge (SIM_CPU *current_cpu, void *sem_arg)
344 #define FLD(f) abuf->fields.sfmt_user.f
345 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
346 const IDESC * UNUSED idesc = abuf->idesc;
350 int UNUSED insn_referenced = abuf->written;
351 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
358 model_lm32_cmpgei (SIM_CPU *current_cpu, void *sem_arg)
360 #define FLD(f) abuf->fields.sfmt_addi.f
361 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
362 const IDESC * UNUSED idesc = abuf->idesc;
366 int UNUSED insn_referenced = abuf->written;
367 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
374 model_lm32_cmpgeu (SIM_CPU *current_cpu, void *sem_arg)
376 #define FLD(f) abuf->fields.sfmt_user.f
377 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
378 const IDESC * UNUSED idesc = abuf->idesc;
382 int UNUSED insn_referenced = abuf->written;
383 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
390 model_lm32_cmpgeui (SIM_CPU *current_cpu, void *sem_arg)
392 #define FLD(f) abuf->fields.sfmt_andi.f
393 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
394 const IDESC * UNUSED idesc = abuf->idesc;
398 int UNUSED insn_referenced = abuf->written;
399 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
406 model_lm32_cmpgu (SIM_CPU *current_cpu, void *sem_arg)
408 #define FLD(f) abuf->fields.sfmt_user.f
409 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
410 const IDESC * UNUSED idesc = abuf->idesc;
414 int UNUSED insn_referenced = abuf->written;
415 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
422 model_lm32_cmpgui (SIM_CPU *current_cpu, void *sem_arg)
424 #define FLD(f) abuf->fields.sfmt_andi.f
425 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
426 const IDESC * UNUSED idesc = abuf->idesc;
430 int UNUSED insn_referenced = abuf->written;
431 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
438 model_lm32_cmpne (SIM_CPU *current_cpu, void *sem_arg)
440 #define FLD(f) abuf->fields.sfmt_user.f
441 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
442 const IDESC * UNUSED idesc = abuf->idesc;
446 int UNUSED insn_referenced = abuf->written;
447 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
454 model_lm32_cmpnei (SIM_CPU *current_cpu, void *sem_arg)
456 #define FLD(f) abuf->fields.sfmt_addi.f
457 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
458 const IDESC * UNUSED idesc = abuf->idesc;
462 int UNUSED insn_referenced = abuf->written;
463 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
470 model_lm32_divu (SIM_CPU *current_cpu, void *sem_arg)
472 #define FLD(f) abuf->fields.sfmt_user.f
473 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
474 const IDESC * UNUSED idesc = abuf->idesc;
478 int UNUSED insn_referenced = abuf->written;
479 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
486 model_lm32_lb (SIM_CPU *current_cpu, void *sem_arg)
488 #define FLD(f) abuf->fields.sfmt_addi.f
489 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
490 const IDESC * UNUSED idesc = abuf->idesc;
494 int UNUSED insn_referenced = abuf->written;
495 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
502 model_lm32_lbu (SIM_CPU *current_cpu, void *sem_arg)
504 #define FLD(f) abuf->fields.sfmt_addi.f
505 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
506 const IDESC * UNUSED idesc = abuf->idesc;
510 int UNUSED insn_referenced = abuf->written;
511 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
518 model_lm32_lh (SIM_CPU *current_cpu, void *sem_arg)
520 #define FLD(f) abuf->fields.sfmt_addi.f
521 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
522 const IDESC * UNUSED idesc = abuf->idesc;
526 int UNUSED insn_referenced = abuf->written;
527 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
534 model_lm32_lhu (SIM_CPU *current_cpu, void *sem_arg)
536 #define FLD(f) abuf->fields.sfmt_addi.f
537 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
538 const IDESC * UNUSED idesc = abuf->idesc;
542 int UNUSED insn_referenced = abuf->written;
543 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
550 model_lm32_lw (SIM_CPU *current_cpu, void *sem_arg)
552 #define FLD(f) abuf->fields.sfmt_addi.f
553 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
554 const IDESC * UNUSED idesc = abuf->idesc;
558 int UNUSED insn_referenced = abuf->written;
559 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
566 model_lm32_modu (SIM_CPU *current_cpu, void *sem_arg)
568 #define FLD(f) abuf->fields.sfmt_user.f
569 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
570 const IDESC * UNUSED idesc = abuf->idesc;
574 int UNUSED insn_referenced = abuf->written;
575 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
582 model_lm32_mul (SIM_CPU *current_cpu, void *sem_arg)
584 #define FLD(f) abuf->fields.sfmt_user.f
585 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
586 const IDESC * UNUSED idesc = abuf->idesc;
590 int UNUSED insn_referenced = abuf->written;
591 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
598 model_lm32_muli (SIM_CPU *current_cpu, void *sem_arg)
600 #define FLD(f) abuf->fields.sfmt_addi.f
601 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
602 const IDESC * UNUSED idesc = abuf->idesc;
606 int UNUSED insn_referenced = abuf->written;
607 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
614 model_lm32_nor (SIM_CPU *current_cpu, void *sem_arg)
616 #define FLD(f) abuf->fields.sfmt_user.f
617 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
618 const IDESC * UNUSED idesc = abuf->idesc;
622 int UNUSED insn_referenced = abuf->written;
623 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
630 model_lm32_nori (SIM_CPU *current_cpu, void *sem_arg)
632 #define FLD(f) abuf->fields.sfmt_andi.f
633 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
634 const IDESC * UNUSED idesc = abuf->idesc;
638 int UNUSED insn_referenced = abuf->written;
639 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
646 model_lm32_or (SIM_CPU *current_cpu, void *sem_arg)
648 #define FLD(f) abuf->fields.sfmt_user.f
649 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
650 const IDESC * UNUSED idesc = abuf->idesc;
654 int UNUSED insn_referenced = abuf->written;
655 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
662 model_lm32_ori (SIM_CPU *current_cpu, void *sem_arg)
664 #define FLD(f) abuf->fields.sfmt_andi.f
665 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
666 const IDESC * UNUSED idesc = abuf->idesc;
670 int UNUSED insn_referenced = abuf->written;
671 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
678 model_lm32_orhii (SIM_CPU *current_cpu, void *sem_arg)
680 #define FLD(f) abuf->fields.sfmt_andi.f
681 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
682 const IDESC * UNUSED idesc = abuf->idesc;
686 int UNUSED insn_referenced = abuf->written;
687 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
694 model_lm32_rcsr (SIM_CPU *current_cpu, void *sem_arg)
696 #define FLD(f) abuf->fields.sfmt_rcsr.f
697 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
698 const IDESC * UNUSED idesc = abuf->idesc;
702 int UNUSED insn_referenced = abuf->written;
703 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
710 model_lm32_sb (SIM_CPU *current_cpu, void *sem_arg)
712 #define FLD(f) abuf->fields.sfmt_addi.f
713 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
714 const IDESC * UNUSED idesc = abuf->idesc;
718 int UNUSED insn_referenced = abuf->written;
719 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
726 model_lm32_sextb (SIM_CPU *current_cpu, void *sem_arg)
728 #define FLD(f) abuf->fields.sfmt_user.f
729 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
730 const IDESC * UNUSED idesc = abuf->idesc;
734 int UNUSED insn_referenced = abuf->written;
735 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
742 model_lm32_sexth (SIM_CPU *current_cpu, void *sem_arg)
744 #define FLD(f) abuf->fields.sfmt_user.f
745 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
746 const IDESC * UNUSED idesc = abuf->idesc;
750 int UNUSED insn_referenced = abuf->written;
751 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
758 model_lm32_sh (SIM_CPU *current_cpu, void *sem_arg)
760 #define FLD(f) abuf->fields.sfmt_addi.f
761 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
762 const IDESC * UNUSED idesc = abuf->idesc;
766 int UNUSED insn_referenced = abuf->written;
767 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
774 model_lm32_sl (SIM_CPU *current_cpu, void *sem_arg)
776 #define FLD(f) abuf->fields.sfmt_user.f
777 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
778 const IDESC * UNUSED idesc = abuf->idesc;
782 int UNUSED insn_referenced = abuf->written;
783 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
790 model_lm32_sli (SIM_CPU *current_cpu, void *sem_arg)
792 #define FLD(f) abuf->fields.sfmt_addi.f
793 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
794 const IDESC * UNUSED idesc = abuf->idesc;
798 int UNUSED insn_referenced = abuf->written;
799 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
806 model_lm32_sr (SIM_CPU *current_cpu, void *sem_arg)
808 #define FLD(f) abuf->fields.sfmt_user.f
809 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
810 const IDESC * UNUSED idesc = abuf->idesc;
814 int UNUSED insn_referenced = abuf->written;
815 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
822 model_lm32_sri (SIM_CPU *current_cpu, void *sem_arg)
824 #define FLD(f) abuf->fields.sfmt_addi.f
825 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
826 const IDESC * UNUSED idesc = abuf->idesc;
830 int UNUSED insn_referenced = abuf->written;
831 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
838 model_lm32_sru (SIM_CPU *current_cpu, void *sem_arg)
840 #define FLD(f) abuf->fields.sfmt_user.f
841 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
842 const IDESC * UNUSED idesc = abuf->idesc;
846 int UNUSED insn_referenced = abuf->written;
847 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
854 model_lm32_srui (SIM_CPU *current_cpu, void *sem_arg)
856 #define FLD(f) abuf->fields.sfmt_addi.f
857 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
858 const IDESC * UNUSED idesc = abuf->idesc;
862 int UNUSED insn_referenced = abuf->written;
863 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
870 model_lm32_sub (SIM_CPU *current_cpu, void *sem_arg)
872 #define FLD(f) abuf->fields.sfmt_user.f
873 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
874 const IDESC * UNUSED idesc = abuf->idesc;
878 int UNUSED insn_referenced = abuf->written;
879 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
886 model_lm32_sw (SIM_CPU *current_cpu, void *sem_arg)
888 #define FLD(f) abuf->fields.sfmt_addi.f
889 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
890 const IDESC * UNUSED idesc = abuf->idesc;
894 int UNUSED insn_referenced = abuf->written;
895 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
902 model_lm32_user (SIM_CPU *current_cpu, void *sem_arg)
904 #define FLD(f) abuf->fields.sfmt_user.f
905 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
906 const IDESC * UNUSED idesc = abuf->idesc;
910 int UNUSED insn_referenced = abuf->written;
911 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
918 model_lm32_wcsr (SIM_CPU *current_cpu, void *sem_arg)
920 #define FLD(f) abuf->fields.sfmt_wcsr.f
921 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
922 const IDESC * UNUSED idesc = abuf->idesc;
926 int UNUSED insn_referenced = abuf->written;
927 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
934 model_lm32_xor (SIM_CPU *current_cpu, void *sem_arg)
936 #define FLD(f) abuf->fields.sfmt_user.f
937 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
938 const IDESC * UNUSED idesc = abuf->idesc;
942 int UNUSED insn_referenced = abuf->written;
943 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
950 model_lm32_xori (SIM_CPU *current_cpu, void *sem_arg)
952 #define FLD(f) abuf->fields.sfmt_andi.f
953 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
954 const IDESC * UNUSED idesc = abuf->idesc;
958 int UNUSED insn_referenced = abuf->written;
959 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
966 model_lm32_xnor (SIM_CPU *current_cpu, void *sem_arg)
968 #define FLD(f) abuf->fields.sfmt_user.f
969 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
970 const IDESC * UNUSED idesc = abuf->idesc;
974 int UNUSED insn_referenced = abuf->written;
975 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
982 model_lm32_xnori (SIM_CPU *current_cpu, void *sem_arg)
984 #define FLD(f) abuf->fields.sfmt_andi.f
985 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
986 const IDESC * UNUSED idesc = abuf->idesc;
990 int UNUSED insn_referenced = abuf->written;
991 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
998 model_lm32_break (SIM_CPU *current_cpu, void *sem_arg)
1000 #define FLD(f) abuf->fields.fmt_empty.f
1001 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1002 const IDESC * UNUSED idesc = abuf->idesc;
1006 int UNUSED insn_referenced = abuf->written;
1007 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
1014 model_lm32_scall (SIM_CPU *current_cpu, void *sem_arg)
1016 #define FLD(f) abuf->fields.fmt_empty.f
1017 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1018 const IDESC * UNUSED idesc = abuf->idesc;
1022 int UNUSED insn_referenced = abuf->written;
1023 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
1029 /* We assume UNIT_NONE == 0 because the tables don't always terminate
1032 /* Model timing data for `lm32'. */
1034 static const INSN_TIMING lm32_timing[] = {
1035 { LM32BF_INSN_X_INVALID, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1036 { LM32BF_INSN_X_AFTER, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1037 { LM32BF_INSN_X_BEFORE, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1038 { LM32BF_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1039 { LM32BF_INSN_X_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1040 { LM32BF_INSN_X_BEGIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1041 { LM32BF_INSN_ADD, model_lm32_add, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1042 { LM32BF_INSN_ADDI, model_lm32_addi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1043 { LM32BF_INSN_AND, model_lm32_and, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1044 { LM32BF_INSN_ANDI, model_lm32_andi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1045 { LM32BF_INSN_ANDHII, model_lm32_andhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1046 { LM32BF_INSN_B, model_lm32_b, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1047 { LM32BF_INSN_BI, model_lm32_bi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1048 { LM32BF_INSN_BE, model_lm32_be, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1049 { LM32BF_INSN_BG, model_lm32_bg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1050 { LM32BF_INSN_BGE, model_lm32_bge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1051 { LM32BF_INSN_BGEU, model_lm32_bgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1052 { LM32BF_INSN_BGU, model_lm32_bgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1053 { LM32BF_INSN_BNE, model_lm32_bne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1054 { LM32BF_INSN_CALL, model_lm32_call, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1055 { LM32BF_INSN_CALLI, model_lm32_calli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1056 { LM32BF_INSN_CMPE, model_lm32_cmpe, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1057 { LM32BF_INSN_CMPEI, model_lm32_cmpei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1058 { LM32BF_INSN_CMPG, model_lm32_cmpg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1059 { LM32BF_INSN_CMPGI, model_lm32_cmpgi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1060 { LM32BF_INSN_CMPGE, model_lm32_cmpge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1061 { LM32BF_INSN_CMPGEI, model_lm32_cmpgei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1062 { LM32BF_INSN_CMPGEU, model_lm32_cmpgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1063 { LM32BF_INSN_CMPGEUI, model_lm32_cmpgeui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1064 { LM32BF_INSN_CMPGU, model_lm32_cmpgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1065 { LM32BF_INSN_CMPGUI, model_lm32_cmpgui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1066 { LM32BF_INSN_CMPNE, model_lm32_cmpne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1067 { LM32BF_INSN_CMPNEI, model_lm32_cmpnei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1068 { LM32BF_INSN_DIVU, model_lm32_divu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1069 { LM32BF_INSN_LB, model_lm32_lb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1070 { LM32BF_INSN_LBU, model_lm32_lbu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1071 { LM32BF_INSN_LH, model_lm32_lh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1072 { LM32BF_INSN_LHU, model_lm32_lhu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1073 { LM32BF_INSN_LW, model_lm32_lw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1074 { LM32BF_INSN_MODU, model_lm32_modu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1075 { LM32BF_INSN_MUL, model_lm32_mul, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1076 { LM32BF_INSN_MULI, model_lm32_muli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1077 { LM32BF_INSN_NOR, model_lm32_nor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1078 { LM32BF_INSN_NORI, model_lm32_nori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1079 { LM32BF_INSN_OR, model_lm32_or, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1080 { LM32BF_INSN_ORI, model_lm32_ori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1081 { LM32BF_INSN_ORHII, model_lm32_orhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1082 { LM32BF_INSN_RCSR, model_lm32_rcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1083 { LM32BF_INSN_SB, model_lm32_sb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1084 { LM32BF_INSN_SEXTB, model_lm32_sextb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1085 { LM32BF_INSN_SEXTH, model_lm32_sexth, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1086 { LM32BF_INSN_SH, model_lm32_sh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1087 { LM32BF_INSN_SL, model_lm32_sl, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1088 { LM32BF_INSN_SLI, model_lm32_sli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1089 { LM32BF_INSN_SR, model_lm32_sr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1090 { LM32BF_INSN_SRI, model_lm32_sri, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1091 { LM32BF_INSN_SRU, model_lm32_sru, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1092 { LM32BF_INSN_SRUI, model_lm32_srui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1093 { LM32BF_INSN_SUB, model_lm32_sub, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1094 { LM32BF_INSN_SW, model_lm32_sw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1095 { LM32BF_INSN_USER, model_lm32_user, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1096 { LM32BF_INSN_WCSR, model_lm32_wcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1097 { LM32BF_INSN_XOR, model_lm32_xor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1098 { LM32BF_INSN_XORI, model_lm32_xori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1099 { LM32BF_INSN_XNOR, model_lm32_xnor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1100 { LM32BF_INSN_XNORI, model_lm32_xnori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1101 { LM32BF_INSN_BREAK, model_lm32_break, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1102 { LM32BF_INSN_SCALL, model_lm32_scall, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1105 #endif /* WITH_PROFILE_MODEL_P */
1108 lm32_model_init (SIM_CPU *cpu)
1110 CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_LM32_DATA));
1113 #if WITH_PROFILE_MODEL_P
1114 #define TIMING_DATA(td) td
1116 #define TIMING_DATA(td) 0
1119 static const MODEL lm32_models[] =
1121 { "lm32", & lm32_mach, MODEL_LM32, TIMING_DATA (& lm32_timing[0]), lm32_model_init },
1125 /* The properties of this cpu's implementation. */
1127 static const MACH_IMP_PROPERTIES lm32bf_imp_properties =
1139 lm32bf_prepare_run (SIM_CPU *cpu)
1141 if (CPU_IDESC (cpu) == NULL)
1142 lm32bf_init_idesc_table (cpu);
1145 static const CGEN_INSN *
1146 lm32bf_get_idata (SIM_CPU *cpu, int inum)
1148 return CPU_IDESC (cpu) [inum].idata;
1152 lm32_init_cpu (SIM_CPU *cpu)
1154 CPU_REG_FETCH (cpu) = lm32bf_fetch_register;
1155 CPU_REG_STORE (cpu) = lm32bf_store_register;
1156 CPU_PC_FETCH (cpu) = lm32bf_h_pc_get;
1157 CPU_PC_STORE (cpu) = lm32bf_h_pc_set;
1158 CPU_GET_IDATA (cpu) = lm32bf_get_idata;
1159 CPU_MAX_INSNS (cpu) = LM32BF_INSN__MAX;
1160 CPU_INSN_NAME (cpu) = cgen_insn_name;
1161 CPU_FULL_ENGINE_FN (cpu) = lm32bf_engine_run_full;
1163 CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_fast;
1165 CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_full;
1169 const MACH lm32_mach =
1171 "lm32", "lm32", MACH_LM32,
1172 32, 32, & lm32_models[0], & lm32bf_imp_properties,