1 /* Simulator model support for lm32bf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2016 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)
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 lm32bf
25 #define WANT_CPU_LM32BF
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. */
37 model_lm32_add (SIM_CPU *current_cpu, void *sem_arg)
39 #define FLD(f) abuf->fields.sfmt_user.f
40 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
41 const IDESC * UNUSED idesc = abuf->idesc;
45 int UNUSED insn_referenced = abuf->written;
46 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
53 model_lm32_addi (SIM_CPU *current_cpu, void *sem_arg)
55 #define FLD(f) abuf->fields.sfmt_addi.f
56 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
57 const IDESC * UNUSED idesc = abuf->idesc;
61 int UNUSED insn_referenced = abuf->written;
62 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
69 model_lm32_and (SIM_CPU *current_cpu, void *sem_arg)
71 #define FLD(f) abuf->fields.sfmt_user.f
72 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
73 const IDESC * UNUSED idesc = abuf->idesc;
77 int UNUSED insn_referenced = abuf->written;
78 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
85 model_lm32_andi (SIM_CPU *current_cpu, void *sem_arg)
87 #define FLD(f) abuf->fields.sfmt_andi.f
88 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
89 const IDESC * UNUSED idesc = abuf->idesc;
93 int UNUSED insn_referenced = abuf->written;
94 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
101 model_lm32_andhii (SIM_CPU *current_cpu, void *sem_arg)
103 #define FLD(f) abuf->fields.sfmt_andi.f
104 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
105 const IDESC * UNUSED idesc = abuf->idesc;
109 int UNUSED insn_referenced = abuf->written;
110 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
117 model_lm32_b (SIM_CPU *current_cpu, void *sem_arg)
119 #define FLD(f) abuf->fields.sfmt_be.f
120 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
121 const IDESC * UNUSED idesc = abuf->idesc;
125 int UNUSED insn_referenced = abuf->written;
126 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
133 model_lm32_bi (SIM_CPU *current_cpu, void *sem_arg)
135 #define FLD(f) abuf->fields.sfmt_bi.f
136 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
137 const IDESC * UNUSED idesc = abuf->idesc;
141 int UNUSED insn_referenced = abuf->written;
142 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
149 model_lm32_be (SIM_CPU *current_cpu, void *sem_arg)
151 #define FLD(f) abuf->fields.sfmt_be.f
152 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
153 const IDESC * UNUSED idesc = abuf->idesc;
157 int UNUSED insn_referenced = abuf->written;
158 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
165 model_lm32_bg (SIM_CPU *current_cpu, void *sem_arg)
167 #define FLD(f) abuf->fields.sfmt_be.f
168 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
169 const IDESC * UNUSED idesc = abuf->idesc;
173 int UNUSED insn_referenced = abuf->written;
174 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
181 model_lm32_bge (SIM_CPU *current_cpu, void *sem_arg)
183 #define FLD(f) abuf->fields.sfmt_be.f
184 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
185 const IDESC * UNUSED idesc = abuf->idesc;
189 int UNUSED insn_referenced = abuf->written;
190 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
197 model_lm32_bgeu (SIM_CPU *current_cpu, void *sem_arg)
199 #define FLD(f) abuf->fields.sfmt_be.f
200 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
201 const IDESC * UNUSED idesc = abuf->idesc;
205 int UNUSED insn_referenced = abuf->written;
206 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
213 model_lm32_bgu (SIM_CPU *current_cpu, void *sem_arg)
215 #define FLD(f) abuf->fields.sfmt_be.f
216 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
217 const IDESC * UNUSED idesc = abuf->idesc;
221 int UNUSED insn_referenced = abuf->written;
222 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
229 model_lm32_bne (SIM_CPU *current_cpu, void *sem_arg)
231 #define FLD(f) abuf->fields.sfmt_be.f
232 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
233 const IDESC * UNUSED idesc = abuf->idesc;
237 int UNUSED insn_referenced = abuf->written;
238 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
245 model_lm32_call (SIM_CPU *current_cpu, void *sem_arg)
247 #define FLD(f) abuf->fields.sfmt_be.f
248 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
249 const IDESC * UNUSED idesc = abuf->idesc;
253 int UNUSED insn_referenced = abuf->written;
254 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
261 model_lm32_calli (SIM_CPU *current_cpu, void *sem_arg)
263 #define FLD(f) abuf->fields.sfmt_bi.f
264 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
265 const IDESC * UNUSED idesc = abuf->idesc;
269 int UNUSED insn_referenced = abuf->written;
270 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
277 model_lm32_cmpe (SIM_CPU *current_cpu, void *sem_arg)
279 #define FLD(f) abuf->fields.sfmt_user.f
280 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
281 const IDESC * UNUSED idesc = abuf->idesc;
285 int UNUSED insn_referenced = abuf->written;
286 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
293 model_lm32_cmpei (SIM_CPU *current_cpu, void *sem_arg)
295 #define FLD(f) abuf->fields.sfmt_addi.f
296 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
297 const IDESC * UNUSED idesc = abuf->idesc;
301 int UNUSED insn_referenced = abuf->written;
302 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
309 model_lm32_cmpg (SIM_CPU *current_cpu, void *sem_arg)
311 #define FLD(f) abuf->fields.sfmt_user.f
312 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
313 const IDESC * UNUSED idesc = abuf->idesc;
317 int UNUSED insn_referenced = abuf->written;
318 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
325 model_lm32_cmpgi (SIM_CPU *current_cpu, void *sem_arg)
327 #define FLD(f) abuf->fields.sfmt_addi.f
328 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
329 const IDESC * UNUSED idesc = abuf->idesc;
333 int UNUSED insn_referenced = abuf->written;
334 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
341 model_lm32_cmpge (SIM_CPU *current_cpu, void *sem_arg)
343 #define FLD(f) abuf->fields.sfmt_user.f
344 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
345 const IDESC * UNUSED idesc = abuf->idesc;
349 int UNUSED insn_referenced = abuf->written;
350 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
357 model_lm32_cmpgei (SIM_CPU *current_cpu, void *sem_arg)
359 #define FLD(f) abuf->fields.sfmt_addi.f
360 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
361 const IDESC * UNUSED idesc = abuf->idesc;
365 int UNUSED insn_referenced = abuf->written;
366 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
373 model_lm32_cmpgeu (SIM_CPU *current_cpu, void *sem_arg)
375 #define FLD(f) abuf->fields.sfmt_user.f
376 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
377 const IDESC * UNUSED idesc = abuf->idesc;
381 int UNUSED insn_referenced = abuf->written;
382 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
389 model_lm32_cmpgeui (SIM_CPU *current_cpu, void *sem_arg)
391 #define FLD(f) abuf->fields.sfmt_andi.f
392 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
393 const IDESC * UNUSED idesc = abuf->idesc;
397 int UNUSED insn_referenced = abuf->written;
398 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
405 model_lm32_cmpgu (SIM_CPU *current_cpu, void *sem_arg)
407 #define FLD(f) abuf->fields.sfmt_user.f
408 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
409 const IDESC * UNUSED idesc = abuf->idesc;
413 int UNUSED insn_referenced = abuf->written;
414 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
421 model_lm32_cmpgui (SIM_CPU *current_cpu, void *sem_arg)
423 #define FLD(f) abuf->fields.sfmt_andi.f
424 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
425 const IDESC * UNUSED idesc = abuf->idesc;
429 int UNUSED insn_referenced = abuf->written;
430 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
437 model_lm32_cmpne (SIM_CPU *current_cpu, void *sem_arg)
439 #define FLD(f) abuf->fields.sfmt_user.f
440 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
441 const IDESC * UNUSED idesc = abuf->idesc;
445 int UNUSED insn_referenced = abuf->written;
446 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
453 model_lm32_cmpnei (SIM_CPU *current_cpu, void *sem_arg)
455 #define FLD(f) abuf->fields.sfmt_addi.f
456 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
457 const IDESC * UNUSED idesc = abuf->idesc;
461 int UNUSED insn_referenced = abuf->written;
462 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
469 model_lm32_divu (SIM_CPU *current_cpu, void *sem_arg)
471 #define FLD(f) abuf->fields.sfmt_user.f
472 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
473 const IDESC * UNUSED idesc = abuf->idesc;
477 int UNUSED insn_referenced = abuf->written;
478 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
485 model_lm32_lb (SIM_CPU *current_cpu, void *sem_arg)
487 #define FLD(f) abuf->fields.sfmt_addi.f
488 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
489 const IDESC * UNUSED idesc = abuf->idesc;
493 int UNUSED insn_referenced = abuf->written;
494 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
501 model_lm32_lbu (SIM_CPU *current_cpu, void *sem_arg)
503 #define FLD(f) abuf->fields.sfmt_addi.f
504 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
505 const IDESC * UNUSED idesc = abuf->idesc;
509 int UNUSED insn_referenced = abuf->written;
510 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
517 model_lm32_lh (SIM_CPU *current_cpu, void *sem_arg)
519 #define FLD(f) abuf->fields.sfmt_addi.f
520 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
521 const IDESC * UNUSED idesc = abuf->idesc;
525 int UNUSED insn_referenced = abuf->written;
526 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
533 model_lm32_lhu (SIM_CPU *current_cpu, void *sem_arg)
535 #define FLD(f) abuf->fields.sfmt_addi.f
536 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
537 const IDESC * UNUSED idesc = abuf->idesc;
541 int UNUSED insn_referenced = abuf->written;
542 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
549 model_lm32_lw (SIM_CPU *current_cpu, void *sem_arg)
551 #define FLD(f) abuf->fields.sfmt_addi.f
552 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
553 const IDESC * UNUSED idesc = abuf->idesc;
557 int UNUSED insn_referenced = abuf->written;
558 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
565 model_lm32_modu (SIM_CPU *current_cpu, void *sem_arg)
567 #define FLD(f) abuf->fields.sfmt_user.f
568 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
569 const IDESC * UNUSED idesc = abuf->idesc;
573 int UNUSED insn_referenced = abuf->written;
574 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
581 model_lm32_mul (SIM_CPU *current_cpu, void *sem_arg)
583 #define FLD(f) abuf->fields.sfmt_user.f
584 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
585 const IDESC * UNUSED idesc = abuf->idesc;
589 int UNUSED insn_referenced = abuf->written;
590 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
597 model_lm32_muli (SIM_CPU *current_cpu, void *sem_arg)
599 #define FLD(f) abuf->fields.sfmt_addi.f
600 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
601 const IDESC * UNUSED idesc = abuf->idesc;
605 int UNUSED insn_referenced = abuf->written;
606 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
613 model_lm32_nor (SIM_CPU *current_cpu, void *sem_arg)
615 #define FLD(f) abuf->fields.sfmt_user.f
616 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
617 const IDESC * UNUSED idesc = abuf->idesc;
621 int UNUSED insn_referenced = abuf->written;
622 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
629 model_lm32_nori (SIM_CPU *current_cpu, void *sem_arg)
631 #define FLD(f) abuf->fields.sfmt_andi.f
632 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
633 const IDESC * UNUSED idesc = abuf->idesc;
637 int UNUSED insn_referenced = abuf->written;
638 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
645 model_lm32_or (SIM_CPU *current_cpu, void *sem_arg)
647 #define FLD(f) abuf->fields.sfmt_user.f
648 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
649 const IDESC * UNUSED idesc = abuf->idesc;
653 int UNUSED insn_referenced = abuf->written;
654 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
661 model_lm32_ori (SIM_CPU *current_cpu, void *sem_arg)
663 #define FLD(f) abuf->fields.sfmt_andi.f
664 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
665 const IDESC * UNUSED idesc = abuf->idesc;
669 int UNUSED insn_referenced = abuf->written;
670 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
677 model_lm32_orhii (SIM_CPU *current_cpu, void *sem_arg)
679 #define FLD(f) abuf->fields.sfmt_andi.f
680 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
681 const IDESC * UNUSED idesc = abuf->idesc;
685 int UNUSED insn_referenced = abuf->written;
686 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
693 model_lm32_rcsr (SIM_CPU *current_cpu, void *sem_arg)
695 #define FLD(f) abuf->fields.sfmt_rcsr.f
696 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
697 const IDESC * UNUSED idesc = abuf->idesc;
701 int UNUSED insn_referenced = abuf->written;
702 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
709 model_lm32_sb (SIM_CPU *current_cpu, void *sem_arg)
711 #define FLD(f) abuf->fields.sfmt_addi.f
712 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
713 const IDESC * UNUSED idesc = abuf->idesc;
717 int UNUSED insn_referenced = abuf->written;
718 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
725 model_lm32_sextb (SIM_CPU *current_cpu, void *sem_arg)
727 #define FLD(f) abuf->fields.sfmt_user.f
728 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
729 const IDESC * UNUSED idesc = abuf->idesc;
733 int UNUSED insn_referenced = abuf->written;
734 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
741 model_lm32_sexth (SIM_CPU *current_cpu, void *sem_arg)
743 #define FLD(f) abuf->fields.sfmt_user.f
744 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
745 const IDESC * UNUSED idesc = abuf->idesc;
749 int UNUSED insn_referenced = abuf->written;
750 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
757 model_lm32_sh (SIM_CPU *current_cpu, void *sem_arg)
759 #define FLD(f) abuf->fields.sfmt_addi.f
760 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
761 const IDESC * UNUSED idesc = abuf->idesc;
765 int UNUSED insn_referenced = abuf->written;
766 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
773 model_lm32_sl (SIM_CPU *current_cpu, void *sem_arg)
775 #define FLD(f) abuf->fields.sfmt_user.f
776 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
777 const IDESC * UNUSED idesc = abuf->idesc;
781 int UNUSED insn_referenced = abuf->written;
782 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
789 model_lm32_sli (SIM_CPU *current_cpu, void *sem_arg)
791 #define FLD(f) abuf->fields.sfmt_addi.f
792 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
793 const IDESC * UNUSED idesc = abuf->idesc;
797 int UNUSED insn_referenced = abuf->written;
798 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
805 model_lm32_sr (SIM_CPU *current_cpu, void *sem_arg)
807 #define FLD(f) abuf->fields.sfmt_user.f
808 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
809 const IDESC * UNUSED idesc = abuf->idesc;
813 int UNUSED insn_referenced = abuf->written;
814 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
821 model_lm32_sri (SIM_CPU *current_cpu, void *sem_arg)
823 #define FLD(f) abuf->fields.sfmt_addi.f
824 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
825 const IDESC * UNUSED idesc = abuf->idesc;
829 int UNUSED insn_referenced = abuf->written;
830 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
837 model_lm32_sru (SIM_CPU *current_cpu, void *sem_arg)
839 #define FLD(f) abuf->fields.sfmt_user.f
840 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
841 const IDESC * UNUSED idesc = abuf->idesc;
845 int UNUSED insn_referenced = abuf->written;
846 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
853 model_lm32_srui (SIM_CPU *current_cpu, void *sem_arg)
855 #define FLD(f) abuf->fields.sfmt_addi.f
856 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
857 const IDESC * UNUSED idesc = abuf->idesc;
861 int UNUSED insn_referenced = abuf->written;
862 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
869 model_lm32_sub (SIM_CPU *current_cpu, void *sem_arg)
871 #define FLD(f) abuf->fields.sfmt_user.f
872 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
873 const IDESC * UNUSED idesc = abuf->idesc;
877 int UNUSED insn_referenced = abuf->written;
878 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
885 model_lm32_sw (SIM_CPU *current_cpu, void *sem_arg)
887 #define FLD(f) abuf->fields.sfmt_addi.f
888 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
889 const IDESC * UNUSED idesc = abuf->idesc;
893 int UNUSED insn_referenced = abuf->written;
894 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
901 model_lm32_user (SIM_CPU *current_cpu, void *sem_arg)
903 #define FLD(f) abuf->fields.sfmt_user.f
904 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
905 const IDESC * UNUSED idesc = abuf->idesc;
909 int UNUSED insn_referenced = abuf->written;
910 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
917 model_lm32_wcsr (SIM_CPU *current_cpu, void *sem_arg)
919 #define FLD(f) abuf->fields.sfmt_wcsr.f
920 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
921 const IDESC * UNUSED idesc = abuf->idesc;
925 int UNUSED insn_referenced = abuf->written;
926 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
933 model_lm32_xor (SIM_CPU *current_cpu, void *sem_arg)
935 #define FLD(f) abuf->fields.sfmt_user.f
936 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
937 const IDESC * UNUSED idesc = abuf->idesc;
941 int UNUSED insn_referenced = abuf->written;
942 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
949 model_lm32_xori (SIM_CPU *current_cpu, void *sem_arg)
951 #define FLD(f) abuf->fields.sfmt_andi.f
952 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
953 const IDESC * UNUSED idesc = abuf->idesc;
957 int UNUSED insn_referenced = abuf->written;
958 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
965 model_lm32_xnor (SIM_CPU *current_cpu, void *sem_arg)
967 #define FLD(f) abuf->fields.sfmt_user.f
968 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
969 const IDESC * UNUSED idesc = abuf->idesc;
973 int UNUSED insn_referenced = abuf->written;
974 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
981 model_lm32_xnori (SIM_CPU *current_cpu, void *sem_arg)
983 #define FLD(f) abuf->fields.sfmt_andi.f
984 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
985 const IDESC * UNUSED idesc = abuf->idesc;
989 int UNUSED insn_referenced = abuf->written;
990 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
997 model_lm32_break (SIM_CPU *current_cpu, void *sem_arg)
999 #define FLD(f) abuf->fields.sfmt_empty.f
1000 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1001 const IDESC * UNUSED idesc = abuf->idesc;
1005 int UNUSED insn_referenced = abuf->written;
1006 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
1013 model_lm32_scall (SIM_CPU *current_cpu, void *sem_arg)
1015 #define FLD(f) abuf->fields.sfmt_empty.f
1016 const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1017 const IDESC * UNUSED idesc = abuf->idesc;
1021 int UNUSED insn_referenced = abuf->written;
1022 cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
1028 /* We assume UNIT_NONE == 0 because the tables don't always terminate
1031 /* Model timing data for `lm32'. */
1033 static const INSN_TIMING lm32_timing[] = {
1034 { LM32BF_INSN_X_INVALID, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1035 { LM32BF_INSN_X_AFTER, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1036 { LM32BF_INSN_X_BEFORE, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1037 { LM32BF_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1038 { LM32BF_INSN_X_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1039 { LM32BF_INSN_X_BEGIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1040 { LM32BF_INSN_ADD, model_lm32_add, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1041 { LM32BF_INSN_ADDI, model_lm32_addi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1042 { LM32BF_INSN_AND, model_lm32_and, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1043 { LM32BF_INSN_ANDI, model_lm32_andi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1044 { LM32BF_INSN_ANDHII, model_lm32_andhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1045 { LM32BF_INSN_B, model_lm32_b, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1046 { LM32BF_INSN_BI, model_lm32_bi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1047 { LM32BF_INSN_BE, model_lm32_be, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1048 { LM32BF_INSN_BG, model_lm32_bg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1049 { LM32BF_INSN_BGE, model_lm32_bge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1050 { LM32BF_INSN_BGEU, model_lm32_bgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1051 { LM32BF_INSN_BGU, model_lm32_bgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1052 { LM32BF_INSN_BNE, model_lm32_bne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1053 { LM32BF_INSN_CALL, model_lm32_call, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1054 { LM32BF_INSN_CALLI, model_lm32_calli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1055 { LM32BF_INSN_CMPE, model_lm32_cmpe, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1056 { LM32BF_INSN_CMPEI, model_lm32_cmpei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1057 { LM32BF_INSN_CMPG, model_lm32_cmpg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1058 { LM32BF_INSN_CMPGI, model_lm32_cmpgi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1059 { LM32BF_INSN_CMPGE, model_lm32_cmpge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1060 { LM32BF_INSN_CMPGEI, model_lm32_cmpgei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1061 { LM32BF_INSN_CMPGEU, model_lm32_cmpgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1062 { LM32BF_INSN_CMPGEUI, model_lm32_cmpgeui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1063 { LM32BF_INSN_CMPGU, model_lm32_cmpgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1064 { LM32BF_INSN_CMPGUI, model_lm32_cmpgui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1065 { LM32BF_INSN_CMPNE, model_lm32_cmpne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1066 { LM32BF_INSN_CMPNEI, model_lm32_cmpnei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1067 { LM32BF_INSN_DIVU, model_lm32_divu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1068 { LM32BF_INSN_LB, model_lm32_lb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1069 { LM32BF_INSN_LBU, model_lm32_lbu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1070 { LM32BF_INSN_LH, model_lm32_lh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1071 { LM32BF_INSN_LHU, model_lm32_lhu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1072 { LM32BF_INSN_LW, model_lm32_lw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1073 { LM32BF_INSN_MODU, model_lm32_modu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1074 { LM32BF_INSN_MUL, model_lm32_mul, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1075 { LM32BF_INSN_MULI, model_lm32_muli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1076 { LM32BF_INSN_NOR, model_lm32_nor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1077 { LM32BF_INSN_NORI, model_lm32_nori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1078 { LM32BF_INSN_OR, model_lm32_or, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1079 { LM32BF_INSN_ORI, model_lm32_ori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1080 { LM32BF_INSN_ORHII, model_lm32_orhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1081 { LM32BF_INSN_RCSR, model_lm32_rcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1082 { LM32BF_INSN_SB, model_lm32_sb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1083 { LM32BF_INSN_SEXTB, model_lm32_sextb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1084 { LM32BF_INSN_SEXTH, model_lm32_sexth, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1085 { LM32BF_INSN_SH, model_lm32_sh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1086 { LM32BF_INSN_SL, model_lm32_sl, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1087 { LM32BF_INSN_SLI, model_lm32_sli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1088 { LM32BF_INSN_SR, model_lm32_sr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1089 { LM32BF_INSN_SRI, model_lm32_sri, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1090 { LM32BF_INSN_SRU, model_lm32_sru, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1091 { LM32BF_INSN_SRUI, model_lm32_srui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1092 { LM32BF_INSN_SUB, model_lm32_sub, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1093 { LM32BF_INSN_SW, model_lm32_sw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1094 { LM32BF_INSN_USER, model_lm32_user, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1095 { LM32BF_INSN_WCSR, model_lm32_wcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1096 { LM32BF_INSN_XOR, model_lm32_xor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1097 { LM32BF_INSN_XORI, model_lm32_xori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1098 { LM32BF_INSN_XNOR, model_lm32_xnor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1099 { LM32BF_INSN_XNORI, model_lm32_xnori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1100 { LM32BF_INSN_BREAK, model_lm32_break, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1101 { LM32BF_INSN_SCALL, model_lm32_scall, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
1104 #endif /* WITH_PROFILE_MODEL_P */
1107 lm32_model_init (SIM_CPU *cpu)
1109 CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_LM32_DATA));
1112 #if WITH_PROFILE_MODEL_P
1113 #define TIMING_DATA(td) td
1115 #define TIMING_DATA(td) 0
1118 static const SIM_MODEL lm32_models[] =
1120 { "lm32", & lm32_mach, MODEL_LM32, TIMING_DATA (& lm32_timing[0]), lm32_model_init },
1124 /* The properties of this cpu's implementation. */
1126 static const SIM_MACH_IMP_PROPERTIES lm32bf_imp_properties =
1138 lm32bf_prepare_run (SIM_CPU *cpu)
1140 if (CPU_IDESC (cpu) == NULL)
1141 lm32bf_init_idesc_table (cpu);
1144 static const CGEN_INSN *
1145 lm32bf_get_idata (SIM_CPU *cpu, int inum)
1147 return CPU_IDESC (cpu) [inum].idata;
1151 lm32_init_cpu (SIM_CPU *cpu)
1153 CPU_REG_FETCH (cpu) = lm32bf_fetch_register;
1154 CPU_REG_STORE (cpu) = lm32bf_store_register;
1155 CPU_PC_FETCH (cpu) = lm32bf_h_pc_get;
1156 CPU_PC_STORE (cpu) = lm32bf_h_pc_set;
1157 CPU_GET_IDATA (cpu) = lm32bf_get_idata;
1158 CPU_MAX_INSNS (cpu) = LM32BF_INSN__MAX;
1159 CPU_INSN_NAME (cpu) = cgen_insn_name;
1160 CPU_FULL_ENGINE_FN (cpu) = lm32bf_engine_run_full;
1162 CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_fast;
1164 CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_full;
1168 const SIM_MACH lm32_mach =
1170 "lm32", "lm32", MACH_LM32,
1171 32, 32, & lm32_models[0], & lm32bf_imp_properties,