diff options
author | Doug Evans <dje@google.com> | 1998-05-15 23:46:24 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 1998-05-15 23:46:24 +0000 |
commit | a8981d675148f40b4ee3067fbc5d12cd059a5f78 (patch) | |
tree | e0f258f421a49c366ed195b875211bc463ac659c /sim/m32r | |
parent | bcb829fdbd9711e4770dbff9bfade789b2989d50 (diff) | |
download | binutils-a8981d675148f40b4ee3067fbc5d12cd059a5f78.zip binutils-a8981d675148f40b4ee3067fbc5d12cd059a5f78.tar.gz binutils-a8981d675148f40b4ee3067fbc5d12cd059a5f78.tar.bz2 |
* Makefile.in (devices.o): Add dependencies.
* arch.h,cpu.c,cpu.h,cpuall.h: Regenerate.
* sem-switch.c,sem.c: Regenerate.
* mloop.in (execute): Update calls to TRACE_INSN_{INIT,FINI}.
* cpux.c,cpux.h,modelx.c,semx.c: Regenerate.
* m32rx.c (m32rx_model_mark_{busy,unbusy}_reg): New functions.
* mloopx.in (execute): Update calls to TRACE_INSN_{INIT,FINI}.
Diffstat (limited to 'sim/m32r')
-rw-r--r-- | sim/m32r/ChangeLog | 17 | ||||
-rw-r--r-- | sim/m32r/mloopx.in | 75 | ||||
-rw-r--r-- | sim/m32r/sem-switch.c | 316 | ||||
-rw-r--r-- | sim/m32r/sem.c | 577 | ||||
-rw-r--r-- | sim/m32r/semx.c | 108 |
5 files changed, 709 insertions, 384 deletions
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index 4a81089..3ff7182 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,20 @@ +Fri May 15 16:43:27 1998 Doug Evans <devans@seba.cygnus.com> + + * Makefile.in (devices.o): Add dependencies. + + * arch.h,cpu.c,cpu.h,cpuall.h: Regenerate. + * sem-switch.c,sem.c: Regenerate. + * mloop.in (execute): Update calls to TRACE_INSN_{INIT,FINI}. +start-sanitize-m32rx + * cpux.c,cpux.h,modelx.c,semx.c: Regenerate. + * m32rx.c (m32rx_model_mark_{busy,unbusy}_reg): New functions. + * mloopx.in (execute): Update calls to TRACE_INSN_{INIT,FINI}. +end-sanitize-m32rx + +Thu May 7 02:51:35 1998 Doug Evans <devans@seba.cygnus.com> + + * Makefile.in (SIM_OBJS): Add sim-cpu.o. + Wed May 6 14:51:39 1998 Doug Evans <devans@seba.cygnus.com> * arch.h,arch.c,cpu.h,cpuall.h: Regenerate, tweaks mostly. diff --git a/sim/m32r/mloopx.in b/sim/m32r/mloopx.in index fca05cd..8894729 100644 --- a/sim/m32r/mloopx.in +++ b/sim/m32r/mloopx.in @@ -36,7 +36,7 @@ EOF xinit) cat <<EOF - DECODE *d1,*d2; + const IDESC *d1,*d2; ARGBUF abufs[MAX_PARALLEL_INSNS]; PAREXEC pbufs[MAX_PARALLEL_INSNS]; EOF @@ -57,6 +57,7 @@ cat <<EOF insn &= 0x7fff; d1 = m32rx_decode (current_cpu, pc, insn); abufs[0].insn = insn; + abufs[0].idesc = d1; icount = 1; } else @@ -66,6 +67,7 @@ cat <<EOF { d1 = m32rx_decode (current_cpu, pc, insn >> 16); abufs[0].insn = insn; + abufs[0].idesc = d1; icount = 1; } else @@ -74,14 +76,17 @@ cat <<EOF { d1 = m32rx_decode (current_cpu, pc, insn >> 16); abufs[0].insn = insn >> 16; + abufs[0].idesc = d1; d2 = m32rx_decode (current_cpu, pc, insn & 0x7fff); abufs[1].insn = insn & 0x7fff; + abufs[1].idesc = d2; icount = 2; } else { d1 = m32rx_decode (current_cpu, pc, insn >> 16); abufs[0].insn = insn >> 16; + abufs[0].idesc = d1; icount = 1; } } @@ -90,7 +95,7 @@ cat <<EOF { int icount2 = icount; USI insn = abufs[0].insn; - DECODE *decode = d1; + const IDESC *decode = d1; /* decode, par_exec, and insn are refered to by readx.c. */ PAREXEC *par_exec = &pbufs[0]; do @@ -117,17 +122,18 @@ cat <<EOF PAREXEC *par_exec = &pbufs[0]; PCADDR new_pc; +#if 0 /* wip */ /* If doing parallel execution, verify insns are in the right pipeline. */ if (icount == 2) { - ; /*wip*/ + ... } +#endif - TRACE_INSN_INIT (current_cpu); + TRACE_INSN_INIT (current_cpu, 1); TRACE_INSN (current_cpu, d1->opcode, sem_arg, CPU (h_pc)); - new_pc = (*d1->semantic) (current_cpu, sem_arg, par_exec); - TRACE_INSN_FINI (current_cpu); - PROFILE_COUNT_INSN (current_cpu, CPU (h_pc), CGEN_INSN_INDEX (d1->opcode)); + new_pc = (*d1->sem_full) (current_cpu, sem_arg, par_exec); + TRACE_INSN_FINI (current_cpu, icount == 1); /* The result of the semantic fn is one of: - next address, branch only @@ -136,39 +142,44 @@ cat <<EOF - NEW_PC_4, 4 byte non-branch insn */ + /* The tests are ordered to try to favor the more frequent cases, while + keeping the over all costs down. */ if (new_pc == NEW_PC_4) CPU (h_pc) += 4; - else if (NEW_PC_BRANCH_P (new_pc)) - CPU (h_pc) = new_pc; - else + else if (icount == 2) { - PCADDR pc = CPU (h_pc); + /* Note that we only get here if doing parallel execution. */ - CPU (h_pc) = pc + 2; - if (icount == 2) + if (new_pc == NEW_PC_SKIP) { - /* Note that we only get here if doing parallel execution. */ - if (new_pc == NEW_PC_SKIP) - { - /* ??? Need generic notion of bypassing an insn for the name of - this macro. Annulled? On the otherhand such tracing can go - in the sc/snc semantic fn. */ - ; /*TRACE_INSN_SKIPPED (current_cpu);*/ - } + /* ??? Need generic notion of bypassing an insn for the name of + this macro. Annulled? On the otherhand such tracing can go + in the sc/snc semantic fn. */ + ; /*TRACE_INSN_SKIPPED (current_cpu);*/ + CPU (h_pc) += 4; + } + else + { + PCADDR pc2; + + ++sem_arg; + ++par_exec; + TRACE_INSN_INIT (current_cpu, 0); + TRACE_INSN (current_cpu, d2->opcode, sem_arg, CPU (h_pc) + 2); + /* pc2 isn't used. It's assigned a value for debugging. */ + pc2 = (*d2->sem_full) (current_cpu, sem_arg, par_exec); + TRACE_INSN_FINI (current_cpu, 1); + + if (NEW_PC_BRANCH_P (new_pc)) + CPU (h_pc) = new_pc; else - { - ++sem_arg; - ++par_exec; - TRACE_INSN_INIT (current_cpu); - TRACE_INSN (current_cpu, d2->opcode, sem_arg, CPU (h_pc)); - /* new_pc isn't used. It's assigned a value for debugging. */ - new_pc = (*d2->semantic) (current_cpu, sem_arg, par_exec); - TRACE_INSN_FINI (current_cpu); - PROFILE_COUNT_INSN (current_cpu, pc, CGEN_INSN_INDEX (d2->opcode)); - } - CPU (h_pc) = pc + 4; + CPU (h_pc) += 4; } } + else if (NEW_PC_BRANCH_P (new_pc)) + CPU (h_pc) = new_pc; + else + CPU (h_pc) += 2; } EOF diff --git a/sim/m32r/sem-switch.c b/sim/m32r/sem-switch.c index 2baae8a..b781059 100644 --- a/sim/m32r/sem-switch.c +++ b/sim/m32r/sem-switch.c @@ -27,118 +27,118 @@ with this program; if not, write to the Free Software Foundation, Inc., /* The labels have the case they have because the enum of insn types is all uppercase and in the non-stdc case the insn symbol is built - into the enum name. - - The order here must match the order in m32r_decode_vars in decode.c. */ - - static void *labels[] = { - && case_sem_INSN_ILLEGAL, - && case_sem_INSN_ADD, - && case_sem_INSN_ADD3, - && case_sem_INSN_AND, - && case_sem_INSN_AND3, - && case_sem_INSN_OR, - && case_sem_INSN_OR3, - && case_sem_INSN_XOR, - && case_sem_INSN_XOR3, - && case_sem_INSN_ADDI, - && case_sem_INSN_ADDV, - && case_sem_INSN_ADDV3, - && case_sem_INSN_ADDX, - && case_sem_INSN_BC8, - && case_sem_INSN_BC24, - && case_sem_INSN_BEQ, - && case_sem_INSN_BEQZ, - && case_sem_INSN_BGEZ, - && case_sem_INSN_BGTZ, - && case_sem_INSN_BLEZ, - && case_sem_INSN_BLTZ, - && case_sem_INSN_BNEZ, - && case_sem_INSN_BL8, - && case_sem_INSN_BL24, - && case_sem_INSN_BNC8, - && case_sem_INSN_BNC24, - && case_sem_INSN_BNE, - && case_sem_INSN_BRA8, - && case_sem_INSN_BRA24, - && case_sem_INSN_CMP, - && case_sem_INSN_CMPI, - && case_sem_INSN_CMPU, - && case_sem_INSN_CMPUI, - && case_sem_INSN_DIV, - && case_sem_INSN_DIVU, - && case_sem_INSN_REM, - && case_sem_INSN_REMU, - && case_sem_INSN_JL, - && case_sem_INSN_JMP, - && case_sem_INSN_LD, - && case_sem_INSN_LD_D, - && case_sem_INSN_LDB, - && case_sem_INSN_LDB_D, - && case_sem_INSN_LDH, - && case_sem_INSN_LDH_D, - && case_sem_INSN_LDUB, - && case_sem_INSN_LDUB_D, - && case_sem_INSN_LDUH, - && case_sem_INSN_LDUH_D, - && case_sem_INSN_LD_PLUS, - && case_sem_INSN_LD24, - && case_sem_INSN_LDI8, - && case_sem_INSN_LDI16, - && case_sem_INSN_LOCK, - && case_sem_INSN_MACHI, - && case_sem_INSN_MACLO, - && case_sem_INSN_MACWHI, - && case_sem_INSN_MACWLO, - && case_sem_INSN_MUL, - && case_sem_INSN_MULHI, - && case_sem_INSN_MULLO, - && case_sem_INSN_MULWHI, - && case_sem_INSN_MULWLO, - && case_sem_INSN_MV, - && case_sem_INSN_MVFACHI, - && case_sem_INSN_MVFACLO, - && case_sem_INSN_MVFACMI, - && case_sem_INSN_MVFC, - && case_sem_INSN_MVTACHI, - && case_sem_INSN_MVTACLO, - && case_sem_INSN_MVTC, - && case_sem_INSN_NEG, - && case_sem_INSN_NOP, - && case_sem_INSN_NOT, - && case_sem_INSN_RAC, - && case_sem_INSN_RACH, - && case_sem_INSN_RTE, - && case_sem_INSN_SETH, - && case_sem_INSN_SLL, - && case_sem_INSN_SLL3, - && case_sem_INSN_SLLI, - && case_sem_INSN_SRA, - && case_sem_INSN_SRA3, - && case_sem_INSN_SRAI, - && case_sem_INSN_SRL, - && case_sem_INSN_SRL3, - && case_sem_INSN_SRLI, - && case_sem_INSN_ST, - && case_sem_INSN_ST_D, - && case_sem_INSN_STB, - && case_sem_INSN_STB_D, - && case_sem_INSN_STH, - && case_sem_INSN_STH_D, - && case_sem_INSN_ST_PLUS, - && case_sem_INSN_ST_MINUS, - && case_sem_INSN_SUB, - && case_sem_INSN_SUBV, - && case_sem_INSN_SUBX, - && case_sem_INSN_TRAP, - && case_sem_INSN_UNLOCK, - 0 + into the enum name. */ + + static struct { + int index; + void *label; + } labels[] = { + { M32R_XINSN_ILLEGAL, && case_sem_INSN_ILLEGAL }, + { M32R_XINSN_ADD, && case_sem_INSN_ADD }, + { M32R_XINSN_ADD3, && case_sem_INSN_ADD3 }, + { M32R_XINSN_AND, && case_sem_INSN_AND }, + { M32R_XINSN_AND3, && case_sem_INSN_AND3 }, + { M32R_XINSN_OR, && case_sem_INSN_OR }, + { M32R_XINSN_OR3, && case_sem_INSN_OR3 }, + { M32R_XINSN_XOR, && case_sem_INSN_XOR }, + { M32R_XINSN_XOR3, && case_sem_INSN_XOR3 }, + { M32R_XINSN_ADDI, && case_sem_INSN_ADDI }, + { M32R_XINSN_ADDV, && case_sem_INSN_ADDV }, + { M32R_XINSN_ADDV3, && case_sem_INSN_ADDV3 }, + { M32R_XINSN_ADDX, && case_sem_INSN_ADDX }, + { M32R_XINSN_BC8, && case_sem_INSN_BC8 }, + { M32R_XINSN_BC24, && case_sem_INSN_BC24 }, + { M32R_XINSN_BEQ, && case_sem_INSN_BEQ }, + { M32R_XINSN_BEQZ, && case_sem_INSN_BEQZ }, + { M32R_XINSN_BGEZ, && case_sem_INSN_BGEZ }, + { M32R_XINSN_BGTZ, && case_sem_INSN_BGTZ }, + { M32R_XINSN_BLEZ, && case_sem_INSN_BLEZ }, + { M32R_XINSN_BLTZ, && case_sem_INSN_BLTZ }, + { M32R_XINSN_BNEZ, && case_sem_INSN_BNEZ }, + { M32R_XINSN_BL8, && case_sem_INSN_BL8 }, + { M32R_XINSN_BL24, && case_sem_INSN_BL24 }, + { M32R_XINSN_BNC8, && case_sem_INSN_BNC8 }, + { M32R_XINSN_BNC24, && case_sem_INSN_BNC24 }, + { M32R_XINSN_BNE, && case_sem_INSN_BNE }, + { M32R_XINSN_BRA8, && case_sem_INSN_BRA8 }, + { M32R_XINSN_BRA24, && case_sem_INSN_BRA24 }, + { M32R_XINSN_CMP, && case_sem_INSN_CMP }, + { M32R_XINSN_CMPI, && case_sem_INSN_CMPI }, + { M32R_XINSN_CMPU, && case_sem_INSN_CMPU }, + { M32R_XINSN_CMPUI, && case_sem_INSN_CMPUI }, + { M32R_XINSN_DIV, && case_sem_INSN_DIV }, + { M32R_XINSN_DIVU, && case_sem_INSN_DIVU }, + { M32R_XINSN_REM, && case_sem_INSN_REM }, + { M32R_XINSN_REMU, && case_sem_INSN_REMU }, + { M32R_XINSN_JL, && case_sem_INSN_JL }, + { M32R_XINSN_JMP, && case_sem_INSN_JMP }, + { M32R_XINSN_LD, && case_sem_INSN_LD }, + { M32R_XINSN_LD_D, && case_sem_INSN_LD_D }, + { M32R_XINSN_LDB, && case_sem_INSN_LDB }, + { M32R_XINSN_LDB_D, && case_sem_INSN_LDB_D }, + { M32R_XINSN_LDH, && case_sem_INSN_LDH }, + { M32R_XINSN_LDH_D, && case_sem_INSN_LDH_D }, + { M32R_XINSN_LDUB, && case_sem_INSN_LDUB }, + { M32R_XINSN_LDUB_D, && case_sem_INSN_LDUB_D }, + { M32R_XINSN_LDUH, && case_sem_INSN_LDUH }, + { M32R_XINSN_LDUH_D, && case_sem_INSN_LDUH_D }, + { M32R_XINSN_LD_PLUS, && case_sem_INSN_LD_PLUS }, + { M32R_XINSN_LD24, && case_sem_INSN_LD24 }, + { M32R_XINSN_LDI8, && case_sem_INSN_LDI8 }, + { M32R_XINSN_LDI16, && case_sem_INSN_LDI16 }, + { M32R_XINSN_LOCK, && case_sem_INSN_LOCK }, + { M32R_XINSN_MACHI, && case_sem_INSN_MACHI }, + { M32R_XINSN_MACLO, && case_sem_INSN_MACLO }, + { M32R_XINSN_MACWHI, && case_sem_INSN_MACWHI }, + { M32R_XINSN_MACWLO, && case_sem_INSN_MACWLO }, + { M32R_XINSN_MUL, && case_sem_INSN_MUL }, + { M32R_XINSN_MULHI, && case_sem_INSN_MULHI }, + { M32R_XINSN_MULLO, && case_sem_INSN_MULLO }, + { M32R_XINSN_MULWHI, && case_sem_INSN_MULWHI }, + { M32R_XINSN_MULWLO, && case_sem_INSN_MULWLO }, + { M32R_XINSN_MV, && case_sem_INSN_MV }, + { M32R_XINSN_MVFACHI, && case_sem_INSN_MVFACHI }, + { M32R_XINSN_MVFACLO, && case_sem_INSN_MVFACLO }, + { M32R_XINSN_MVFACMI, && case_sem_INSN_MVFACMI }, + { M32R_XINSN_MVFC, && case_sem_INSN_MVFC }, + { M32R_XINSN_MVTACHI, && case_sem_INSN_MVTACHI }, + { M32R_XINSN_MVTACLO, && case_sem_INSN_MVTACLO }, + { M32R_XINSN_MVTC, && case_sem_INSN_MVTC }, + { M32R_XINSN_NEG, && case_sem_INSN_NEG }, + { M32R_XINSN_NOP, && case_sem_INSN_NOP }, + { M32R_XINSN_NOT, && case_sem_INSN_NOT }, + { M32R_XINSN_RAC, && case_sem_INSN_RAC }, + { M32R_XINSN_RACH, && case_sem_INSN_RACH }, + { M32R_XINSN_RTE, && case_sem_INSN_RTE }, + { M32R_XINSN_SETH, && case_sem_INSN_SETH }, + { M32R_XINSN_SLL, && case_sem_INSN_SLL }, + { M32R_XINSN_SLL3, && case_sem_INSN_SLL3 }, + { M32R_XINSN_SLLI, && case_sem_INSN_SLLI }, + { M32R_XINSN_SRA, && case_sem_INSN_SRA }, + { M32R_XINSN_SRA3, && case_sem_INSN_SRA3 }, + { M32R_XINSN_SRAI, && case_sem_INSN_SRAI }, + { M32R_XINSN_SRL, && case_sem_INSN_SRL }, + { M32R_XINSN_SRL3, && case_sem_INSN_SRL3 }, + { M32R_XINSN_SRLI, && case_sem_INSN_SRLI }, + { M32R_XINSN_ST, && case_sem_INSN_ST }, + { M32R_XINSN_ST_D, && case_sem_INSN_ST_D }, + { M32R_XINSN_STB, && case_sem_INSN_STB }, + { M32R_XINSN_STB_D, && case_sem_INSN_STB_D }, + { M32R_XINSN_STH, && case_sem_INSN_STH }, + { M32R_XINSN_STH_D, && case_sem_INSN_STH_D }, + { M32R_XINSN_ST_PLUS, && case_sem_INSN_ST_PLUS }, + { M32R_XINSN_ST_MINUS, && case_sem_INSN_ST_MINUS }, + { M32R_XINSN_SUB, && case_sem_INSN_SUB }, + { M32R_XINSN_SUBV, && case_sem_INSN_SUBV }, + { M32R_XINSN_SUBX, && case_sem_INSN_SUBX }, + { M32R_XINSN_TRAP, && case_sem_INSN_TRAP }, + { M32R_XINSN_UNLOCK, && case_sem_INSN_UNLOCK }, + { 0, 0 } }; - extern DECODE *m32r_decode_vars[]; int i; - for (i = 0; m32r_decode_vars[i] != 0; ++i) - m32r_decode_vars[i]->semantic_lab = labels[i]; + for (i = 0; labels[i].label != 0; ++i) + CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label; #endif /* DEFINE_LABELS */ @@ -156,7 +156,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif #undef GET_ATTR -#define GET_ATTR(cpu, num, attr) CGEN_INSN_ATTR (abuf->opcode, CGEN_INSN_##attr) +#define GET_ATTR(cpu, num, attr) CGEN_INSN_ATTR (abuf->idesc->opcode, CGEN_INSN_##attr) { SEM_ARG sem_arg = sc; @@ -338,28 +338,28 @@ do { } BREAK (sem); - CASE (sem, INSN_BC8) : /* bc $disp8 */ + CASE (sem, INSN_BC8) : /* bc.s $disp8 */ { #define FLD(f) abuf->fields.fmt_bc8.f new_pc = SEM_NEXT_PC (sem_arg, 2); if (CPU (h_cond)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD } BREAK (sem); - CASE (sem, INSN_BC24) : /* bc $disp24 */ + CASE (sem, INSN_BC24) : /* bc.l $disp24 */ { #define FLD(f) abuf->fields.fmt_bc24.f new_pc = SEM_NEXT_PC (sem_arg, 4); if (CPU (h_cond)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -373,7 +373,7 @@ if (CPU (h_cond)) { if (EQSI (* FLD (f_r1), * FLD (f_r2))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -387,7 +387,7 @@ if (EQSI (* FLD (f_r1), * FLD (f_r2))) { if (EQSI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -401,7 +401,7 @@ if (EQSI (* FLD (f_r2), 0)) { if (GESI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -415,7 +415,7 @@ if (GESI (* FLD (f_r2), 0)) { if (GTSI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -429,7 +429,7 @@ if (GTSI (* FLD (f_r2), 0)) { if (LESI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -443,7 +443,7 @@ if (LESI (* FLD (f_r2), 0)) { if (LTSI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -457,67 +457,67 @@ if (LTSI (* FLD (f_r2), 0)) { if (NESI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD } BREAK (sem); - CASE (sem, INSN_BL8) : /* bl $disp8 */ + CASE (sem, INSN_BL8) : /* bl.s $disp8 */ { #define FLD(f) abuf->fields.fmt_bl8.f new_pc = SEM_NEXT_PC (sem_arg, 2); do { CPU (h_gr[14]) = ADDSI (ANDSI (CPU (h_pc), -4), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); #undef FLD } BREAK (sem); - CASE (sem, INSN_BL24) : /* bl $disp24 */ + CASE (sem, INSN_BL24) : /* bl.l $disp24 */ { #define FLD(f) abuf->fields.fmt_bl24.f new_pc = SEM_NEXT_PC (sem_arg, 4); do { CPU (h_gr[14]) = ADDSI (CPU (h_pc), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); #undef FLD } BREAK (sem); - CASE (sem, INSN_BNC8) : /* bnc $disp8 */ + CASE (sem, INSN_BNC8) : /* bnc.s $disp8 */ { #define FLD(f) abuf->fields.fmt_bc8.f new_pc = SEM_NEXT_PC (sem_arg, 2); if (NOTBI (CPU (h_cond))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD } BREAK (sem); - CASE (sem, INSN_BNC24) : /* bnc $disp24 */ + CASE (sem, INSN_BNC24) : /* bnc.l $disp24 */ { #define FLD(f) abuf->fields.fmt_bc24.f new_pc = SEM_NEXT_PC (sem_arg, 4); if (NOTBI (CPU (h_cond))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD @@ -531,32 +531,32 @@ if (NOTBI (CPU (h_cond))) { if (NESI (* FLD (f_r1), * FLD (f_r2))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } #undef FLD } BREAK (sem); - CASE (sem, INSN_BRA8) : /* bra $disp8 */ + CASE (sem, INSN_BRA8) : /* bra.s $disp8 */ { #define FLD(f) abuf->fields.fmt_bra8.f new_pc = SEM_NEXT_PC (sem_arg, 2); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); #undef FLD } BREAK (sem); - CASE (sem, INSN_BRA24) : /* bra $disp24 */ + CASE (sem, INSN_BRA24) : /* bra.l $disp24 */ { #define FLD(f) abuf->fields.fmt_bra24.f new_pc = SEM_NEXT_PC (sem_arg, 4); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); #undef FLD } @@ -676,9 +676,9 @@ do { temp0 = ADDSI (ANDSI (CPU (h_pc), -4), 4); temp1 = * FLD (f_r2); CPU (h_gr[14]) = temp0; - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); #undef FLD @@ -691,7 +691,7 @@ do { new_pc = SEM_NEXT_PC (sem_arg, 2); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, * FLD (f_r2))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); #undef FLD } @@ -848,7 +848,7 @@ do { } BREAK (sem); - CASE (sem, INSN_LDI8) : /* ldi $dr,$simm8 */ + CASE (sem, INSN_LDI8) : /* ldi8 $dr,$simm8 */ { #define FLD(f) abuf->fields.fmt_ldi8.f new_pc = SEM_NEXT_PC (sem_arg, 2); @@ -860,7 +860,7 @@ do { } BREAK (sem); - CASE (sem, INSN_LDI16) : /* ldi $dr,$hash$slo16 */ + CASE (sem, INSN_LDI16) : /* ldi16 $dr,$hash$slo16 */ { #define FLD(f) abuf->fields.fmt_ldi16.f new_pc = SEM_NEXT_PC (sem_arg, 4); @@ -879,7 +879,7 @@ do { do { CPU (h_lock) = 1; - TRACE_RESULT (current_cpu, "h-lock-0", 'x', CPU (h_lock)); + TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock)); * FLD (f_r1) = GETMEMSI (current_cpu, * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); } while (0); @@ -1177,13 +1177,13 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (tmp_tmp1, 7), 7)); do { CPU (h_sm) = CPU (h_bsm); - TRACE_RESULT (current_cpu, "h-sm-0", 'x', CPU (h_sm)); + TRACE_RESULT (current_cpu, "sm-0", 'x', CPU (h_sm)); CPU (h_ie) = CPU (h_bie); - TRACE_RESULT (current_cpu, "h-ie-0", 'x', CPU (h_ie)); + TRACE_RESULT (current_cpu, "ie-0", 'x', CPU (h_ie)); CPU (h_cond) = CPU (h_bcond); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (CPU (h_bpc), -4))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); #undef FLD @@ -1316,7 +1316,7 @@ do { new_pc = SEM_NEXT_PC (sem_arg, 2); SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); #undef FLD } @@ -1328,7 +1328,7 @@ SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); new_pc = SEM_NEXT_PC (sem_arg, 4); SETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); #undef FLD } @@ -1340,7 +1340,7 @@ SETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); new_pc = SEM_NEXT_PC (sem_arg, 2); SETMEMQI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMQI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, * FLD (f_r2))); #undef FLD } @@ -1352,7 +1352,7 @@ SETMEMQI (current_cpu, * FLD (f_r2), * FLD (f_r1)); new_pc = SEM_NEXT_PC (sem_arg, 4); SETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); #undef FLD } @@ -1364,7 +1364,7 @@ SETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); new_pc = SEM_NEXT_PC (sem_arg, 2); SETMEMHI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMHI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, * FLD (f_r2))); #undef FLD } @@ -1376,7 +1376,7 @@ SETMEMHI (current_cpu, * FLD (f_r2), * FLD (f_r1)); new_pc = SEM_NEXT_PC (sem_arg, 4); SETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); #undef FLD } @@ -1391,7 +1391,7 @@ do { SI tmp_new_src2; tmp_new_src2 = ADDSI (* FLD (f_r2), 4); SETMEMSI (current_cpu, tmp_new_src2, * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-new-src2", 'x', GETMEMSI (current_cpu, tmp_new_src2)); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2)); * FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); } while (0); @@ -1409,7 +1409,7 @@ do { SI tmp_new_src2; tmp_new_src2 = SUBSI (* FLD (f_r2), 4); SETMEMSI (current_cpu, tmp_new_src2, * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-new-src2", 'x', GETMEMSI (current_cpu, tmp_new_src2)); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2)); * FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); } while (0); @@ -1475,11 +1475,11 @@ do { do { m32r_h_cr_set (current_cpu, 6, ADDSI (CPU (h_pc), 4)); - TRACE_RESULT (current_cpu, "h-cr-6", 'x', m32r_h_cr_get (current_cpu, 6)); + TRACE_RESULT (current_cpu, "cr-6", 'x', m32r_h_cr_get (current_cpu, 6)); m32r_h_cr_set (current_cpu, 0, ANDSI (SLLSI (m32r_h_cr_get (current_cpu, 0), 8), 65408)); - TRACE_RESULT (current_cpu, "h-cr-0", 'x', m32r_h_cr_get (current_cpu, 0)); + TRACE_RESULT (current_cpu, "cr-0", 'x', m32r_h_cr_get (current_cpu, 0)); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, do_trap (current_cpu, FLD (f_uimm4)))); - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); #undef FLD @@ -1494,10 +1494,10 @@ m32r_h_cr_set (current_cpu, 0, ANDSI (SLLSI (m32r_h_cr_get (current_cpu, 0), 8), do { if (CPU (h_lock)) { SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); } CPU (h_lock) = 0; - TRACE_RESULT (current_cpu, "h-lock-0", 'x', CPU (h_lock)); + TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock)); } while (0); #undef FLD diff --git a/sim/m32r/sem.c b/sim/m32r/sem.c index 328b91d..8b866ae 100644 --- a/sim/m32r/sem.c +++ b/sim/m32r/sem.c @@ -30,12 +30,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "cgen-ops.h" #include "cpu-sim.h" -#if ! defined (SCACHE_P) || (defined (SCACHE_P) && WITH_SCACHE) +#if WITH_SCACHE #undef GET_ATTR -#define GET_ATTR(cpu, num, attr) CGEN_INSN_ATTR (abuf->opcode, CGEN_INSN_##attr) +#define GET_ATTR(cpu, num, attr) CGEN_INSN_ATTR (abuf->idesc->opcode, CGEN_INSN_##attr) + +/* add: add $dr,$sr. */ -/* Perform add: add $dr,$sr. */ CIA SEM_FN_NAME (m32r,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -46,6 +47,8 @@ SEM_FN_NAME (m32r,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ADDSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -59,7 +62,8 @@ SEM_FN_NAME (m32r,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform add3: add3 $dr,$sr,$hash$slo16. */ +/* add3: add3 $dr,$sr,$hash$slo16. */ + CIA SEM_FN_NAME (m32r,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -70,6 +74,8 @@ SEM_FN_NAME (m32r,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ADDSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -83,7 +89,8 @@ SEM_FN_NAME (m32r,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform and: and $dr,$sr. */ +/* and: and $dr,$sr. */ + CIA SEM_FN_NAME (m32r,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -94,6 +101,8 @@ SEM_FN_NAME (m32r,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ANDSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -107,7 +116,8 @@ SEM_FN_NAME (m32r,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform and3: and3 $dr,$sr,$uimm16. */ +/* and3: and3 $dr,$sr,$uimm16. */ + CIA SEM_FN_NAME (m32r,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -118,6 +128,8 @@ SEM_FN_NAME (m32r,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ANDSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -131,7 +143,8 @@ SEM_FN_NAME (m32r,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform or: or $dr,$sr. */ +/* or: or $dr,$sr. */ + CIA SEM_FN_NAME (m32r,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -142,6 +155,8 @@ SEM_FN_NAME (m32r,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ORSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -155,7 +170,8 @@ SEM_FN_NAME (m32r,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform or3: or3 $dr,$sr,$hash$ulo16. */ +/* or3: or3 $dr,$sr,$hash$ulo16. */ + CIA SEM_FN_NAME (m32r,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -166,6 +182,8 @@ SEM_FN_NAME (m32r,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ORSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -179,7 +197,8 @@ SEM_FN_NAME (m32r,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform xor: xor $dr,$sr. */ +/* xor: xor $dr,$sr. */ + CIA SEM_FN_NAME (m32r,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -190,6 +209,8 @@ SEM_FN_NAME (m32r,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = XORSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -203,7 +224,8 @@ SEM_FN_NAME (m32r,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform xor3: xor3 $dr,$sr,$uimm16. */ +/* xor3: xor3 $dr,$sr,$uimm16. */ + CIA SEM_FN_NAME (m32r,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -214,6 +236,8 @@ SEM_FN_NAME (m32r,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = XORSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -227,7 +251,8 @@ SEM_FN_NAME (m32r,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform addi: addi $dr,$simm8. */ +/* addi: addi $dr,$simm8. */ + CIA SEM_FN_NAME (m32r,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -238,6 +263,8 @@ SEM_FN_NAME (m32r,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ADDSI (* FLD (f_r1), FLD (f_simm8)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -251,7 +278,8 @@ SEM_FN_NAME (m32r,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform addv: addv $dr,$sr. */ +/* addv: addv $dr,$sr. */ + CIA SEM_FN_NAME (m32r,addv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -269,6 +297,8 @@ do { TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -282,7 +312,8 @@ do { #undef FLD } -/* Perform addv3: addv3 $dr,$sr,$simm16. */ +/* addv3: addv3 $dr,$sr,$simm16. */ + CIA SEM_FN_NAME (m32r,addv3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -300,6 +331,8 @@ do { TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -313,7 +346,8 @@ do { #undef FLD } -/* Perform addx: addx $dr,$sr. */ +/* addx: addx $dr,$sr. */ + CIA SEM_FN_NAME (m32r,addx) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -331,6 +365,8 @@ do { TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -344,7 +380,8 @@ do { #undef FLD } -/* Perform bc8: bc $disp8. */ +/* bc8: bc.s $disp8. */ + CIA SEM_FN_NAME (m32r,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -356,9 +393,11 @@ SEM_FN_NAME (m32r,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (CPU (h_cond)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -370,7 +409,8 @@ if (CPU (h_cond)) { #undef FLD } -/* Perform bc24: bc $disp24. */ +/* bc24: bc.l $disp24. */ + CIA SEM_FN_NAME (m32r,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -382,9 +422,11 @@ SEM_FN_NAME (m32r,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (CPU (h_cond)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -396,7 +438,8 @@ if (CPU (h_cond)) { #undef FLD } -/* Perform beq: beq $src1,$src2,$disp16. */ +/* beq: beq $src1,$src2,$disp16. */ + CIA SEM_FN_NAME (m32r,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -408,9 +451,11 @@ SEM_FN_NAME (m32r,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (EQSI (* FLD (f_r1), * FLD (f_r2))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -423,7 +468,8 @@ if (EQSI (* FLD (f_r1), * FLD (f_r2))) { #undef FLD } -/* Perform beqz: beqz $src2,$disp16. */ +/* beqz: beqz $src2,$disp16. */ + CIA SEM_FN_NAME (m32r,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -435,9 +481,11 @@ SEM_FN_NAME (m32r,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (EQSI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -450,7 +498,8 @@ if (EQSI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform bgez: bgez $src2,$disp16. */ +/* bgez: bgez $src2,$disp16. */ + CIA SEM_FN_NAME (m32r,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -462,9 +511,11 @@ SEM_FN_NAME (m32r,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (GESI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -477,7 +528,8 @@ if (GESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform bgtz: bgtz $src2,$disp16. */ +/* bgtz: bgtz $src2,$disp16. */ + CIA SEM_FN_NAME (m32r,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -489,9 +541,11 @@ SEM_FN_NAME (m32r,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (GTSI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -504,7 +558,8 @@ if (GTSI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform blez: blez $src2,$disp16. */ +/* blez: blez $src2,$disp16. */ + CIA SEM_FN_NAME (m32r,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -516,9 +571,11 @@ SEM_FN_NAME (m32r,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (LESI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -531,7 +588,8 @@ if (LESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform bltz: bltz $src2,$disp16. */ +/* bltz: bltz $src2,$disp16. */ + CIA SEM_FN_NAME (m32r,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -543,9 +601,11 @@ SEM_FN_NAME (m32r,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (LTSI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -558,7 +618,8 @@ if (LTSI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform bnez: bnez $src2,$disp16. */ +/* bnez: bnez $src2,$disp16. */ + CIA SEM_FN_NAME (m32r,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -570,9 +631,11 @@ SEM_FN_NAME (m32r,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (NESI (* FLD (f_r2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -585,7 +648,8 @@ if (NESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform bl8: bl $disp8. */ +/* bl8: bl.s $disp8. */ + CIA SEM_FN_NAME (m32r,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -596,12 +660,14 @@ SEM_FN_NAME (m32r,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) do { CPU (h_gr[14]) = ADDSI (ANDSI (CPU (h_pc), -4), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -614,7 +680,8 @@ do { #undef FLD } -/* Perform bl24: bl $disp24. */ +/* bl24: bl.l $disp24. */ + CIA SEM_FN_NAME (m32r,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -625,12 +692,14 @@ SEM_FN_NAME (m32r,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) do { CPU (h_gr[14]) = ADDSI (CPU (h_pc), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -643,7 +712,8 @@ do { #undef FLD } -/* Perform bnc8: bnc $disp8. */ +/* bnc8: bnc.s $disp8. */ + CIA SEM_FN_NAME (m32r,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -655,9 +725,11 @@ SEM_FN_NAME (m32r,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (NOTBI (CPU (h_cond))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -669,7 +741,8 @@ if (NOTBI (CPU (h_cond))) { #undef FLD } -/* Perform bnc24: bnc $disp24. */ +/* bnc24: bnc.l $disp24. */ + CIA SEM_FN_NAME (m32r,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -681,9 +754,11 @@ SEM_FN_NAME (m32r,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (NOTBI (CPU (h_cond))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -695,7 +770,8 @@ if (NOTBI (CPU (h_cond))) { #undef FLD } -/* Perform bne: bne $src1,$src2,$disp16. */ +/* bne: bne $src1,$src2,$disp16. */ + CIA SEM_FN_NAME (m32r,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -707,9 +783,11 @@ SEM_FN_NAME (m32r,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg) if (NESI (* FLD (f_r1), * FLD (f_r2))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -722,7 +800,8 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { #undef FLD } -/* Perform bra8: bra $disp8. */ +/* bra8: bra.s $disp8. */ + CIA SEM_FN_NAME (m32r,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -733,7 +812,9 @@ SEM_FN_NAME (m32r,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -746,7 +827,8 @@ SEM_FN_NAME (m32r,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform bra24: bra $disp24. */ +/* bra24: bra.l $disp24. */ + CIA SEM_FN_NAME (m32r,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -757,7 +839,9 @@ SEM_FN_NAME (m32r,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -770,7 +854,8 @@ SEM_FN_NAME (m32r,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform cmp: cmp $src1,$src2. */ +/* cmp: cmp $src1,$src2. */ + CIA SEM_FN_NAME (m32r,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -781,6 +866,8 @@ SEM_FN_NAME (m32r,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CPU (h_cond) = LTSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -793,7 +880,8 @@ SEM_FN_NAME (m32r,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform cmpi: cmpi $src2,$simm16. */ +/* cmpi: cmpi $src2,$simm16. */ + CIA SEM_FN_NAME (m32r,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -804,6 +892,8 @@ SEM_FN_NAME (m32r,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CPU (h_cond) = LTSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -816,7 +906,8 @@ SEM_FN_NAME (m32r,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform cmpu: cmpu $src1,$src2. */ +/* cmpu: cmpu $src1,$src2. */ + CIA SEM_FN_NAME (m32r,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -827,6 +918,8 @@ SEM_FN_NAME (m32r,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CPU (h_cond) = LTUSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -839,7 +932,8 @@ SEM_FN_NAME (m32r,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform cmpui: cmpui $src2,$simm16. */ +/* cmpui: cmpui $src2,$simm16. */ + CIA SEM_FN_NAME (m32r,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -850,6 +944,8 @@ SEM_FN_NAME (m32r,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CPU (h_cond) = LTUSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -862,7 +958,8 @@ SEM_FN_NAME (m32r,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform div: div $dr,$sr. */ +/* div: div $dr,$sr. */ + CIA SEM_FN_NAME (m32r,div) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -875,6 +972,8 @@ if (NESI (* FLD (f_r2), 0)) { TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -888,7 +987,8 @@ if (NESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform divu: divu $dr,$sr. */ +/* divu: divu $dr,$sr. */ + CIA SEM_FN_NAME (m32r,divu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -901,6 +1001,8 @@ if (NESI (* FLD (f_r2), 0)) { TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -914,7 +1016,8 @@ if (NESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform rem: rem $dr,$sr. */ +/* rem: rem $dr,$sr. */ + CIA SEM_FN_NAME (m32r,rem) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -927,6 +1030,8 @@ if (NESI (* FLD (f_r2), 0)) { TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -940,7 +1045,8 @@ if (NESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform remu: remu $dr,$sr. */ +/* remu: remu $dr,$sr. */ + CIA SEM_FN_NAME (m32r,remu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -953,6 +1059,8 @@ if (NESI (* FLD (f_r2), 0)) { TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); } + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -966,7 +1074,8 @@ if (NESI (* FLD (f_r2), 0)) { #undef FLD } -/* Perform jl: jl $sr. */ +/* jl: jl $sr. */ + CIA SEM_FN_NAME (m32r,jl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -980,12 +1089,14 @@ do { temp0 = ADDSI (ANDSI (CPU (h_pc), -4), 4); temp1 = * FLD (f_r2); CPU (h_gr[14]) = temp0; - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -999,7 +1110,8 @@ do { #undef FLD } -/* Perform jmp: jmp $sr. */ +/* jmp: jmp $sr. */ + CIA SEM_FN_NAME (m32r,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1010,7 +1122,9 @@ SEM_FN_NAME (m32r,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, * FLD (f_r2))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -1024,7 +1138,8 @@ SEM_FN_NAME (m32r,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ld: ld $dr,@$sr. */ +/* ld: ld $dr,@$sr. */ + CIA SEM_FN_NAME (m32r,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1035,6 +1150,8 @@ SEM_FN_NAME (m32r,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = GETMEMSI (current_cpu, * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1048,7 +1165,8 @@ SEM_FN_NAME (m32r,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ld-d: ld $dr,@($slo16,$sr). */ +/* ld-d: ld $dr,@($slo16,$sr). */ + CIA SEM_FN_NAME (m32r,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1059,6 +1177,8 @@ SEM_FN_NAME (m32r,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1072,7 +1192,8 @@ SEM_FN_NAME (m32r,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldb: ldb $dr,@$sr. */ +/* ldb: ldb $dr,@$sr. */ + CIA SEM_FN_NAME (m32r,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1083,6 +1204,8 @@ SEM_FN_NAME (m32r,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = EXTQISI (GETMEMQI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1096,7 +1219,8 @@ SEM_FN_NAME (m32r,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldb-d: ldb $dr,@($slo16,$sr). */ +/* ldb-d: ldb $dr,@($slo16,$sr). */ + CIA SEM_FN_NAME (m32r,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1107,6 +1231,8 @@ SEM_FN_NAME (m32r,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = EXTQISI (GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1120,7 +1246,8 @@ SEM_FN_NAME (m32r,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldh: ldh $dr,@$sr. */ +/* ldh: ldh $dr,@$sr. */ + CIA SEM_FN_NAME (m32r,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1131,6 +1258,8 @@ SEM_FN_NAME (m32r,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = EXTHISI (GETMEMHI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1144,7 +1273,8 @@ SEM_FN_NAME (m32r,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldh-d: ldh $dr,@($slo16,$sr). */ +/* ldh-d: ldh $dr,@($slo16,$sr). */ + CIA SEM_FN_NAME (m32r,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1155,6 +1285,8 @@ SEM_FN_NAME (m32r,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = EXTHISI (GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1168,7 +1300,8 @@ SEM_FN_NAME (m32r,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldub: ldub $dr,@$sr. */ +/* ldub: ldub $dr,@$sr. */ + CIA SEM_FN_NAME (m32r,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1179,6 +1312,8 @@ SEM_FN_NAME (m32r,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ZEXTQISI (GETMEMQI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1192,7 +1327,8 @@ SEM_FN_NAME (m32r,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldub-d: ldub $dr,@($slo16,$sr). */ +/* ldub-d: ldub $dr,@($slo16,$sr). */ + CIA SEM_FN_NAME (m32r,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1203,6 +1339,8 @@ SEM_FN_NAME (m32r,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ZEXTQISI (GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1216,7 +1354,8 @@ SEM_FN_NAME (m32r,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform lduh: lduh $dr,@$sr. */ +/* lduh: lduh $dr,@$sr. */ + CIA SEM_FN_NAME (m32r,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1227,6 +1366,8 @@ SEM_FN_NAME (m32r,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ZEXTHISI (GETMEMHI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1240,7 +1381,8 @@ SEM_FN_NAME (m32r,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform lduh-d: lduh $dr,@($slo16,$sr). */ +/* lduh-d: lduh $dr,@($slo16,$sr). */ + CIA SEM_FN_NAME (m32r,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1251,6 +1393,8 @@ SEM_FN_NAME (m32r,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = ZEXTHISI (GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1264,7 +1408,8 @@ SEM_FN_NAME (m32r,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ld-plus: ld $dr,@$sr+. */ +/* ld-plus: ld $dr,@$sr+. */ + CIA SEM_FN_NAME (m32r,ld_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1282,6 +1427,8 @@ do { TRACE_RESULT (current_cpu, "sr", 'x', * FLD (f_r2)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1295,7 +1442,8 @@ do { #undef FLD } -/* Perform ld24: ld24 $dr,$uimm24. */ +/* ld24: ld24 $dr,$uimm24. */ + CIA SEM_FN_NAME (m32r,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1306,6 +1454,8 @@ SEM_FN_NAME (m32r,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = FLD (f_uimm24); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1318,7 +1468,8 @@ SEM_FN_NAME (m32r,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldi8: ldi $dr,$simm8. */ +/* ldi8: ldi8 $dr,$simm8. */ + CIA SEM_FN_NAME (m32r,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1329,6 +1480,8 @@ SEM_FN_NAME (m32r,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = FLD (f_simm8); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1341,7 +1494,8 @@ SEM_FN_NAME (m32r,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform ldi16: ldi $dr,$hash$slo16. */ +/* ldi16: ldi16 $dr,$hash$slo16. */ + CIA SEM_FN_NAME (m32r,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1352,6 +1506,8 @@ SEM_FN_NAME (m32r,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = FLD (f_simm16); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1364,7 +1520,8 @@ SEM_FN_NAME (m32r,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform lock: lock $dr,@$sr. */ +/* lock: lock $dr,@$sr. */ + CIA SEM_FN_NAME (m32r,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1374,11 +1531,13 @@ SEM_FN_NAME (m32r,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg) do { CPU (h_lock) = 1; - TRACE_RESULT (current_cpu, "h-lock-0", 'x', CPU (h_lock)); + TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock)); * FLD (f_r1) = GETMEMSI (current_cpu, * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1392,7 +1551,8 @@ do { #undef FLD } -/* Perform machi: machi $src1,$src2. */ +/* machi: machi $src1,$src2. */ + CIA SEM_FN_NAME (m32r,machi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1403,6 +1563,8 @@ SEM_FN_NAME (m32r,machi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cpu), MULDI (EXTSIDI (ANDSI (* FLD (f_r1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16))))), 8), 8)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1415,7 +1577,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cp #undef FLD } -/* Perform maclo: maclo $src1,$src2. */ +/* maclo: maclo $src1,$src2. */ + CIA SEM_FN_NAME (m32r,maclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1426,6 +1589,8 @@ SEM_FN_NAME (m32r,maclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cpu), MULDI (EXTSIDI (SLLSI (* FLD (f_r1), 16)), EXTHIDI (TRUNCSIHI (* FLD (f_r2))))), 8), 8)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1438,7 +1603,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cp #undef FLD } -/* Perform macwhi: macwhi $src1,$src2. */ +/* macwhi: macwhi $src1,$src2. */ + CIA SEM_FN_NAME (m32r,macwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1449,6 +1615,8 @@ SEM_FN_NAME (m32r,macwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cpu), MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16))))), 8), 8)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1461,7 +1629,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cp #undef FLD } -/* Perform macwlo: macwlo $src1,$src2. */ +/* macwlo: macwlo $src1,$src2. */ + CIA SEM_FN_NAME (m32r,macwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1472,6 +1641,8 @@ SEM_FN_NAME (m32r,macwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cpu), MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (* FLD (f_r2))))), 8), 8)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1484,7 +1655,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (m32r_h_accum_get (current_cp #undef FLD } -/* Perform mul: mul $dr,$sr. */ +/* mul: mul $dr,$sr. */ + CIA SEM_FN_NAME (m32r,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1495,6 +1667,8 @@ SEM_FN_NAME (m32r,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = MULSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1508,7 +1682,8 @@ SEM_FN_NAME (m32r,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform mulhi: mulhi $src1,$src2. */ +/* mulhi: mulhi $src1,$src2. */ + CIA SEM_FN_NAME (m32r,mulhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1519,6 +1694,8 @@ SEM_FN_NAME (m32r,mulhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (f_r1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16)))), 16), 16)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1531,7 +1708,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (f_r1) #undef FLD } -/* Perform mullo: mullo $src1,$src2. */ +/* mullo: mullo $src1,$src2. */ + CIA SEM_FN_NAME (m32r,mullo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1542,6 +1720,8 @@ SEM_FN_NAME (m32r,mullo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (f_r1), 16)), EXTHIDI (TRUNCSIHI (* FLD (f_r2)))), 16), 16)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1554,7 +1734,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (f_r1) #undef FLD } -/* Perform mulwhi: mulwhi $src1,$src2. */ +/* mulwhi: mulwhi $src1,$src2. */ + CIA SEM_FN_NAME (m32r,mulwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1565,6 +1746,8 @@ SEM_FN_NAME (m32r,mulwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16)))), 8), 8)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1577,7 +1760,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTH #undef FLD } -/* Perform mulwlo: mulwlo $src1,$src2. */ +/* mulwlo: mulwlo $src1,$src2. */ + CIA SEM_FN_NAME (m32r,mulwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1588,6 +1772,8 @@ SEM_FN_NAME (m32r,mulwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (* FLD (f_r2)))), 8), 8)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1600,7 +1786,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTH #undef FLD } -/* Perform mv: mv $dr,$sr. */ +/* mv: mv $dr,$sr. */ + CIA SEM_FN_NAME (m32r,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1611,6 +1798,8 @@ SEM_FN_NAME (m32r,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = * FLD (f_r2); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1624,7 +1813,8 @@ SEM_FN_NAME (m32r,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform mvfachi: mvfachi $dr. */ +/* mvfachi: mvfachi $dr. */ + CIA SEM_FN_NAME (m32r,mvfachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1635,6 +1825,8 @@ SEM_FN_NAME (m32r,mvfachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = TRUNCDISI (SRADI (m32r_h_accum_get (current_cpu), 32)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1647,7 +1839,8 @@ SEM_FN_NAME (m32r,mvfachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform mvfaclo: mvfaclo $dr. */ +/* mvfaclo: mvfaclo $dr. */ + CIA SEM_FN_NAME (m32r,mvfaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1658,6 +1851,8 @@ SEM_FN_NAME (m32r,mvfaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = TRUNCDISI (m32r_h_accum_get (current_cpu)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1670,7 +1865,8 @@ SEM_FN_NAME (m32r,mvfaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform mvfacmi: mvfacmi $dr. */ +/* mvfacmi: mvfacmi $dr. */ + CIA SEM_FN_NAME (m32r,mvfacmi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1681,6 +1877,8 @@ SEM_FN_NAME (m32r,mvfacmi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = TRUNCDISI (SRADI (m32r_h_accum_get (current_cpu), 16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1693,7 +1891,8 @@ SEM_FN_NAME (m32r,mvfacmi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform mvfc: mvfc $dr,$scr. */ +/* mvfc: mvfc $dr,$scr. */ + CIA SEM_FN_NAME (m32r,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1704,6 +1903,8 @@ SEM_FN_NAME (m32r,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = m32r_h_cr_get (current_cpu, FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1716,7 +1917,8 @@ SEM_FN_NAME (m32r,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform mvtachi: mvtachi $src1. */ +/* mvtachi: mvtachi $src1. */ + CIA SEM_FN_NAME (m32r,mvtachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1727,6 +1929,8 @@ SEM_FN_NAME (m32r,mvtachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, ORDI (ANDDI (m32r_h_accum_get (current_cpu), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (f_r1)), 32))); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1739,7 +1943,8 @@ m32r_h_accum_set (current_cpu, ORDI (ANDDI (m32r_h_accum_get (current_cpu), MAKE #undef FLD } -/* Perform mvtaclo: mvtaclo $src1. */ +/* mvtaclo: mvtaclo $src1. */ + CIA SEM_FN_NAME (m32r,mvtaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1750,6 +1955,8 @@ SEM_FN_NAME (m32r,mvtaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_accum_set (current_cpu, ORDI (ANDDI (m32r_h_accum_get (current_cpu), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (f_r1)))); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1762,7 +1969,8 @@ m32r_h_accum_set (current_cpu, ORDI (ANDDI (m32r_h_accum_get (current_cpu), MAKE #undef FLD } -/* Perform mvtc: mvtc $sr,$dcr. */ +/* mvtc: mvtc $sr,$dcr. */ + CIA SEM_FN_NAME (m32r,mvtc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1773,6 +1981,8 @@ SEM_FN_NAME (m32r,mvtc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) m32r_h_cr_set (current_cpu, FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dcr", 'x', m32r_h_cr_get (current_cpu, FLD (f_r1))); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1785,7 +1995,8 @@ m32r_h_cr_set (current_cpu, FLD (f_r1), * FLD (f_r2)); #undef FLD } -/* Perform neg: neg $dr,$sr. */ +/* neg: neg $dr,$sr. */ + CIA SEM_FN_NAME (m32r,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1796,6 +2007,8 @@ SEM_FN_NAME (m32r,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = NEGSI (* FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1809,7 +2022,8 @@ SEM_FN_NAME (m32r,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform nop: nop. */ +/* nop: nop. */ + CIA SEM_FN_NAME (m32r,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1819,6 +2033,8 @@ SEM_FN_NAME (m32r,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg) PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1830,7 +2046,8 @@ PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr); #undef FLD } -/* Perform not: not $dr,$sr. */ +/* not: not $dr,$sr. */ + CIA SEM_FN_NAME (m32r,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1841,6 +2058,8 @@ SEM_FN_NAME (m32r,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = INVSI (* FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1854,7 +2073,8 @@ SEM_FN_NAME (m32r,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform rac: rac. */ +/* rac: rac. */ + CIA SEM_FN_NAME (m32r,rac) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1870,6 +2090,8 @@ m32r_h_accum_set (current_cpu, (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? ( TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1881,7 +2103,8 @@ m32r_h_accum_set (current_cpu, (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? ( #undef FLD } -/* Perform rach: rach. */ +/* rach: rach. */ + CIA SEM_FN_NAME (m32r,rach) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1906,6 +2129,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (tmp_tmp1, 7), 7)); TRACE_RESULT (current_cpu, "accum", 'D', m32r_h_accum_get (current_cpu)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1917,7 +2142,8 @@ m32r_h_accum_set (current_cpu, SRADI (SLLDI (tmp_tmp1, 7), 7)); #undef FLD } -/* Perform rte: rte. */ +/* rte: rte. */ + CIA SEM_FN_NAME (m32r,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1928,16 +2154,18 @@ SEM_FN_NAME (m32r,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg) do { CPU (h_sm) = CPU (h_bsm); - TRACE_RESULT (current_cpu, "h-sm-0", 'x', CPU (h_sm)); + TRACE_RESULT (current_cpu, "sm-0", 'x', CPU (h_sm)); CPU (h_ie) = CPU (h_bie); - TRACE_RESULT (current_cpu, "h-ie-0", 'x', CPU (h_ie)); + TRACE_RESULT (current_cpu, "ie-0", 'x', CPU (h_ie)); CPU (h_cond) = CPU (h_bcond); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (CPU (h_bpc), -4))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1949,7 +2177,8 @@ do { #undef FLD } -/* Perform seth: seth $dr,$hash$hi16. */ +/* seth: seth $dr,$hash$hi16. */ + CIA SEM_FN_NAME (m32r,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1960,6 +2189,8 @@ SEM_FN_NAME (m32r,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SLLSI (FLD (f_hi16), 16); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1972,7 +2203,8 @@ SEM_FN_NAME (m32r,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform sll: sll $dr,$sr. */ +/* sll: sll $dr,$sr. */ + CIA SEM_FN_NAME (m32r,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -1983,6 +2215,8 @@ SEM_FN_NAME (m32r,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SLLSI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -1996,7 +2230,8 @@ SEM_FN_NAME (m32r,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform sll3: sll3 $dr,$sr,$simm16. */ +/* sll3: sll3 $dr,$sr,$simm16. */ + CIA SEM_FN_NAME (m32r,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2007,6 +2242,8 @@ SEM_FN_NAME (m32r,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SLLSI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2020,7 +2257,8 @@ SEM_FN_NAME (m32r,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform slli: slli $dr,$uimm5. */ +/* slli: slli $dr,$uimm5. */ + CIA SEM_FN_NAME (m32r,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2031,6 +2269,8 @@ SEM_FN_NAME (m32r,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SLLSI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2044,7 +2284,8 @@ SEM_FN_NAME (m32r,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform sra: sra $dr,$sr. */ +/* sra: sra $dr,$sr. */ + CIA SEM_FN_NAME (m32r,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2055,6 +2296,8 @@ SEM_FN_NAME (m32r,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SRASI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2068,7 +2311,8 @@ SEM_FN_NAME (m32r,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform sra3: sra3 $dr,$sr,$simm16. */ +/* sra3: sra3 $dr,$sr,$simm16. */ + CIA SEM_FN_NAME (m32r,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2079,6 +2323,8 @@ SEM_FN_NAME (m32r,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SRASI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2092,7 +2338,8 @@ SEM_FN_NAME (m32r,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform srai: srai $dr,$uimm5. */ +/* srai: srai $dr,$uimm5. */ + CIA SEM_FN_NAME (m32r,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2103,6 +2350,8 @@ SEM_FN_NAME (m32r,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SRASI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2116,7 +2365,8 @@ SEM_FN_NAME (m32r,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform srl: srl $dr,$sr. */ +/* srl: srl $dr,$sr. */ + CIA SEM_FN_NAME (m32r,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2127,6 +2377,8 @@ SEM_FN_NAME (m32r,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SRLSI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2140,7 +2392,8 @@ SEM_FN_NAME (m32r,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform srl3: srl3 $dr,$sr,$simm16. */ +/* srl3: srl3 $dr,$sr,$simm16. */ + CIA SEM_FN_NAME (m32r,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2151,6 +2404,8 @@ SEM_FN_NAME (m32r,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SRLSI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2164,7 +2419,8 @@ SEM_FN_NAME (m32r,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform srli: srli $dr,$uimm5. */ +/* srli: srli $dr,$uimm5. */ + CIA SEM_FN_NAME (m32r,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2175,6 +2431,8 @@ SEM_FN_NAME (m32r,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SRLSI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2188,7 +2446,8 @@ SEM_FN_NAME (m32r,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform st: st $src1,@$src2. */ +/* st: st $src1,@$src2. */ + CIA SEM_FN_NAME (m32r,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2197,7 +2456,9 @@ SEM_FN_NAME (m32r,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CIA new_pc = SEM_NEXT_PC (sem_arg, 2); SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -2211,7 +2472,8 @@ SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); #undef FLD } -/* Perform st-d: st $src1,@($slo16,$src2). */ +/* st-d: st $src1,@($slo16,$src2). */ + CIA SEM_FN_NAME (m32r,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2220,7 +2482,9 @@ SEM_FN_NAME (m32r,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CIA new_pc = SEM_NEXT_PC (sem_arg, 4); SETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -2234,7 +2498,8 @@ SETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); #undef FLD } -/* Perform stb: stb $src1,@$src2. */ +/* stb: stb $src1,@$src2. */ + CIA SEM_FN_NAME (m32r,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2243,7 +2508,9 @@ SEM_FN_NAME (m32r,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CIA new_pc = SEM_NEXT_PC (sem_arg, 2); SETMEMQI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMQI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, * FLD (f_r2))); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -2257,7 +2524,8 @@ SETMEMQI (current_cpu, * FLD (f_r2), * FLD (f_r1)); #undef FLD } -/* Perform stb-d: stb $src1,@($slo16,$src2). */ +/* stb-d: stb $src1,@($slo16,$src2). */ + CIA SEM_FN_NAME (m32r,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2266,7 +2534,9 @@ SEM_FN_NAME (m32r,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CIA new_pc = SEM_NEXT_PC (sem_arg, 4); SETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -2280,7 +2550,8 @@ SETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); #undef FLD } -/* Perform sth: sth $src1,@$src2. */ +/* sth: sth $src1,@$src2. */ + CIA SEM_FN_NAME (m32r,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2289,7 +2560,9 @@ SEM_FN_NAME (m32r,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CIA new_pc = SEM_NEXT_PC (sem_arg, 2); SETMEMHI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMHI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, * FLD (f_r2))); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -2303,7 +2576,8 @@ SETMEMHI (current_cpu, * FLD (f_r2), * FLD (f_r1)); #undef FLD } -/* Perform sth-d: sth $src1,@($slo16,$src2). */ +/* sth-d: sth $src1,@($slo16,$src2). */ + CIA SEM_FN_NAME (m32r,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2312,7 +2586,9 @@ SEM_FN_NAME (m32r,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) CIA new_pc = SEM_NEXT_PC (sem_arg, 4); SETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); + + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) @@ -2326,7 +2602,8 @@ SETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); #undef FLD } -/* Perform st-plus: st $src1,@+$src2. */ +/* st-plus: st $src1,@+$src2. */ + CIA SEM_FN_NAME (m32r,st_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2338,11 +2615,13 @@ do { SI tmp_new_src2; tmp_new_src2 = ADDSI (* FLD (f_r2), 4); SETMEMSI (current_cpu, tmp_new_src2, * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-new-src2", 'x', GETMEMSI (current_cpu, tmp_new_src2)); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2)); * FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2356,7 +2635,8 @@ SETMEMSI (current_cpu, tmp_new_src2, * FLD (f_r1)); #undef FLD } -/* Perform st-minus: st $src1,@-$src2. */ +/* st-minus: st $src1,@-$src2. */ + CIA SEM_FN_NAME (m32r,st_minus) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2368,11 +2648,13 @@ do { SI tmp_new_src2; tmp_new_src2 = SUBSI (* FLD (f_r2), 4); SETMEMSI (current_cpu, tmp_new_src2, * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-new-src2", 'x', GETMEMSI (current_cpu, tmp_new_src2)); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2)); * FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2386,7 +2668,8 @@ SETMEMSI (current_cpu, tmp_new_src2, * FLD (f_r1)); #undef FLD } -/* Perform sub: sub $dr,$sr. */ +/* sub: sub $dr,$sr. */ + CIA SEM_FN_NAME (m32r,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2397,6 +2680,8 @@ SEM_FN_NAME (m32r,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) * FLD (f_r1) = SUBSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2410,7 +2695,8 @@ SEM_FN_NAME (m32r,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) #undef FLD } -/* Perform subv: subv $dr,$sr. */ +/* subv: subv $dr,$sr. */ + CIA SEM_FN_NAME (m32r,subv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2428,6 +2714,8 @@ do { TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2441,7 +2729,8 @@ do { #undef FLD } -/* Perform subx: subx $dr,$sr. */ +/* subx: subx $dr,$sr. */ + CIA SEM_FN_NAME (m32r,subx) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2459,6 +2748,8 @@ do { TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2472,7 +2763,8 @@ do { #undef FLD } -/* Perform trap: trap $uimm4. */ +/* trap: trap $uimm4. */ + CIA SEM_FN_NAME (m32r,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2483,14 +2775,16 @@ SEM_FN_NAME (m32r,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg) do { m32r_h_cr_set (current_cpu, 6, ADDSI (CPU (h_pc), 4)); - TRACE_RESULT (current_cpu, "h-cr-6", 'x', m32r_h_cr_get (current_cpu, 6)); + TRACE_RESULT (current_cpu, "cr-6", 'x', m32r_h_cr_get (current_cpu, 6)); m32r_h_cr_set (current_cpu, 0, ANDSI (SLLSI (m32r_h_cr_get (current_cpu, 0), 8), 65408)); - TRACE_RESULT (current_cpu, "h-cr-0", 'x', m32r_h_cr_get (current_cpu, 0)); + TRACE_RESULT (current_cpu, "cr-0", 'x', m32r_h_cr_get (current_cpu, 0)); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, do_trap (current_cpu, FLD (f_uimm4)))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2502,7 +2796,8 @@ m32r_h_cr_set (current_cpu, 0, ANDSI (SLLSI (m32r_h_cr_get (current_cpu, 0), 8), #undef FLD } -/* Perform unlock: unlock $src1,@$src2. */ +/* unlock: unlock $src1,@$src2. */ + CIA SEM_FN_NAME (m32r,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { @@ -2513,12 +2808,14 @@ SEM_FN_NAME (m32r,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg) do { if (CPU (h_lock)) { SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); } CPU (h_lock) = 0; - TRACE_RESULT (current_cpu, "h-lock-0", 'x', CPU (h_lock)); + TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock)); } while (0); + PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); + #if WITH_PROFILE_MODEL_P if (PROFILE_MODEL_P (current_cpu)) { @@ -2538,4 +2835,4 @@ SEM_FN_NAME (m32r,illegal) (SIM_CPU *current_cpu, SEM_ARG sem_arg) return 0; } -#endif /* ! defined (SCACHE_P) || (defined (SCACHE_P) && WITH_SCACHE) */ +#endif /* WITH_SCACHE */ diff --git a/sim/m32r/semx.c b/sim/m32r/semx.c index 6d8626b..941937c 100644 --- a/sim/m32r/semx.c +++ b/sim/m32r/semx.c @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "cgen-ops.h" #include "cpu-sim.h" -#if ! defined (SCACHE_P) || (defined (SCACHE_P) && WITH_SCACHE) +#if ! WITH_SCACHE #undef GET_ATTR #define GET_ATTR(cpu, num, attr) CGEN_INSN_ATTR (abuf->idesc->opcode, CGEN_INSN_##attr) @@ -432,7 +432,7 @@ SEM_FN_NAME (m32rx,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe if (OPRND (condbit)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -464,7 +464,7 @@ SEM_FN_NAME (m32rx,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (OPRND (condbit)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -496,7 +496,7 @@ SEM_FN_NAME (m32rx,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe if (EQSI (OPRND (src1), OPRND (src2))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -529,7 +529,7 @@ SEM_FN_NAME (m32rx,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (EQSI (OPRND (src2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -562,7 +562,7 @@ SEM_FN_NAME (m32rx,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (GESI (OPRND (src2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -595,7 +595,7 @@ SEM_FN_NAME (m32rx,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (GTSI (OPRND (src2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -628,7 +628,7 @@ SEM_FN_NAME (m32rx,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (LESI (OPRND (src2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -661,7 +661,7 @@ SEM_FN_NAME (m32rx,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (LTSI (OPRND (src2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -694,7 +694,7 @@ SEM_FN_NAME (m32rx,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (NESI (OPRND (src2), 0)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -726,10 +726,10 @@ SEM_FN_NAME (m32rx,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe do { CPU (h_gr[14]) = ADDSI (ANDSI (OPRND (pc), -4), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -761,10 +761,10 @@ SEM_FN_NAME (m32rx,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex do { CPU (h_gr[14]) = ADDSI (OPRND (pc), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -797,10 +797,10 @@ SEM_FN_NAME (m32rx,bcl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (OPRND (condbit)) { do { CPU (h_gr[14]) = ADDSI (ANDSI (OPRND (pc), -4), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); } @@ -834,10 +834,10 @@ SEM_FN_NAME (m32rx,bcl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e if (OPRND (condbit)) { do { CPU (h_gr[14]) = ADDSI (OPRND (pc), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); } @@ -871,7 +871,7 @@ SEM_FN_NAME (m32rx,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex if (NOTBI (OPRND (condbit))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -903,7 +903,7 @@ SEM_FN_NAME (m32rx,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e if (NOTBI (OPRND (condbit))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -935,7 +935,7 @@ SEM_FN_NAME (m32rx,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe if (NESI (OPRND (src1), OPRND (src2))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -967,7 +967,7 @@ SEM_FN_NAME (m32rx,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -997,7 +997,7 @@ SEM_FN_NAME (m32rx,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -1028,10 +1028,10 @@ SEM_FN_NAME (m32rx,bncl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e if (NOTBI (OPRND (condbit))) { do { CPU (h_gr[14]) = ADDSI (ANDSI (OPRND (pc), -4), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); } @@ -1065,10 +1065,10 @@ SEM_FN_NAME (m32rx,bncl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ if (NOTBI (OPRND (condbit))) { do { CPU (h_gr[14]) = ADDSI (OPRND (pc), 4); - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); } @@ -1436,7 +1436,7 @@ SEM_FN_NAME (m32rx,jc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec if (OPRND (condbit)) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -1469,7 +1469,7 @@ SEM_FN_NAME (m32rx,jnc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe if (NOTBI (OPRND (condbit))) { BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -1504,10 +1504,10 @@ do { temp0 = ADDSI (ANDSI (OPRND (pc), -4), 4); temp1 = OPRND (sr); CPU (h_gr[14]) = temp0; - TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); + TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14])); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -1540,7 +1540,7 @@ SEM_FN_NAME (m32rx,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, OPRND (sr))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -1994,7 +1994,7 @@ SEM_FN_NAME (m32rx,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex do { CPU (h_lock) = 1; - TRACE_RESULT (current_cpu, "h-lock-0", 'x', CPU (h_lock)); + TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock)); CPU (h_gr[f_r1]) = OPRND (h_memory_sr); TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1])); } while (0); @@ -2677,14 +2677,14 @@ SEM_FN_NAME (m32rx,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe do { CPU (h_sm) = OPRND (h_bsm_0); - TRACE_RESULT (current_cpu, "h-sm-0", 'x', CPU (h_sm)); + TRACE_RESULT (current_cpu, "sm-0", 'x', CPU (h_sm)); CPU (h_ie) = OPRND (h_bie_0); - TRACE_RESULT (current_cpu, "h-ie-0", 'x', CPU (h_ie)); + TRACE_RESULT (current_cpu, "ie-0", 'x', CPU (h_ie)); CPU (h_cond) = OPRND (h_bcond_0); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (h_bpc_0), -4))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3012,7 +3012,7 @@ SEM_FN_NAME (m32rx,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec EXTRACT_FMT_ST_CODE SETMEMSI (current_cpu, OPRND (src2), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, OPRND (src2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, OPRND (src2))); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3041,7 +3041,7 @@ SEM_FN_NAME (m32rx,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex EXTRACT_FMT_ST_D_CODE SETMEMSI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMSI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)))); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3070,7 +3070,7 @@ SEM_FN_NAME (m32rx,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe EXTRACT_FMT_STB_CODE SETMEMQI (current_cpu, OPRND (src2), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMQI (current_cpu, OPRND (src2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, OPRND (src2))); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3099,7 +3099,7 @@ SEM_FN_NAME (m32rx,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e EXTRACT_FMT_STB_D_CODE SETMEMQI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMQI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)))); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3128,7 +3128,7 @@ SEM_FN_NAME (m32rx,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe EXTRACT_FMT_STH_CODE SETMEMHI (current_cpu, OPRND (src2), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMHI (current_cpu, OPRND (src2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, OPRND (src2))); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3157,7 +3157,7 @@ SEM_FN_NAME (m32rx,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e EXTRACT_FMT_STH_D_CODE SETMEMHI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-add-WI-src2-slo16", 'x', GETMEMHI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)))); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3189,7 +3189,7 @@ do { SI tmp_new_src2; tmp_new_src2 = ADDSI (OPRND (src2), 4); SETMEMSI (current_cpu, tmp_new_src2, OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-new-src2", 'x', GETMEMSI (current_cpu, tmp_new_src2)); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2)); CPU (h_gr[f_r2]) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', CPU (h_gr[f_r2])); } while (0); @@ -3225,7 +3225,7 @@ do { SI tmp_new_src2; tmp_new_src2 = SUBSI (OPRND (src2), 4); SETMEMSI (current_cpu, tmp_new_src2, OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-new-src2", 'x', GETMEMSI (current_cpu, tmp_new_src2)); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2)); CPU (h_gr[f_r2]) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', CPU (h_gr[f_r2])); } while (0); @@ -3364,12 +3364,12 @@ SEM_FN_NAME (m32rx,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex do { m32rx_h_cr_set (current_cpu, 6, ADDSI (OPRND (pc), 4)); - TRACE_RESULT (current_cpu, "h-cr-6", 'x', m32rx_h_cr_get (current_cpu, 6)); + TRACE_RESULT (current_cpu, "cr-6", 'x', m32rx_h_cr_get (current_cpu, 6)); m32rx_h_cr_set (current_cpu, 0, ANDSI (SLLSI (OPRND (h_cr_0), 8), 65408)); - TRACE_RESULT (current_cpu, "h-cr-0", 'x', m32rx_h_cr_get (current_cpu, 0)); + TRACE_RESULT (current_cpu, "cr-0", 'x', m32rx_h_cr_get (current_cpu, 0)); BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, do_trap (current_cpu, OPRND (uimm4)))); taken_p = 1; - TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); + TRACE_RESULT (current_cpu, "pc", 'x', new_pc); } while (0); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3400,10 +3400,10 @@ SEM_FN_NAME (m32rx,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ do { if (OPRND (h_lock_0)) { SETMEMSI (current_cpu, OPRND (src2), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, OPRND (src2))); + TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, OPRND (src2))); } CPU (h_lock) = 0; - TRACE_RESULT (current_cpu, "h-lock-0", 'x', CPU (h_lock)); + TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock)); } while (0); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3552,7 +3552,7 @@ SEM_FN_NAME (m32rx,sadd) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex EXTRACT_FMT_SADD_CODE m32rx_h_accums_set (current_cpu, 0, ADDDI (SRADI (OPRND (h_accums_1), 16), OPRND (h_accums_0))); - TRACE_RESULT (current_cpu, "h-accums-0", 'D', m32rx_h_accums_get (current_cpu, 0)); + TRACE_RESULT (current_cpu, "accums-0", 'D', m32rx_h_accums_get (current_cpu, 0)); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3580,7 +3580,7 @@ SEM_FN_NAME (m32rx,macwu1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ EXTRACT_FMT_MACWU1_CODE m32rx_h_accums_set (current_cpu, 1, SRADI (SLLDI (ADDDI (OPRND (h_accums_1), MULDI (EXTSIDI (OPRND (src1)), EXTSIDI (ANDSI (OPRND (src2), 65535)))), 8), 8)); - TRACE_RESULT (current_cpu, "h-accums-1", 'D', m32rx_h_accums_get (current_cpu, 1)); + TRACE_RESULT (current_cpu, "accums-1", 'D', m32rx_h_accums_get (current_cpu, 1)); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3638,7 +3638,7 @@ SEM_FN_NAME (m32rx,mulwu1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ EXTRACT_FMT_MULWU1_CODE m32rx_h_accums_set (current_cpu, 1, SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTSIDI (ANDSI (OPRND (src2), 65535))), 16), 16)); - TRACE_RESULT (current_cpu, "h-accums-1", 'D', m32rx_h_accums_get (current_cpu, 1)); + TRACE_RESULT (current_cpu, "accums-1", 'D', m32rx_h_accums_get (current_cpu, 1)); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3667,7 +3667,7 @@ SEM_FN_NAME (m32rx,maclh1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ EXTRACT_FMT_MACWU1_CODE m32rx_h_accums_set (current_cpu, 1, SRADI (SLLDI (ADDDI (OPRND (h_accums_1), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (OPRND (src1))), SRASI (OPRND (src2), 16))), 16)), 8), 8)); - TRACE_RESULT (current_cpu, "h-accums-1", 'D', m32rx_h_accums_get (current_cpu, 1)); + TRACE_RESULT (current_cpu, "accums-1", 'D', m32rx_h_accums_get (current_cpu, 1)); PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num); @@ -3748,4 +3748,4 @@ SEM_FN_NAME (m32rx,illegal) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par return 0; } -#endif /* ! defined (SCACHE_P) || (defined (SCACHE_P) && WITH_SCACHE) */ +#endif /* WITH_SCACHE */ |