diff options
author | Doug Evans <dje@google.com> | 1998-01-20 06:18:51 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 1998-01-20 06:18:51 +0000 |
commit | 9d70630e0d1913b7edcf41778db9b757962548e9 (patch) | |
tree | d729e5f40e54dd94217e8f70abae3a26176d9a2f /sim/m32r/extract.c | |
parent | 369fba30897458a842d6f599fde08b45804ebef3 (diff) | |
download | gdb-9d70630e0d1913b7edcf41778db9b757962548e9.zip gdb-9d70630e0d1913b7edcf41778db9b757962548e9.tar.gz gdb-9d70630e0d1913b7edcf41778db9b757962548e9.tar.bz2 |
Regenerate.
Diffstat (limited to 'sim/m32r/extract.c')
-rw-r--r-- | sim/m32r/extract.c | 3188 |
1 files changed, 289 insertions, 2899 deletions
diff --git a/sim/m32r/extract.c b/sim/m32r/extract.c index 479d6aa..927e28c 100644 --- a/sim/m32r/extract.c +++ b/sim/m32r/extract.c @@ -1,10 +1,8 @@ /* Simulator instruction extractor for m32r. -This file is machine generated. +Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. -Copyright (C) 1996, 1997 Free Software Foundation, Inc. - -This file is part of the GNU Binutils and/or GDB, the GNU debugger. +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 @@ -22,33 +20,24 @@ with this program; if not, write to the Free Software Foundation, Inc., */ +#define WANT_CPU +#define WANT_CPU_M32R + #include "sim-main.h" -#include "decode.h" #include "cpu-sim.h" void -EX_FN_NAME (add) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_0_add) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_0_add.f + EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ + + EXTRACT_FMT_0_ADD_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "add", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_0_add", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -65,31 +54,18 @@ EX_FN_NAME (add) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (add3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_1_add3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_1.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_1_add3.f + EXTRACT_FMT_1_ADD3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ + + EXTRACT_FMT_1_ADD3_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "add3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_1_add3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -106,69 +82,18 @@ EX_FN_NAME (add3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (and) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_2_and3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_2_and3.f + EXTRACT_FMT_2_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "and", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (and3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_2.f - /* Instruction fields. */ - int f_uimm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_uimm16 = EXTRACT_UNSIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_2_AND3_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_uimm16) = f_uimm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "and3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_2_and3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -185,69 +110,18 @@ EX_FN_NAME (and3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (or) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_3_or3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "or", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); +#define FLD(f) abuf->fields.fmt_3_or3.f + EXTRACT_FMT_3_OR3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (or3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_3.f - /* Instruction fields. */ - int f_uimm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_uimm16 = EXTRACT_UNSIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_3_OR3_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_uimm16) = f_uimm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "or3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "ulo16 0x%x", 'x', f_uimm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_3_or3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "ulo16 0x%x", 'x', f_uimm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -264,105 +138,17 @@ EX_FN_NAME (or3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (xor) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "xor", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (xor3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_4_addi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_2.f - /* Instruction fields. */ - int f_uimm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_uimm16 = EXTRACT_UNSIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_uimm16) = f_uimm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "xor3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; +#define FLD(f) abuf->fields.fmt_4_addi.f + EXTRACT_FMT_4_ADDI_VARS /* f-op1 f-r1 f-simm8 */ -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (addi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_4.f - /* Instruction fields. */ - int f_simm8; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_simm8 = EXTRACT_SIGNED (insn, 16, 8, 8); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_4_ADDI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; FLD (f_simm8) = f_simm8; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "addi", "dr 0x%x", 'x', f_r1, "simm8 0x%x", 'x', f_simm8, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_4_addi", "dr 0x%x", 'x', f_r1, "simm8 0x%x", 'x', f_simm8, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -379,69 +165,18 @@ EX_FN_NAME (addi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (addv) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_5_addv3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_5_addv3.f + EXTRACT_FMT_5_ADDV3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "addv", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (addv3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_5.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_5_ADDV3_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "addv3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_5_addv3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -458,28 +193,17 @@ EX_FN_NAME (addv3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (addx) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_6_addx) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_6_addx.f + EXTRACT_FMT_6_ADDX_VARS /* f-op1 f-r1 f-op2 f-r2 */ + + EXTRACT_FMT_6_ADDX_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "addx", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_6_addx", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -496,25 +220,16 @@ EX_FN_NAME (addx) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (bc8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_7_bc8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_6.f - /* Instruction fields. */ - int f_disp8; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_disp8 = EXTRACT_SIGNED (insn, 16, 8, 8) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_7_bc8.f + EXTRACT_FMT_7_BC8_VARS /* f-op1 f-r1 f-disp8 */ + + EXTRACT_FMT_7_BC8_CODE /* Record the fields for the semantic handler. */ RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bc8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_7_bc8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -522,25 +237,16 @@ EX_FN_NAME (bc8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (bc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_8_bc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_7.f - /* Instruction fields. */ - int f_disp24; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp24 = EXTRACT_SIGNED (insn, 32, 8, 24) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_8_bc24.f + EXTRACT_FMT_8_BC24_VARS /* f-op1 f-r1 f-disp24 */ + + EXTRACT_FMT_8_BC24_CODE /* Record the fields for the semantic handler. */ RECORD_IADDR (FLD (f_disp24), pc + f_disp24); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bc24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_8_bc24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -548,70 +254,18 @@ EX_FN_NAME (bc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (beq) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_9_beq) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_8.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "beq", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_9_beq.f + EXTRACT_FMT_9_BEQ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ -void -EX_FN_NAME (beqz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_9.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_9_BEQ_CODE /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "beqz", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_9_beq", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -620,115 +274,24 @@ EX_FN_NAME (beqz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) /* Record the fields for profiling. */ if (PROFILE_MODEL_P (current_cpu)) { - abuf->h_gr_get = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (bgez) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_9.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); - RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bgez", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); + abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); } #endif #undef FLD } void -EX_FN_NAME (bgtz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_10_beqz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_9.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_10_beqz.f + EXTRACT_FMT_10_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ - /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); - RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bgtz", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (blez) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_9.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_10_BEQZ_CODE /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r2) = & CPU (h_gr)[f_r2]; RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "blez", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_10_beqz", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -744,197 +307,33 @@ EX_FN_NAME (blez) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (bltz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_11_bl8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_9.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); - RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bltz", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); +#define FLD(f) abuf->fields.fmt_11_bl8.f + EXTRACT_FMT_11_BL8_VARS /* f-op1 f-r1 f-disp8 */ - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (bnez) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_9.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); - RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bnez", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (bl8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_6.f - /* Instruction fields. */ - int f_disp8; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_disp8 = EXTRACT_SIGNED (insn, 16, 8, 8) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_11_BL8_CODE /* Record the fields for the semantic handler. */ RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bl8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_11_bl8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); abuf->length = length; abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_set = 0 | (1 << 14); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (bl24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_7.f - /* Instruction fields. */ - int f_disp24; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp24 = EXTRACT_SIGNED (insn, 32, 8, 24) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - RECORD_IADDR (FLD (f_disp24), pc + f_disp24); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bl24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_set = 0 | (1 << 14); - } -#endif #undef FLD } void -EX_FN_NAME (bnc8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_12_bl24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_6.f - /* Instruction fields. */ - int f_disp8; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_disp8 = EXTRACT_SIGNED (insn, 16, 8, 8) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bnc8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; -#undef FLD -} +#define FLD(f) abuf->fields.fmt_12_bl24.f + EXTRACT_FMT_12_BL24_VARS /* f-op1 f-r1 f-disp24 */ -void -EX_FN_NAME (bnc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_7.f - /* Instruction fields. */ - int f_disp24; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp24 = EXTRACT_SIGNED (insn, 32, 8, 24) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_12_BL24_CODE /* Record the fields for the semantic handler. */ RECORD_IADDR (FLD (f_disp24), pc + f_disp24); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bnc24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_12_bl24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -942,65 +341,16 @@ EX_FN_NAME (bnc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (bne) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_13_bra8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_8.f - /* Instruction fields. */ - int f_disp16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp16 = EXTRACT_SIGNED (insn, 32, 16, 16) << 2; - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - RECORD_IADDR (FLD (f_disp16), pc + f_disp16); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bne", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_13_bra8.f + EXTRACT_FMT_13_BRA8_VARS /* f-op1 f-r1 f-disp8 */ -void -EX_FN_NAME (bra8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_6.f - /* Instruction fields. */ - int f_disp8; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_disp8 = EXTRACT_SIGNED (insn, 16, 8, 8) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_13_BRA8_CODE /* Record the fields for the semantic handler. */ RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bra8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_13_bra8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1008,25 +358,16 @@ EX_FN_NAME (bra8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (bra24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_14_bra24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_7.f - /* Instruction fields. */ - int f_disp24; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_disp24 = EXTRACT_SIGNED (insn, 32, 8, 24) << 2; - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_14_bra24.f + EXTRACT_FMT_14_BRA24_VARS /* f-op1 f-r1 f-disp24 */ + + EXTRACT_FMT_14_BRA24_CODE /* Record the fields for the semantic handler. */ RECORD_IADDR (FLD (f_disp24), pc + f_disp24); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "bra24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_14_bra24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1034,28 +375,17 @@ EX_FN_NAME (bra24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (cmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_15_cmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_15_cmp.f + EXTRACT_FMT_15_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ + + EXTRACT_FMT_15_CMP_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "cmp", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_15_cmp", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1071,30 +401,17 @@ EX_FN_NAME (cmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (cmpi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_16_cmpi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_11.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_op2; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_16_cmpi.f + EXTRACT_FMT_16_CMPI_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ + + EXTRACT_FMT_16_CMPI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "cmpi", "src2 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_16_cmpi", "src2 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1110,67 +427,17 @@ EX_FN_NAME (cmpi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (cmpu) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_17_cmpui) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "cmpu", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); +#define FLD(f) abuf->fields.fmt_17_cmpui.f + EXTRACT_FMT_17_CMPUI_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (cmpui) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_12.f - /* Instruction fields. */ - int f_uimm16; - int f_r2; - int f_op2; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_uimm16 = EXTRACT_UNSIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_17_CMPUI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_uimm16) = f_uimm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "cmpui", "src2 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_17_cmpui", "src2 0x%x", 'x', f_r2, "uimm16 0x%x", 'x', f_uimm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1186,70 +453,17 @@ EX_FN_NAME (cmpui) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (div) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_18_div) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_13.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_18_div.f + EXTRACT_FMT_18_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "div", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (divu) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_13.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_18_DIV_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "divu", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_18_div", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1266,107 +480,16 @@ EX_FN_NAME (divu) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (rem) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_19_jl) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_13.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_19_jl.f + EXTRACT_FMT_19_JL_VARS /* f-op1 f-r1 f-op2 f-r2 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "rem", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (remu) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_13.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "remu", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (jl) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_14.f - /* Instruction fields. */ - int f_r2; - int f_op2; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_19_JL_CODE /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "jl", "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_19_jl", "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1376,71 +499,22 @@ EX_FN_NAME (jl) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) if (PROFILE_MODEL_P (current_cpu)) { abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << 14); } #endif #undef FLD } void -EX_FN_NAME (jmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_20_jmp) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_14.f - /* Instruction fields. */ - int f_r2; - int f_op2; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_20_jmp.f + EXTRACT_FMT_20_JMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ - /* Record the fields for the semantic handler. */ - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "jmp", "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (ld) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_20_JMP_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ld", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_20_jmp", "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1450,76 +524,23 @@ EX_FN_NAME (ld) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) if (PROFILE_MODEL_P (current_cpu)) { abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); } #endif #undef FLD } void -EX_FN_NAME (ld_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_21_ld) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_1.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ld_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_21_ld.f + EXTRACT_FMT_21_LD_VARS /* f-op1 f-r1 f-op2 f-r2 */ -void -EX_FN_NAME (ldb) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_21_LD_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldb", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_21_ld", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1536,31 +557,18 @@ EX_FN_NAME (ldb) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (ldb_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_22_ld_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_1.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_22_ld_d.f + EXTRACT_FMT_22_LD_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ + + EXTRACT_FMT_22_LD_D_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldb_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_22_ld_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1577,69 +585,17 @@ EX_FN_NAME (ldb_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (ldh) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_23_ldb) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldh", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_23_ldb.f + EXTRACT_FMT_23_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */ -void -EX_FN_NAME (ldh_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_1.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_23_LDB_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldh_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_23_ldb", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1656,69 +612,18 @@ EX_FN_NAME (ldh_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (ldub) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_24_ldb_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldub", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_24_ldb_d.f + EXTRACT_FMT_24_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ -void -EX_FN_NAME (ldub_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_1.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_24_LDB_D_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldub_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_24_ldb_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1735,28 +640,17 @@ EX_FN_NAME (ldub_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (lduh) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_25_ldh) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_25_ldh.f + EXTRACT_FMT_25_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */ + + EXTRACT_FMT_25_LDH_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "lduh", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_25_ldh", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1773,31 +667,18 @@ EX_FN_NAME (lduh) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (lduh_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_26_ldh_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_1.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_26_ldh_d.f + EXTRACT_FMT_26_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ + + EXTRACT_FMT_26_LDH_D_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "lduh_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_26_ldh_d", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1814,64 +695,17 @@ EX_FN_NAME (lduh_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (ld_plus) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_27_ld24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_op2; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ld_plus", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); +#define FLD(f) abuf->fields.fmt_27_ld24.f + EXTRACT_FMT_27_LD24_VARS /* f-op1 f-r1 f-uimm24 */ - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (ld24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_15.f - /* Instruction fields. */ - int f_uimm24; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_uimm24 = EXTRACT_UNSIGNED (insn, 32, 8, 24); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_27_LD24_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; FLD (f_uimm24) = f_uimm24; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ld24", "dr 0x%x", 'x', f_r1, "uimm24 0x%x", 'x', f_uimm24, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_27_ld24", "dr 0x%x", 'x', f_r1, "uimm24 0x%x", 'x', f_uimm24, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1887,65 +721,17 @@ EX_FN_NAME (ld24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (ldi8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_28_ldi8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_4.f - /* Instruction fields. */ - int f_simm8; - int f_r1; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_simm8 = EXTRACT_SIGNED (insn, 16, 8, 8); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_simm8) = f_simm8; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldi8", "dr 0x%x", 'x', f_r1, "simm8 0x%x", 'x', f_simm8, (char *) 0)); +#define FLD(f) abuf->fields.fmt_28_ldi8.f + EXTRACT_FMT_28_LDI8_VARS /* f-op1 f-r1 f-simm8 */ - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (ldi16) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_16.f - /* Instruction fields. */ - int f_simm16; - int f_r1; - int f_r2; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_28_LDI8_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "ldi16", "dr 0x%x", 'x', f_r1, "slo16 0x%x", 'x', f_simm16, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_simm8) = f_simm8; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_28_ldi8", "dr 0x%x", 'x', f_r1, "simm8 0x%x", 'x', f_simm8, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -1961,213 +747,17 @@ EX_FN_NAME (ldi16) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (lock) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "lock", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (machi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_29_ldi16) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "machi", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (maclo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "maclo", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (macwhi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "macwhi", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (macwlo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "macwlo", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_29_ldi16.f + EXTRACT_FMT_29_LDI16_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ -void -EX_FN_NAME (mul) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_29_LDI16_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mul", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_simm16) = f_simm16; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_29_ldi16", "dr 0x%x", 'x', f_r1, "slo16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2176,7 +766,6 @@ EX_FN_NAME (mul) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) /* Record the fields for profiling. */ if (PROFILE_MODEL_P (current_cpu)) { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); abuf->h_gr_set = 0 | (1 << f_r1); } #endif @@ -2184,65 +773,17 @@ EX_FN_NAME (mul) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (mulhi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_30_machi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_30_machi.f + EXTRACT_FMT_30_MACHI_VARS /* f-op1 f-r1 f-op2 f-r2 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mulhi", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (mullo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_30_MACHI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mullo", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_30_machi", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2258,102 +799,17 @@ EX_FN_NAME (mullo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (mulwhi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_31_mv) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mulwhi", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); +#define FLD(f) abuf->fields.fmt_31_mv.f + EXTRACT_FMT_31_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */ - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (mulwlo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mulwlo", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (mv) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_31_MV_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mv", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_31_mv", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2370,63 +826,16 @@ EX_FN_NAME (mv) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (mvfachi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_32_mvfachi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_17.f - /* Instruction fields. */ - int f_r1; - int f_r2; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvfachi", "dr 0x%x", 'x', f_r1, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; +#define FLD(f) abuf->fields.fmt_32_mvfachi.f + EXTRACT_FMT_32_MVFACHI_VARS /* f-op1 f-r1 f-op2 f-r2 */ -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (mvfaclo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_17.f - /* Instruction fields. */ - int f_r1; - int f_r2; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_32_MVFACHI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvfaclo", "dr 0x%x", 'x', f_r1, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_32_mvfachi", "dr 0x%x", 'x', f_r1, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2442,64 +851,17 @@ EX_FN_NAME (mvfaclo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf } void -EX_FN_NAME (mvfacmi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_33_mvfc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_17.f - /* Instruction fields. */ - int f_r1; - int f_r2; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_33_mvfc.f + EXTRACT_FMT_33_MVFC_VARS /* f-op1 f-r1 f-op2 f-r2 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvfacmi", "dr 0x%x", 'x', f_r1, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (mvfc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_18.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_33_MVFC_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; FLD (f_r2) = f_r2; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvfc", "dr 0x%x", 'x', f_r1, "scr 0x%x", 'x', f_r2, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_33_mvfc", "dr 0x%x", 'x', f_r1, "scr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2515,63 +877,16 @@ EX_FN_NAME (mvfc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (mvtachi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_34_mvtachi) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_19.f - /* Instruction fields. */ - int f_r1; - int f_r2; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_34_mvtachi.f + EXTRACT_FMT_34_MVTACHI_VARS /* f-op1 f-r1 f-op2 f-r2 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvtachi", "src1 0x%x", 'x', f_r1, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (mvtaclo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_19.f - /* Instruction fields. */ - int f_r1; - int f_r2; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_34_MVTACHI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvtaclo", "src1 0x%x", 'x', f_r1, (char *) 0)); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_34_mvtachi", "src1 0x%x", 'x', f_r1, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2587,65 +902,17 @@ EX_FN_NAME (mvtaclo) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf } void -EX_FN_NAME (mvtc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_35_mvtc) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_20.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = f_r1; - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "mvtc", "dcr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_35_mvtc.f + EXTRACT_FMT_35_MVTC_VARS /* f-op1 f-r1 f-op2 f-r2 */ -void -EX_FN_NAME (neg) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_35_MVTC_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "neg", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_r1) = f_r1; + FLD (f_r2) = & CPU (h_gr)[f_r2]; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_35_mvtc", "dcr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2655,125 +922,37 @@ EX_FN_NAME (neg) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) if (PROFILE_MODEL_P (current_cpu)) { abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); } #endif #undef FLD } void -EX_FN_NAME (nop) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_36_nop) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_21.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_36_nop.f + EXTRACT_FMT_36_NOP_VARS /* f-op1 f-r1 f-op2 f-r2 */ - /* Record the fields for the semantic handler. */ - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "nop", (char *) 0)); - - abuf->length = length; - abuf->addr = pc; -#undef FLD -} - -void -EX_FN_NAME (not) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_36_NOP_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "not", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_36_nop", (char *) 0)); abuf->length = length; abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif #undef FLD } void -EX_FN_NAME (rac) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_37_rac) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_21.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "rac", (char *) 0)); - - abuf->length = length; - abuf->addr = pc; -#undef FLD -} +#define FLD(f) abuf->fields.fmt_37_rac.f + EXTRACT_FMT_37_RAC_VARS /* f-op1 f-r1 f-op2 f-r2 */ -void -EX_FN_NAME (rach) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_21.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_37_RAC_CODE /* Record the fields for the semantic handler. */ - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "rach", (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_37_rac", (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2781,57 +960,17 @@ EX_FN_NAME (rach) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (rte) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_38_seth) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_21.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); +#define FLD(f) abuf->fields.fmt_38_seth.f + EXTRACT_FMT_38_SETH_VARS /* f-op1 f-r1 f-op2 f-r2 f-hi16 */ - /* Record the fields for the semantic handler. */ - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "rte", (char *) 0)); - - abuf->length = length; - abuf->addr = pc; -#undef FLD -} - -void -EX_FN_NAME (seth) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_22.f - /* Instruction fields. */ - int f_hi16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_hi16 = EXTRACT_UNSIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_38_SETH_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; FLD (f_hi16) = f_hi16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "seth", "dr 0x%x", 'x', f_r1, "hi16 0x%x", 'x', f_hi16, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_38_seth", "dr 0x%x", 'x', f_r1, "hi16 0x%x", 'x', f_hi16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2847,107 +986,17 @@ EX_FN_NAME (seth) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (sll) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_39_slli) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sll", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} +#define FLD(f) abuf->fields.fmt_39_slli.f + EXTRACT_FMT_39_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */ -void -EX_FN_NAME (sll3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_5.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_39_SLLI_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sll3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (slli) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_23.f - /* Instruction fields. */ - int f_uimm5; - int f_r1; - int f_shift_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_uimm5 = EXTRACT_UNSIGNED (insn, 16, 11, 5); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_shift_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 3); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; FLD (f_uimm5) = f_uimm5; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "slli", "dr 0x%x", 'x', f_r1, "uimm5 0x%x", 'x', f_uimm5, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_39_slli", "dr 0x%x", 'x', f_r1, "uimm5 0x%x", 'x', f_uimm5, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -2964,416 +1013,18 @@ EX_FN_NAME (slli) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (sra) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_40_st_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sra", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; +#define FLD(f) abuf->fields.fmt_40_st_d.f + EXTRACT_FMT_40_ST_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (sra3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_5.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); + EXTRACT_FMT_40_ST_D_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); + FLD (f_r1) = & CPU (h_gr)[f_r1]; + FLD (f_r2) = & CPU (h_gr)[f_r2]; FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sra3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (srai) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_23.f - /* Instruction fields. */ - int f_uimm5; - int f_r1; - int f_shift_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_uimm5 = EXTRACT_UNSIGNED (insn, 16, 11, 5); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_shift_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 3); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_uimm5) = f_uimm5; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "srai", "dr 0x%x", 'x', f_r1, "uimm5 0x%x", 'x', f_uimm5, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (srl) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "srl", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (srl3) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_5.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "srl3", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "simm16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (srli) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_23.f - /* Instruction fields. */ - int f_uimm5; - int f_r1; - int f_shift_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_uimm5 = EXTRACT_UNSIGNED (insn, 16, 11, 5); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_shift_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 3); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_uimm5) = f_uimm5; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "srli", "dr 0x%x", 'x', f_r1, "uimm5 0x%x", 'x', f_uimm5, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (st) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "st", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (st_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_24.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "st_d", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (stb) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "stb", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (stb_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_24.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "stb_d", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (sth) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sth", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_40_st_d", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); abuf->length = length; abuf->addr = pc; @@ -3389,297 +1040,36 @@ EX_FN_NAME (sth) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) } void -EX_FN_NAME (sth_d) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,fmt_41_trap) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_24.f - /* Instruction fields. */ - int f_simm16; - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 4; - f_simm16 = EXTRACT_SIGNED (insn, 32, 16, 16); - f_r2 = EXTRACT_UNSIGNED (insn, 32, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 32, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 32, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 32, 0, 4); +#define FLD(f) abuf->fields.fmt_41_trap.f + EXTRACT_FMT_41_TRAP_VARS /* f-op1 f-r1 f-op2 f-uimm4 */ - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - FLD (f_simm16) = f_simm16; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sth_d", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "slo16 0x%x", 'x', f_simm16, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (st_plus) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); + EXTRACT_FMT_41_TRAP_CODE /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "st_plus", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (st_minus) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "st_minus", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r2); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (sub) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "sub", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD -} - -void -EX_FN_NAME (subv) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "subv", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); + FLD (f_uimm4) = f_uimm4; + TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_41_trap", "uimm4 0x%x", 'x', f_uimm4, (char *) 0)); abuf->length = length; abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif #undef FLD } void -EX_FN_NAME (subx) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EX_FN_NAME (m32r,illegal) (SIM_CPU *cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_0.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "subx", "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; + abuf->length = CGEN_BASE_INSN_SIZE; abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - abuf->h_gr_set = 0 | (1 << f_r1); - } -#endif -#undef FLD + /* Leave signalling to semantic fn. */ } +#if 0 /*wip*/ void -EX_FN_NAME (trap) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) +EXC_FN_NAME (m32r,illegal) (SIM_CPU *cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) { -#define FLD(f) abuf->fields.fmt_25.f - /* Instruction fields. */ - int f_uimm4; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_uimm4 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_uimm4) = f_uimm4; - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "trap", "uimm4 0x%x", 'x', f_uimm4, (char *) 0)); - - abuf->length = length; + abuf->length = CGEN_BASE_INSN_SIZE; abuf->addr = pc; -#undef FLD + /* Leave signalling to semantic fn. */ } - -void -EX_FN_NAME (unlock) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF *abuf) -{ -#define FLD(f) abuf->fields.fmt_10.f - /* Instruction fields. */ - int f_r2; - int f_r1; - int f_op2; - int f_op1; - /* The length of the insn may be fixed or variable. */ - int length; - - /* Extract the fields of the insn, computing the length as we go. */ - length = 2; - f_r2 = EXTRACT_UNSIGNED (insn, 16, 12, 4); - f_r1 = EXTRACT_UNSIGNED (insn, 16, 4, 4); - f_op2 = EXTRACT_UNSIGNED (insn, 16, 8, 4); - f_op1 = EXTRACT_UNSIGNED (insn, 16, 0, 4); - - /* Record the fields for the semantic handler. */ - FLD (f_r1) = & CPU (h_gr[f_r1]); - FLD (f_r2) = & CPU (h_gr[f_r2]); - TRACE_EXTRACT (current_cpu, (current_cpu, pc, "unlock", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); - - abuf->length = length; - abuf->addr = pc; - -#if WITH_PROFILE_MODEL_P - /* Record the fields for profiling. */ - if (PROFILE_MODEL_P (current_cpu)) - { - abuf->h_gr_get = 0 | (1 << f_r1) | (1 << f_r2); - } #endif -#undef FLD -} - |