[PATCH 22/57][Arm][GAS] Add support for MVE instructions: vmlaldav, vmlalv, vmlsldav...
[binutils-gdb.git] / sim / mips / m16run.c
blob44fb9e4538cacaf72f1697ce6ec955ee277c2dad
1 /* This file is part of the program psim.
3 Copyright (C) 1998, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "sim-main.h"
21 #include "m16_idecode.h"
22 #include "m32_idecode.h"
23 #include "bfd.h"
26 #define SD sd
27 #define CPU cpu
29 void
30 sim_engine_run (SIM_DESC sd,
31 int next_cpu_nr,
32 int nr_cpus, /* ignore */
33 int siggnal) /* ignore */
35 sim_cpu *cpu = STATE_CPU (sd, next_cpu_nr);
36 address_word cia = CPU_PC_GET (cpu);
38 while (1)
40 address_word nia;
42 #if defined (ENGINE_ISSUE_PREFIX_HOOK)
43 ENGINE_ISSUE_PREFIX_HOOK ();
44 #endif
46 if ((cia & 1))
48 m16_instruction_word instruction_0 = IMEM16 (cia);
49 nia = m16_idecode_issue (sd, instruction_0, cia);
51 else
53 m32_instruction_word instruction_0 = IMEM32 (cia);
54 nia = m32_idecode_issue (sd, instruction_0, cia);
57 #if defined (ENGINE_ISSUE_POSTFIX_HOOK)
58 ENGINE_ISSUE_POSTFIX_HOOK ();
59 #endif
61 /* Update the instruction address */
62 cia = nia;
64 /* process any events */
65 if (sim_events_tick (sd))
67 CPU_PC_SET (CPU, cia);
68 sim_events_process (sd);
69 cia = CPU_PC_GET (CPU);