1 /* SH5 simulator support code
2 Copyright (C) 2000, 2001, 2006, 2008 Free Software Foundation, Inc.
3 Contributed by Red Hat, Inc.
5 This file is part of the GNU simulators.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
28 #include "gdb/callback.h"
29 #include "defs-compact.h"
32 /* From include/gdb/. */
33 #include "gdb/sim-sh.h"
43 #define SYS_argnlen 173
46 IDESC * sh64_idesc_media;
47 IDESC * sh64_idesc_compact;
50 sh64_endian (SIM_CPU *current_cpu)
52 return (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN);
56 sh64_fldi0 (SIM_CPU *current_cpu)
59 sim_fpu_to32 (&result, &sim_fpu_zero);
64 sh64_fldi1 (SIM_CPU *current_cpu)
67 sim_fpu_to32 (&result, &sim_fpu_one);
72 sh64_fabsd(SIM_CPU *current_cpu, DF drgh)
77 sim_fpu_64to (&f, drgh);
78 sim_fpu_abs (&fres, &f);
79 sim_fpu_to64 (&result, &fres);
84 sh64_fabss(SIM_CPU *current_cpu, SF frgh)
89 sim_fpu_32to (&f, frgh);
90 sim_fpu_abs (&fres, &f);
91 sim_fpu_to32 (&result, &fres);
96 sh64_faddd(SIM_CPU *current_cpu, DF drg, DF drh)
101 sim_fpu_64to (&f1, drg);
102 sim_fpu_64to (&f2, drh);
103 sim_fpu_add (&fres, &f1, &f2);
104 sim_fpu_to64 (&result, &fres);
109 sh64_fadds(SIM_CPU *current_cpu, SF frg, SF frh)
112 sim_fpu f1, f2, fres;
114 sim_fpu_32to (&f1, frg);
115 sim_fpu_32to (&f2, frh);
116 sim_fpu_add (&fres, &f1, &f2);
117 sim_fpu_to32 (&result, &fres);
122 sh64_fcmpeqd(SIM_CPU *current_cpu, DF drg, DF drh)
126 sim_fpu_64to (&f1, drg);
127 sim_fpu_64to (&f2, drh);
128 return sim_fpu_is_eq (&f1, &f2);
132 sh64_fcmpeqs(SIM_CPU *current_cpu, SF frg, SF frh)
136 sim_fpu_32to (&f1, frg);
137 sim_fpu_32to (&f2, frh);
138 return sim_fpu_is_eq (&f1, &f2);
142 sh64_fcmpged(SIM_CPU *current_cpu, DF drg, DF drh)
146 sim_fpu_64to (&f1, drg);
147 sim_fpu_64to (&f2, drh);
148 return sim_fpu_is_ge (&f1, &f2);
152 sh64_fcmpges(SIM_CPU *current_cpu, SF frg, SF frh)
156 sim_fpu_32to (&f1, frg);
157 sim_fpu_32to (&f2, frh);
158 return sim_fpu_is_ge (&f1, &f2);
162 sh64_fcmpgtd(SIM_CPU *current_cpu, DF drg, DF drh)
166 sim_fpu_64to (&f1, drg);
167 sim_fpu_64to (&f2, drh);
168 return sim_fpu_is_gt (&f1, &f2);
172 sh64_fcmpgts(SIM_CPU *current_cpu, SF frg, SF frh)
176 sim_fpu_32to (&f1, frg);
177 sim_fpu_32to (&f2, frh);
178 return sim_fpu_is_gt (&f1, &f2);
182 sh64_fcmpund(SIM_CPU *current_cpu, DF drg, DF drh)
186 sim_fpu_64to (&f1, drg);
187 sim_fpu_64to (&f2, drh);
188 return (sim_fpu_is_nan (&f1) || sim_fpu_is_nan (&f2));
192 sh64_fcmpuns(SIM_CPU *current_cpu, SF frg, SF frh)
196 sim_fpu_32to (&f1, frg);
197 sim_fpu_32to (&f2, frh);
198 return (sim_fpu_is_nan (&f1) || sim_fpu_is_nan (&f2));
202 sh64_fcnvds(SIM_CPU *current_cpu, DF drgh)
205 unsigned long long ll;
221 sh64_fcnvsd(SIM_CPU *current_cpu, SF frgh)
226 sim_fpu_32to (&f, frgh);
227 sim_fpu_to64 (&result, &f);
232 sh64_fdivd(SIM_CPU *current_cpu, DF drg, DF drh)
235 sim_fpu f1, f2, fres;
237 sim_fpu_64to (&f1, drg);
238 sim_fpu_64to (&f2, drh);
239 sim_fpu_div (&fres, &f1, &f2);
240 sim_fpu_to64 (&result, &fres);
245 sh64_fdivs(SIM_CPU *current_cpu, SF frg, SF frh)
248 sim_fpu f1, f2, fres;
250 sim_fpu_32to (&f1, frg);
251 sim_fpu_32to (&f2, frh);
252 sim_fpu_div (&fres, &f1, &f2);
253 sim_fpu_to32 (&result, &fres);
258 sh64_floatld(SIM_CPU *current_cpu, SF frgh)
263 sim_fpu_i32to (&f, frgh, sim_fpu_round_default);
264 sim_fpu_to64 (&result, &f);
269 sh64_floatls(SIM_CPU *current_cpu, SF frgh)
274 sim_fpu_i32to (&f, frgh, sim_fpu_round_default);
275 sim_fpu_to32 (&result, &f);
280 sh64_floatqd(SIM_CPU *current_cpu, DF drgh)
285 sim_fpu_i64to (&f, drgh, sim_fpu_round_default);
286 sim_fpu_to64 (&result, &f);
291 sh64_floatqs(SIM_CPU *current_cpu, DF drgh)
296 sim_fpu_i64to (&f, drgh, sim_fpu_round_default);
297 sim_fpu_to32 (&result, &f);
302 sh64_fmacs(SIM_CPU *current_cpu, SF fr0, SF frm, SF frn)
305 sim_fpu m1, m2, a1, fres;
307 sim_fpu_32to (&m1, fr0);
308 sim_fpu_32to (&m2, frm);
309 sim_fpu_32to (&a1, frn);
311 sim_fpu_mul (&fres, &m1, &m2);
312 sim_fpu_add (&fres, &fres, &a1);
314 sim_fpu_to32 (&result, &fres);
319 sh64_fmuld(SIM_CPU *current_cpu, DF drg, DF drh)
322 sim_fpu f1, f2, fres;
324 sim_fpu_64to (&f1, drg);
325 sim_fpu_64to (&f2, drh);
326 sim_fpu_mul (&fres, &f1, &f2);
327 sim_fpu_to64 (&result, &fres);
332 sh64_fmuls(SIM_CPU *current_cpu, SF frg, SF frh)
335 sim_fpu f1, f2, fres;
337 sim_fpu_32to (&f1, frg);
338 sim_fpu_32to (&f2, frh);
339 sim_fpu_mul (&fres, &f1, &f2);
340 sim_fpu_to32 (&result, &fres);
345 sh64_fnegd(SIM_CPU *current_cpu, DF drgh)
350 sim_fpu_64to (&f1, drgh);
351 sim_fpu_neg (&f2, &f1);
352 sim_fpu_to64 (&result, &f2);
357 sh64_fnegs(SIM_CPU *current_cpu, SF frgh)
362 sim_fpu_32to (&f, frgh);
363 sim_fpu_neg (&fres, &f);
364 sim_fpu_to32 (&result, &fres);
369 sh64_fsqrtd(SIM_CPU *current_cpu, DF drgh)
374 sim_fpu_64to (&f, drgh);
375 sim_fpu_sqrt (&fres, &f);
376 sim_fpu_to64 (&result, &fres);
381 sh64_fsqrts(SIM_CPU *current_cpu, SF frgh)
386 sim_fpu_32to (&f, frgh);
387 sim_fpu_sqrt (&fres, &f);
388 sim_fpu_to32 (&result, &fres);
393 sh64_fsubd(SIM_CPU *current_cpu, DF drg, DF drh)
396 sim_fpu f1, f2, fres;
398 sim_fpu_64to (&f1, drg);
399 sim_fpu_64to (&f2, drh);
400 sim_fpu_sub (&fres, &f1, &f2);
401 sim_fpu_to64 (&result, &fres);
406 sh64_fsubs(SIM_CPU *current_cpu, SF frg, SF frh)
409 sim_fpu f1, f2, fres;
411 sim_fpu_32to (&f1, frg);
412 sim_fpu_32to (&f2, frh);
413 sim_fpu_sub (&fres, &f1, &f2);
414 sim_fpu_to32 (&result, &fres);
419 sh64_ftrcdl(SIM_CPU *current_cpu, DF drgh)
424 sim_fpu_64to (&f, drgh);
425 sim_fpu_to32i (&result, &f, sim_fpu_round_zero);
430 sh64_ftrcsl(SIM_CPU *current_cpu, SF frgh)
435 sim_fpu_32to (&f, frgh);
436 sim_fpu_to32i (&result, &f, sim_fpu_round_zero);
441 sh64_ftrcdq(SIM_CPU *current_cpu, DF drgh)
446 sim_fpu_64to (&f, drgh);
447 sim_fpu_to64i (&result, &f, sim_fpu_round_zero);
452 sh64_ftrcsq(SIM_CPU *current_cpu, SF frgh)
457 sim_fpu_32to (&f, frgh);
458 sim_fpu_to64i (&result, &f, sim_fpu_round_zero);
463 sh64_ftrvs(SIM_CPU *cpu, unsigned g, unsigned h, unsigned f)
467 for (i = 0; i < 4; i++)
471 sim_fpu_32to (&sum, 0);
473 for (j = 0; j < 4; j++)
475 sim_fpu f1, f2, temp;
476 sim_fpu_32to (&f1, sh64_h_fr_get (cpu, (g + i) + (j * 4)));
477 sim_fpu_32to (&f2, sh64_h_fr_get (cpu, h + j));
478 sim_fpu_mul (&temp, &f1, &f2);
479 sim_fpu_add (&sum, &sum, &temp);
481 sim_fpu_to32 (&result, &sum);
482 sh64_h_fr_set (cpu, f + i, result);
487 sh64_fipr (SIM_CPU *cpu, unsigned m, unsigned n)
489 SF result = sh64_fmuls (cpu, sh64_h_fvc_get (cpu, m), sh64_h_fvc_get (cpu, n));
490 result = sh64_fadds (cpu, result, sh64_fmuls (cpu, sh64_h_frc_get (cpu, m + 1), sh64_h_frc_get (cpu, n + 1)));
491 result = sh64_fadds (cpu, result, sh64_fmuls (cpu, sh64_h_frc_get (cpu, m + 2), sh64_h_frc_get (cpu, n + 2)));
492 result = sh64_fadds (cpu, result, sh64_fmuls (cpu, sh64_h_frc_get (cpu, m + 3), sh64_h_frc_get (cpu, n + 3)));
493 sh64_h_frc_set (cpu, n + 3, result);
497 sh64_fiprs (SIM_CPU *cpu, unsigned g, unsigned h)
499 SF temp = sh64_fmuls (cpu, sh64_h_fr_get (cpu, g), sh64_h_fr_get (cpu, h));
500 temp = sh64_fadds (cpu, temp, sh64_fmuls (cpu, sh64_h_fr_get (cpu, g + 1), sh64_h_fr_get (cpu, h + 1)));
501 temp = sh64_fadds (cpu, temp, sh64_fmuls (cpu, sh64_h_fr_get (cpu, g + 2), sh64_h_fr_get (cpu, h + 2)));
502 temp = sh64_fadds (cpu, temp, sh64_fmuls (cpu, sh64_h_fr_get (cpu, g + 3), sh64_h_fr_get (cpu, h + 3)));
507 sh64_fldp (SIM_CPU *cpu, PCADDR pc, DI rm, DI rn, unsigned f)
509 sh64_h_fr_set (cpu, f, GETMEMSF (cpu, pc, rm + rn));
510 sh64_h_fr_set (cpu, f + 1, GETMEMSF (cpu, pc, rm + rn + 4));
514 sh64_fstp (SIM_CPU *cpu, PCADDR pc, DI rm, DI rn, unsigned f)
516 SETMEMSF (cpu, pc, rm + rn, sh64_h_fr_get (cpu, f));
517 SETMEMSF (cpu, pc, rm + rn + 4, sh64_h_fr_get (cpu, f + 1));
521 sh64_ftrv (SIM_CPU *cpu, UINT ignored)
523 /* TODO: Unimplemented. */
527 sh64_pref (SIM_CPU *cpu, SI addr)
529 /* TODO: Unimplemented. */
532 /* Count the number of arguments. */
539 if (! STATE_PROG_ARGV (CPU_STATE (cpu)))
542 while (STATE_PROG_ARGV (CPU_STATE (cpu)) [i] != NULL)
548 /* Read a null terminated string from memory, return in a buffer */
550 fetch_str (current_cpu, pc, addr)
551 SIM_CPU *current_cpu;
557 while (sim_core_read_1 (current_cpu,
558 pc, read_map, addr + nr) != 0)
560 buf = NZALLOC (char, nr + 1);
561 sim_read (CPU_STATE (current_cpu), addr, buf, nr);
566 trap_handler (SIM_CPU *current_cpu, int shmedia_abi_p, UQI trapnum, PCADDR pc)
573 sim_io_write_stdout (CPU_STATE (current_cpu), &ch, 1);
577 sim_engine_halt (CPU_STATE (current_cpu), current_cpu, NULL, pc, sim_stopped, SIM_SIGTRAP);
582 int ret_reg = (shmedia_abi_p) ? 2 : 0;
584 DI PARM1 = GET_H_GR ((shmedia_abi_p) ? 3 : 5);
585 DI PARM2 = GET_H_GR ((shmedia_abi_p) ? 4 : 6);
586 DI PARM3 = GET_H_GR ((shmedia_abi_p) ? 5 : 7);
588 switch (GET_H_GR ((shmedia_abi_p) ? 2 : 4))
591 buf = zalloc (PARM3);
592 sim_read (CPU_STATE (current_cpu), PARM2, buf, PARM3);
594 sim_io_write (CPU_STATE (current_cpu),
601 sim_io_lseek (CPU_STATE (current_cpu),
602 PARM1, PARM2, PARM3));
606 sim_engine_halt (CPU_STATE (current_cpu), current_cpu,
607 NULL, pc, sim_exited, PARM1);
611 buf = zalloc (PARM3);
613 sim_io_read (CPU_STATE (current_cpu),
615 sim_write (CPU_STATE (current_cpu), PARM2, buf, PARM3);
620 buf = fetch_str (current_cpu, pc, PARM1);
622 sim_io_open (CPU_STATE (current_cpu),
629 sim_io_close (CPU_STATE (current_cpu), PARM1));
633 SET_H_GR (ret_reg, time (0));
637 SET_H_GR (ret_reg, count_argc (current_cpu));
641 if (PARM1 < count_argc (current_cpu))
643 strlen (STATE_PROG_ARGV (CPU_STATE (current_cpu)) [PARM1]));
645 SET_H_GR (ret_reg, -1);
649 if (PARM1 < count_argc (current_cpu))
651 /* Include the NULL byte. */
652 i = strlen (STATE_PROG_ARGV (CPU_STATE (current_cpu)) [PARM1]) + 1;
653 sim_write (CPU_STATE (current_cpu),
655 STATE_PROG_ARGV (CPU_STATE (current_cpu)) [PARM1],
658 /* Just for good measure. */
659 SET_H_GR (ret_reg, i);
663 SET_H_GR (ret_reg, -1);
667 SET_H_GR (ret_reg, -1);
680 sim_engine_halt (CPU_STATE (current_cpu), current_cpu, NULL, pc, sim_stopped, SIM_SIGTRAP);
686 sh64_trapa (SIM_CPU *current_cpu, DI rm, PCADDR pc)
688 trap_handler (current_cpu, 1, (UQI) rm & 0xff, pc);
692 sh64_compact_trapa (SIM_CPU *current_cpu, UQI trapnum, PCADDR pc)
696 /* If this is an SH5 executable, this is SHcompact code running in
700 (bfd_get_mach (STATE_PROG_BFD (CPU_STATE (current_cpu))) == bfd_mach_sh5);
702 trap_handler (current_cpu, mach_sh5_p, trapnum, pc);
706 sh64_nsb (SIM_CPU *current_cpu, DI rm)
708 int result = 0, count;
709 UDI source = (UDI) rm;
715 for (count = 32; count; count >>= 1)
717 UDI newval = source << count;
719 if ((newval >> count) == source)
730 sh64_break (SIM_CPU *current_cpu, PCADDR pc)
732 SIM_DESC sd = CPU_STATE (current_cpu);
733 sim_engine_halt (sd, current_cpu, NULL, pc, sim_stopped, SIM_SIGTRAP);
737 sh64_movua (SIM_CPU *current_cpu, PCADDR pc, SI rn)
742 /* Move the data one byte at a time to avoid alignment problems.
743 Be aware of endianness. */
745 for (i = 0; i < 4; ++i)
746 v = (v << 8) | (GETMEMQI (current_cpu, pc, rn + i) & 0xff);
753 set_isa (SIM_CPU *current_cpu, int mode)
758 /* The semantic code invokes this for invalid (unrecognized) instructions. */
761 sim_engine_invalid_insn (SIM_CPU *current_cpu, IADDR cia, SEM_PC vpc)
763 SIM_DESC sd = CPU_STATE (current_cpu);
764 sim_engine_halt (sd, current_cpu, NULL, cia, sim_stopped, SIM_SIGILL);
770 /* Process an address exception. */
773 sh64_core_signal (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia,
774 unsigned int map, int nr_bytes, address_word addr,
775 transfer_type transfer, sim_core_signals sig)
777 sim_core_signal (sd, current_cpu, cia, map, nr_bytes, addr,
782 /* Initialize cycle counting for an insn.
783 FIRST_P is non-zero if this is the first insn in a set of parallel
787 sh64_compact_model_insn_before (SIM_CPU *cpu, int first_p)
793 sh64_media_model_insn_before (SIM_CPU *cpu, int first_p)
798 /* Record the cycles computed for an insn.
799 LAST_P is non-zero if this is the last insn in a set of parallel insns,
800 and we update the total cycle count.
801 CYCLES is the cycle count of the insn. */
804 sh64_compact_model_insn_after(SIM_CPU *cpu, int last_p, int cycles)
810 sh64_media_model_insn_after(SIM_CPU *cpu, int last_p, int cycles)
816 sh64_fetch_register (SIM_CPU *cpu, int nr, unsigned char *buf, int len)
818 /* Fetch general purpose registers. */
819 if (nr >= SIM_SH64_R0_REGNUM
820 && nr < (SIM_SH64_R0_REGNUM + SIM_SH64_NR_R_REGS)
823 *((unsigned64*) buf) =
824 H2T_8 (sh64_h_gr_get (cpu, nr - SIM_SH64_R0_REGNUM));
829 if (nr == SIM_SH64_PC_REGNUM && len == 8)
831 *((unsigned64*) buf) = H2T_8 (sh64_h_pc_get (cpu) | sh64_h_ism_get (cpu));
835 /* Fetch status register (SR). */
836 if (nr == SIM_SH64_SR_REGNUM && len == 8)
838 *((unsigned64*) buf) = H2T_8 (sh64_h_sr_get (cpu));
842 /* Fetch saved status register (SSR) and PC (SPC). */
843 if ((nr == SIM_SH64_SSR_REGNUM || nr == SIM_SH64_SPC_REGNUM)
846 *((unsigned64*) buf) = 0;
850 /* Fetch target registers. */
851 if (nr >= SIM_SH64_TR0_REGNUM
852 && nr < (SIM_SH64_TR0_REGNUM + SIM_SH64_NR_TR_REGS)
855 *((unsigned64*) buf) =
856 H2T_8 (sh64_h_tr_get (cpu, nr - SIM_SH64_TR0_REGNUM));
860 /* Fetch floating point registers. */
861 if (nr >= SIM_SH64_FR0_REGNUM
862 && nr < (SIM_SH64_FR0_REGNUM + SIM_SH64_NR_FP_REGS)
865 *((unsigned32*) buf) =
866 H2T_4 (sh64_h_fr_get (cpu, nr - SIM_SH64_FR0_REGNUM));
870 /* We should never get here. */
875 sh64_store_register (SIM_CPU *cpu, int nr, unsigned char *buf, int len)
877 /* Store general purpose registers. */
878 if (nr >= SIM_SH64_R0_REGNUM
879 && nr < (SIM_SH64_R0_REGNUM + SIM_SH64_NR_R_REGS)
882 sh64_h_gr_set (cpu, nr - SIM_SH64_R0_REGNUM, T2H_8 (*((unsigned64*)buf)));
887 if (nr == SIM_SH64_PC_REGNUM && len == 8)
889 unsigned64 new_pc = T2H_8 (*((unsigned64*)buf));
890 sh64_h_pc_set (cpu, new_pc);
894 /* Store status register (SR). */
895 if (nr == SIM_SH64_SR_REGNUM && len == 8)
897 sh64_h_sr_set (cpu, T2H_8 (*((unsigned64*)buf)));
901 /* Store saved status register (SSR) and PC (SPC). */
902 if (nr == SIM_SH64_SSR_REGNUM || nr == SIM_SH64_SPC_REGNUM)
908 /* Store target registers. */
909 if (nr >= SIM_SH64_TR0_REGNUM
910 && nr < (SIM_SH64_TR0_REGNUM + SIM_SH64_NR_TR_REGS)
913 sh64_h_tr_set (cpu, nr - SIM_SH64_TR0_REGNUM, T2H_8 (*((unsigned64*)buf)));
917 /* Store floating point registers. */
918 if (nr >= SIM_SH64_FR0_REGNUM
919 && nr < (SIM_SH64_FR0_REGNUM + SIM_SH64_NR_FP_REGS)
922 sh64_h_fr_set (cpu, nr - SIM_SH64_FR0_REGNUM, T2H_4 (*((unsigned32*)buf)));
926 /* We should never get here. */
931 sh64_engine_run_full(SIM_CPU *cpu)
933 if (sh64_h_ism_get (cpu) == ISM_MEDIA)
935 if (!sh64_idesc_media)
937 sh64_media_init_idesc_table (cpu);
938 sh64_idesc_media = CPU_IDESC (cpu);
941 CPU_IDESC (cpu) = sh64_idesc_media;
942 sh64_media_engine_run_full (cpu);
946 if (!sh64_idesc_compact)
948 sh64_compact_init_idesc_table (cpu);
949 sh64_idesc_compact = CPU_IDESC (cpu);
952 CPU_IDESC (cpu) = sh64_idesc_compact;
953 sh64_compact_engine_run_full (cpu);
958 sh64_engine_run_fast (SIM_CPU *cpu)
960 if (sh64_h_ism_get (cpu) == ISM_MEDIA)
962 if (!sh64_idesc_media)
964 sh64_media_init_idesc_table (cpu);
965 sh64_idesc_media = CPU_IDESC (cpu);
968 CPU_IDESC (cpu) = sh64_idesc_media;
969 sh64_media_engine_run_fast (cpu);
973 if (!sh64_idesc_compact)
975 sh64_compact_init_idesc_table (cpu);
976 sh64_idesc_compact = CPU_IDESC (cpu);
979 CPU_IDESC (cpu) = sh64_idesc_compact;
980 sh64_compact_engine_run_fast (cpu);
985 sh64_prepare_run (SIM_CPU *cpu)
990 static const CGEN_INSN *
991 sh64_get_idata (SIM_CPU *cpu, int inum)
993 return CPU_IDESC (cpu) [inum].idata;
997 sh64_init_cpu (SIM_CPU *cpu)
999 CPU_REG_FETCH (cpu) = sh64_fetch_register;
1000 CPU_REG_STORE (cpu) = sh64_store_register;
1001 CPU_PC_FETCH (cpu) = sh64_h_pc_get;
1002 CPU_PC_STORE (cpu) = sh64_h_pc_set;
1003 CPU_GET_IDATA (cpu) = sh64_get_idata;
1004 /* Only used by profiling. 0 disables it. */
1005 CPU_MAX_INSNS (cpu) = 0;
1006 CPU_INSN_NAME (cpu) = cgen_insn_name;
1007 CPU_FULL_ENGINE_FN (cpu) = sh64_engine_run_full;
1009 CPU_FAST_ENGINE_FN (cpu) = sh64_engine_run_fast;
1011 CPU_FAST_ENGINE_FN (cpu) = sh64_engine_run_full;
1016 shmedia_init_cpu (SIM_CPU *cpu)
1018 sh64_init_cpu (cpu);
1022 shcompact_init_cpu (SIM_CPU *cpu)
1024 sh64_init_cpu (cpu);
1033 static const MODEL sh_models [] =
1035 { "sh2", & sh2_mach, MODEL_SH5, NULL, sh64_model_init },
1036 { "sh2e", & sh2e_mach, MODEL_SH5, NULL, sh64_model_init },
1037 { "sh2a", & sh2a_fpu_mach, MODEL_SH5, NULL, sh64_model_init },
1038 { "sh2a_nofpu", & sh2a_nofpu_mach, MODEL_SH5, NULL, sh64_model_init },
1039 { "sh3", & sh3_mach, MODEL_SH5, NULL, sh64_model_init },
1040 { "sh3e", & sh3_mach, MODEL_SH5, NULL, sh64_model_init },
1041 { "sh4", & sh4_mach, MODEL_SH5, NULL, sh64_model_init },
1042 { "sh4_nofpu", & sh4_nofpu_mach, MODEL_SH5, NULL, sh64_model_init },
1043 { "sh4a", & sh4a_mach, MODEL_SH5, NULL, sh64_model_init },
1044 { "sh4a_nofpu", & sh4a_nofpu_mach, MODEL_SH5, NULL, sh64_model_init },
1045 { "sh4al", & sh4al_mach, MODEL_SH5, NULL, sh64_model_init },
1046 { "sh5", & sh5_mach, MODEL_SH5, NULL, sh64_model_init },
1050 static const MACH_IMP_PROPERTIES sh5_imp_properties =
1060 const MACH sh2_mach =
1062 "sh2", "sh2", MACH_SH5,
1063 16, 16, &sh_models[0], &sh5_imp_properties,
1068 const MACH sh2e_mach =
1070 "sh2e", "sh2e", MACH_SH5,
1071 16, 16, &sh_models[1], &sh5_imp_properties,
1076 const MACH sh2a_fpu_mach =
1078 "sh2a", "sh2a", MACH_SH5,
1079 16, 16, &sh_models[2], &sh5_imp_properties,
1084 const MACH sh2a_nofpu_mach =
1086 "sh2a_nofpu", "sh2a_nofpu", MACH_SH5,
1087 16, 16, &sh_models[3], &sh5_imp_properties,
1092 const MACH sh3_mach =
1094 "sh3", "sh3", MACH_SH5,
1095 16, 16, &sh_models[4], &sh5_imp_properties,
1100 const MACH sh3e_mach =
1102 "sh3e", "sh3e", MACH_SH5,
1103 16, 16, &sh_models[5], &sh5_imp_properties,
1108 const MACH sh4_mach =
1110 "sh4", "sh4", MACH_SH5,
1111 16, 16, &sh_models[6], &sh5_imp_properties,
1116 const MACH sh4_nofpu_mach =
1118 "sh4_nofpu", "sh4_nofpu", MACH_SH5,
1119 16, 16, &sh_models[7], &sh5_imp_properties,
1124 const MACH sh4a_mach =
1126 "sh4a", "sh4a", MACH_SH5,
1127 16, 16, &sh_models[8], &sh5_imp_properties,
1132 const MACH sh4a_nofpu_mach =
1134 "sh4a_nofpu", "sh4a_nofpu", MACH_SH5,
1135 16, 16, &sh_models[9], &sh5_imp_properties,
1140 const MACH sh4al_mach =
1142 "sh4al", "sh4al", MACH_SH5,
1143 16, 16, &sh_models[10], &sh5_imp_properties,
1148 const MACH sh5_mach =
1150 "sh5", "sh5", MACH_SH5,
1151 32, 32, &sh_models[11], &sh5_imp_properties,