📄 model.c
字号:
/* Simulator model support for m32rbf.THIS FILE IS MACHINE GENERATED WITH CGEN.Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.This file is part of the GNU simulators.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public License alongwith this program; if not, write to the Free Software Foundation, Inc.,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*/#define WANT_CPU m32rbf#define WANT_CPU_M32RBF#include "sim-main.h"/* The profiling data is recorded here, but is accessed via the profiling mechanism. After all, this is information for profiling. */#if WITH_PROFILE_MODEL_P/* Model handlers for each insn. */static intmodel_m32r_d_add (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_add3 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add3.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_and (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_and3 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_and3.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_or (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_or3 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_and3.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_xor (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_xor3 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_and3.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_addi (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_addi.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_addv (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_addv3 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add3.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_addx (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_add.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; INT in_dr = -1; INT out_dr = -1; in_sr = FLD (in_sr); in_dr = FLD (in_dr); out_dr = FLD (out_dr); referenced |= 1 << 0; referenced |= 1 << 1; referenced |= 1 << 2; cycles += m32rbf_model_m32r_d_u_exec (current_cpu, idesc, 0, referenced, in_sr, in_dr, out_dr); } return cycles;#undef FLD}static intmodel_m32r_d_bc8 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_bl8.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 2)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); } return cycles;#undef FLD}static intmodel_m32r_d_bc24 (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_bl24.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 2)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); } return cycles;#undef FLD}static intmodel_m32r_d_beq (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_beq.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 3)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); } { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_src1 = -1; INT in_src2 = -1; in_src1 = FLD (in_src1); in_src2 = FLD (in_src2); referenced |= 1 << 0; referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2); } return cycles;#undef FLD}static intmodel_m32r_d_beqz (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_beq.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 2)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); } { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_src1 = -1; INT in_src2 = -1; in_src2 = FLD (in_src2); referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2); } return cycles;#undef FLD}static intmodel_m32r_d_bgez (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_beq.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 2)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); } { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_src1 = -1; INT in_src2 = -1; in_src2 = FLD (in_src2); referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2); } return cycles;#undef FLD}static intmodel_m32r_d_bgtz (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_beq.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 2)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); } { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_src1 = -1; INT in_src2 = -1; in_src2 = FLD (in_src2); referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cmp (current_cpu, idesc, 1, referenced, in_src1, in_src2); } return cycles;#undef FLD}static intmodel_m32r_d_blez (SIM_CPU *current_cpu, void *sem_arg){#define FLD(f) abuf->fields.sfmt_beq.f const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg); const IDESC * UNUSED idesc = abuf->idesc; int cycles = 0; { int referenced = 0; int UNUSED insn_referenced = abuf->written; INT in_sr = -1; if (insn_referenced & (1 << 2)) referenced |= 1 << 1; cycles += m32rbf_model_m32r_d_u_cti (current_cpu, idesc, 0, referenced, in_sr); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -