1 # Simulator main loop for m32rx. -*- C -*-
2 # Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
4 # This file is part of the GNU Simulators.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # /bin/sh mainloop.in init|support|{full,fast}-{extract,exec}-{scache,noscache}
23 # ??? After a few more ports are done, revisit.
24 # Will eventually need to machine generate a lot of this.
40 DECODE *decode,*d1,*d2;
42 ARGBUF abufs[MAX_PARALLEL_INSNS];
49 xfull-extract-* | xfast-extract-*)
53 PCADDR pc = CPU (h_pc);
57 insn1 = GETIMEMUHI (current_cpu, pc);
59 d1 = m32rx_decode (current_cpu, pc, insn1);
64 insn1 = GETIMEMUSI (current_cpu, pc);
67 d1 = m32rx_decode (current_cpu, pc, insn1 >> 16);
74 insn2 = insn1 & 0x7fff;
76 d1 = m32rx_decode (current_cpu, pc, insn1);
77 d2 = m32rx_decode (current_cpu, pc, insn2);
83 d1 = m32rx_decode (current_cpu, pc, insn1);
100 while (--icount2 > 0);
106 xfull-exec-* | xfast-exec-*)
114 TRACE_INSN_INIT (current_cpu);
115 TRACE_INSN (current_cpu, sc->argbuf.opcode, (const struct argbuf *) &sc->argbuf, sc->argbuf.addr);
116 new_pc = (*decode->semantic) (current_cpu, &sc->argbuf);
117 TRACE_INSN_FINI (current_cpu);
118 PROFILE_COUNT_INSN (current_cpu, pc, CGEN_INSN_INDEX (sc->argbuf.opcode));
122 while (--icount > 0);
129 echo "Invalid argument to mainloop.in: $1" >&2