* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
# Simulator main loop for m32rx. -*- C -*-
|
|
|
|
# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is part of the GNU Simulators.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
# Syntax:
|
|
|
|
# /bin/sh mainloop.in init|support|{full,fast}-{extract,exec}-{scache,noscache}
|
|
|
|
|
|
|
|
# ??? After a few more ports are done, revisit.
|
|
|
|
# Will eventually need to machine generate a lot of this.
|
|
|
|
|
|
|
|
case "x$1" in
|
|
|
|
|
|
|
|
xsupport)
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
xinit)
|
|
|
|
|
|
|
|
cat <<EOF
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
DECODE *d1,*d2;
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
ARGBUF abufs[MAX_PARALLEL_INSNS];
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
PAREXEC pbufs[MAX_PARALLEL_INSNS];
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
xfull-extract-* | xfast-extract-*)
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
{
|
|
|
|
PCADDR pc = CPU (h_pc);
|
|
|
|
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
/* ??? This code isn't very fast. Let's get it working first. */
|
|
|
|
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
if ((pc & 3) != 0)
|
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
USI insn = GETIMEMUHI (current_cpu, pc);
|
|
|
|
insn &= 0x7fff;
|
|
|
|
d1 = m32rx_decode (current_cpu, pc, insn);
|
|
|
|
abufs[0].insn = insn;
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
icount = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
USI insn = GETIMEMUSI (current_cpu, pc);
|
|
|
|
if ((SI) insn < 0)
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
d1 = m32rx_decode (current_cpu, pc, insn >> 16);
|
|
|
|
abufs[0].insn = insn;
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
icount = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (insn & 0x8000)
|
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
d1 = m32rx_decode (current_cpu, pc, insn >> 16);
|
|
|
|
abufs[0].insn = insn >> 16;
|
|
|
|
d2 = m32rx_decode (current_cpu, pc, insn & 0x7fff);
|
|
|
|
abufs[1].insn = insn & 0x7fff;
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
icount = 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
d1 = m32rx_decode (current_cpu, pc, insn >> 16);
|
|
|
|
abufs[0].insn = insn >> 16;
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
icount = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
{
|
|
|
|
int icount2 = icount;
|
|
|
|
USI insn = abufs[0].insn;
|
|
|
|
DECODE *decode = d1;
|
|
|
|
/* decode, par_exec, and insn are refered to by readx.c. */
|
|
|
|
PAREXEC *par_exec = &pbufs[0];
|
|
|
|
do
|
|
|
|
{
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
#define DEFINE_SWITCH
|
|
|
|
#include "readx.c"
|
|
|
|
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
decode = d2;
|
|
|
|
insn = abufs[1].insn;
|
|
|
|
++par_exec;
|
|
|
|
}
|
|
|
|
while (--icount2 != 0);
|
|
|
|
}
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
xfull-exec-* | xfast-exec-*)
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
SEM_ARG sem_arg = &abufs[0];
|
|
|
|
PAREXEC *par_exec = &pbufs[0];
|
|
|
|
PCADDR new_pc;
|
|
|
|
|
|
|
|
/* If doing parallel execution, verify insns are in the right pipeline. */
|
|
|
|
if (icount == 2)
|
|
|
|
{
|
|
|
|
; /*wip*/
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE_INSN_INIT (current_cpu);
|
|
|
|
TRACE_INSN (current_cpu, d1->opcode, sem_arg, CPU (h_pc));
|
|
|
|
new_pc = (*d1->semantic) (current_cpu, sem_arg, par_exec);
|
|
|
|
TRACE_INSN_FINI (current_cpu);
|
|
|
|
PROFILE_COUNT_INSN (current_cpu, CPU (h_pc), CGEN_INSN_INDEX (d1->opcode));
|
|
|
|
|
|
|
|
/* The result of the semantic fn is one of:
|
|
|
|
- next address, branch only
|
|
|
|
- NEW_PC_SKIP, sc/snc insn
|
|
|
|
- NEW_PC_2, 2 byte non-branch non-sc/snc insn
|
|
|
|
- NEW_PC_4, 4 byte non-branch insn
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (new_pc == NEW_PC_4)
|
|
|
|
CPU (h_pc) += 4;
|
|
|
|
else if (NEW_PC_BRANCH_P (new_pc))
|
|
|
|
CPU (h_pc) = new_pc;
|
|
|
|
else
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
{
|
* sim-main.h: #include symcat.h.
* m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg.
(NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros.
* cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
* sem.c,sem-switch.c: Regenerate.
* m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec.
* mloopx.in: Rewrite.
* cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
1998-02-23 21:36:15 +00:00
|
|
|
PCADDR pc = CPU (h_pc);
|
|
|
|
|
|
|
|
CPU (h_pc) = pc + 2;
|
|
|
|
if (icount == 2)
|
|
|
|
{
|
|
|
|
/* Note that we only get here if doing parallel execution. */
|
|
|
|
if (new_pc == NEW_PC_SKIP)
|
|
|
|
{
|
|
|
|
/* ??? Need generic notion of bypassing an insn for the name of
|
|
|
|
this macro. Annulled? On the otherhand such tracing can go
|
|
|
|
in the sc/snc semantic fn. */
|
|
|
|
; /*TRACE_INSN_SKIPPED (current_cpu);*/
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
++sem_arg;
|
|
|
|
++par_exec;
|
|
|
|
TRACE_INSN_INIT (current_cpu);
|
|
|
|
TRACE_INSN (current_cpu, d2->opcode, sem_arg, CPU (h_pc));
|
|
|
|
/* new_pc isn't used. It's assigned a value for debugging. */
|
|
|
|
new_pc = (*d2->semantic) (current_cpu, sem_arg, par_exec);
|
|
|
|
TRACE_INSN_FINI (current_cpu);
|
|
|
|
PROFILE_COUNT_INSN (current_cpu, pc, CGEN_INSN_INDEX (d2->opcode));
|
|
|
|
}
|
|
|
|
CPU (h_pc) = pc + 4;
|
|
|
|
}
|
* Makefile.in (m32r.o): Depend on cpu.h
(extract.o): Pass -DSCACHE_P.
* mloop.in (extract{16,32}): Update call to m32r_decode.
* arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
* extract.c,model.c,sem-switch.c,sem.c: Regenerate.
* sim-main.h: #include "ansidecl.h".
Don't include cpu-opc.h, done by arch.h.
start-sanitize-m32rx
* Makefile.in (M32RX_OBJS): Build m32rx support now.
(m32rx.o): New rule.
* m32r-sim.h (m32rx_h_cr_[gs]et): Define.
* m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
(m32rx_h_accums_get): New function.
* mloopx.in: Update call to m32rx_decode. Rewrite exec loop.
* cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
end-sanitize-m32rx
1998-02-05 21:01:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Invalid argument to mainloop.in: $1" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|