From: Doug Evans Date: Mon, 23 Feb 1998 21:36:15 +0000 (+0000) Subject: * sim-main.h: #include symcat.h. X-Git-Tag: gdb-4_18~3206 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02310b01ca7f89c761ede50557c4ac3db9bebffb;p=platform%2Fupstream%2Fbinutils.git * sim-main.h: #include symcat.h. * m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg. (NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros. * cpu.[ch],decode.[ch],extract.c,model.c: Regenerate. * sem.c,sem-switch.c: Regenerate. * m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec. * mloopx.in: Rewrite. * cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate. --- diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index 2745a04..ffb51c6 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,16 @@ +Mon Feb 23 13:30:46 1998 Doug Evans + + * sim-main.h: #include symcat.h. + * m32r-sim.h (BRANCH_NEW_PC): Delete current_cpu arg. + (NEW_PC_{BASE,SKIP,2,4,BRANCH_P}): New macros. + * cpu.[ch],decode.[ch],extract.c,model.c: Regenerate. + * sem.c,sem-switch.c: Regenerate. +start-sanitize-m32rx + * m32r-sim.h (SEM_NEXT_PC): Modify to handle parallel exec. + * mloopx.in: Rewrite. + * cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate. +end-sanitize-m32rx + Mon Feb 23 12:27:52 1998 Nick Clifton * m32r.c (m32r_h_cr_set, m32r_h_cr_get): Shadow control register 6 @@ -6,6 +19,7 @@ start-sanitize-m32rx * m32rx.c (m32r_h_cr_set, m32r_h_cr_get): Shadow control register 6 in the backup PC register. end-sanitize-m32rx + Thu Feb 19 16:39:35 1998 Doug Evans * m32r.c (do_lock,do_unlock): Delete. diff --git a/sim/m32r/cpux.h b/sim/m32r/cpux.h index 366eec5..8be022e 100644 --- a/sim/m32r/cpux.h +++ b/sim/m32r/cpux.h @@ -1509,34 +1509,34 @@ struct parexec { SI sr; } fmt_25_jmp; struct { /* e.g. ld $dr,@$sr */ - UQI h_memory_sr; + SI h_memory_sr; SI sr; } fmt_26_ld; struct { /* e.g. ld $dr,@($slo16,$sr) */ - UQI h_memory_add_WI_sr_slo16; + SI h_memory_add_WI_sr_slo16; HI slo16; SI sr; } fmt_27_ld_d; struct { /* e.g. ldb $dr,@$sr */ - UQI h_memory_sr; + QI h_memory_sr; SI sr; } fmt_28_ldb; struct { /* e.g. ldb $dr,@($slo16,$sr) */ - UQI h_memory_add_WI_sr_slo16; + QI h_memory_add_WI_sr_slo16; HI slo16; SI sr; } fmt_29_ldb_d; struct { /* e.g. ldh $dr,@$sr */ - UQI h_memory_sr; + HI h_memory_sr; SI sr; } fmt_30_ldh; struct { /* e.g. ldh $dr,@($slo16,$sr) */ - UQI h_memory_add_WI_sr_slo16; + HI h_memory_add_WI_sr_slo16; HI slo16; SI sr; } fmt_31_ldh_d; struct { /* e.g. ld $dr,@$sr+ */ - UQI h_memory_sr; + SI h_memory_sr; SI sr; } fmt_32_ld_plus; struct { /* e.g. ld24 $dr,#$uimm24 */ @@ -1549,7 +1549,7 @@ struct parexec { HI slo16; } fmt_35_ldi16; struct { /* e.g. lock $dr,@$sr */ - UQI h_memory_sr; + SI h_memory_sr; SI sr; } fmt_36_lock; struct { /* e.g. machi $src1,$src2,$acc */ @@ -1634,7 +1634,7 @@ struct parexec { } fmt_56_st_plus; struct { /* e.g. trap #$uimm4 */ USI pc; - USI h_cr_0; + SI h_cr_0; USI uimm4; } fmt_57_trap; struct { /* e.g. unlock $src1,@$src2 */ diff --git a/sim/m32r/decodex.c b/sim/m32r/decodex.c index 3883b28..75280a9 100644 --- a/sim/m32r/decodex.c +++ b/sim/m32r/decodex.c @@ -26,7 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define WANT_CPU_M32RX #include "sim-main.h" -#include "sim-xcat.h" #include "cpu-sim.h" #include "cpu-opc.h" @@ -35,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., around while the cache version is being developed. It may still be useful to allow two versions to exist though. */ #if WITH_SCACHE -#define EX(fn) XCONCAT3 (m32rx,_ex_,fn) +#define EX(fn) CONCAT3 (m32rx,_ex_,fn) #else #define EX(fn) 0 #endif @@ -44,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifdef __GNUC__ #define READ(n) 0 #else -#define READ(n) XCONCAT3 (READ,_,n) +#define READ(n) CONCAT3 (READ,_,n) #endif #endif @@ -53,14 +52,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #if WITH_SEM_SWITCH_FULL #define FULL(fn) 0 #else -#define FULL(fn) XCONCAT3 (m32rx,_sem_,fn) +#define FULL(fn) CONCAT3 (m32rx,_sem_,fn) #endif #if WITH_FAST #if WITH_SEM_SWITCH_FAST #define FAST(fn) 0 #else -#define FAST(fn) XCONCAT3 (m32rx,_semf_,fn) /* f for fast */ +#define FAST(fn) CONCAT3 (m32rx,_semf_,fn) /* f for fast */ #endif #else #define FAST(fn) 0 diff --git a/sim/m32r/decodex.h b/sim/m32r/decodex.h index af271df..e8afc96 100644 --- a/sim/m32r/decodex.h +++ b/sim/m32r/decodex.h @@ -25,9 +25,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef M32RX_DECODE_H #define M32RX_DECODE_H -#define EX(fn) XCONCAT3 (m32rx,_ex_,fn) -#define SEM(fn) XCONCAT3 (m32rx,_sem_,fn) -#define SEMF(fn) XCONCAT3 (m32rx,_semf_,fn) +#define EX(fn) CONCAT3 (m32rx,_ex_,fn) +#define SEM(fn) CONCAT3 (m32rx,_sem_,fn) +#define SEMF(fn) CONCAT3 (m32rx,_semf_,fn) extern EXTRACT_FN EX (illegal); extern SEMANTIC_FN SEM (illegal); diff --git a/sim/m32r/mloopx.in b/sim/m32r/mloopx.in index 533aca5..fca05cd 100644 --- a/sim/m32r/mloopx.in +++ b/sim/m32r/mloopx.in @@ -36,12 +36,9 @@ EOF xinit) cat <> 16); + d1 = m32rx_decode (current_cpu, pc, insn >> 16); + abufs[0].insn = insn; icount = 1; } else { if (insn & 0x8000) { - insn2 = insn1 & 0x7fff; - insn1 = insn1 >> 16; - d1 = m32rx_decode (current_cpu, pc, insn1); - d2 = m32rx_decode (current_cpu, pc, insn2); + d1 = m32rx_decode (current_cpu, pc, insn >> 16); + abufs[0].insn = insn >> 16; + d2 = m32rx_decode (current_cpu, pc, insn & 0x7fff); + abufs[1].insn = insn & 0x7fff; icount = 2; } else { - insn1 = insn1 >> 16; - d1 = m32rx_decode (current_cpu, pc, insn1); + d1 = m32rx_decode (current_cpu, pc, insn >> 16); + abufs[0].insn = insn >> 16; icount = 1; } } } - icount2 = icount; - insn = insn1; - decode = d1; - do - { + { + int icount2 = icount; + USI insn = abufs[0].insn; + DECODE *decode = d1; + /* decode, par_exec, and insn are refered to by readx.c. */ + PAREXEC *par_exec = &pbufs[0]; + do + { #define DEFINE_SWITCH #include "readx.c" - insn = insn2; - decode = d2; - } - while (--icount2 > 0); + decode = d2; + insn = abufs[1].insn; + ++par_exec; + } + while (--icount2 != 0); + } } EOF @@ -107,19 +113,62 @@ xfull-exec-* | xfast-exec-*) cat <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)); + + /* The result of the semantic fn is one of: + - next address, branch only + - NEW_PC_SKIP, sc/snc insn + - NEW_PC_2, 2 byte non-branch non-sc/snc insn + - NEW_PC_4, 4 byte non-branch insn + */ + + if (new_pc == NEW_PC_4) + CPU (h_pc) += 4; + else if (NEW_PC_BRANCH_P (new_pc)) + CPU (h_pc) = new_pc; + else { - PCADDR new_pc; - TRACE_INSN_INIT (current_cpu); - TRACE_INSN (current_cpu, sc->argbuf.opcode, (const struct argbuf *) &sc->argbuf, sc->argbuf.addr); - new_pc = (*decode->semantic) (current_cpu, &sc->argbuf); - TRACE_INSN_FINI (current_cpu); - PROFILE_COUNT_INSN (current_cpu, pc, CGEN_INSN_INDEX (sc->argbuf.opcode)); - CPU (h_pc) = new_pc; - decode = d2; + PCADDR pc = CPU (h_pc); + + CPU (h_pc) = pc + 2; + if (icount == 2) + { + /* 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);*/ + } + 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; + } } - while (--icount > 0); } EOF diff --git a/sim/m32r/sem-switch.c b/sim/m32r/sem-switch.c index 1b338f9..d0ec7db 100644 --- a/sim/m32r/sem-switch.c +++ b/sim/m32r/sem-switch.c @@ -176,7 +176,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_ADD) : /* add $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ADDSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -188,7 +188,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_ADD3) : /* add3 $dr,$sr,#$slo16 */ { #define FLD(f) abuf->fields.fmt_1_add3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ADDSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -200,7 +200,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_AND) : /* and $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ANDSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -212,7 +212,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_AND3) : /* and3 $dr,$sr,#$uimm16 */ { #define FLD(f) abuf->fields.fmt_2_and3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ANDSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -224,7 +224,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_OR) : /* or $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ORSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -236,7 +236,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_OR3) : /* or3 $dr,$sr,#$ulo16 */ { #define FLD(f) abuf->fields.fmt_3_or3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ORSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -248,7 +248,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_XOR) : /* xor $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = XORSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -260,7 +260,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_XOR3) : /* xor3 $dr,$sr,#$uimm16 */ { #define FLD(f) abuf->fields.fmt_2_and3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = XORSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -272,7 +272,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_ADDI) : /* addi $dr,#$simm8 */ { #define FLD(f) abuf->fields.fmt_4_addi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ADDSI (* FLD (f_r1), FLD (f_simm8)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -284,7 +284,7 @@ with this program; if not, write to the Free Software Foundation, Inc., CASE (sem, INSN_ADDV) : /* addv $dr,$sr */ { #define FLD(f) abuf->fields.fmt_5_addv.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -303,7 +303,7 @@ do { CASE (sem, INSN_ADDV3) : /* addv3 $dr,$sr,#$simm16 */ { #define FLD(f) abuf->fields.fmt_6_addv3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); do { BI temp1;SI temp0; @@ -322,7 +322,7 @@ do { CASE (sem, INSN_ADDX) : /* addx $dr,$sr */ { #define FLD(f) abuf->fields.fmt_7_addx.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -341,10 +341,10 @@ do { CASE (sem, INSN_BC8) : /* bc $disp8 */ { #define FLD(f) abuf->fields.fmt_8_bc8.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); if (CPU (h_cond)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -355,10 +355,10 @@ if (CPU (h_cond)) { CASE (sem, INSN_BC24) : /* bc $disp24 */ { #define FLD(f) abuf->fields.fmt_9_bc24.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (CPU (h_cond)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -369,10 +369,10 @@ if (CPU (h_cond)) { CASE (sem, INSN_BEQ) : /* beq $src1,$src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_10_beq.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (EQSI (* FLD (f_r1), * FLD (f_r2))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -383,10 +383,10 @@ if (EQSI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_BEQZ) : /* beqz $src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_11_beqz.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (EQSI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -397,10 +397,10 @@ if (EQSI (* FLD (f_r2), 0)) { CASE (sem, INSN_BGEZ) : /* bgez $src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_11_beqz.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (GESI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -411,10 +411,10 @@ if (GESI (* FLD (f_r2), 0)) { CASE (sem, INSN_BGTZ) : /* bgtz $src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_11_beqz.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (GTSI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -425,10 +425,10 @@ if (GTSI (* FLD (f_r2), 0)) { CASE (sem, INSN_BLEZ) : /* blez $src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_11_beqz.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (LESI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -439,10 +439,10 @@ if (LESI (* FLD (f_r2), 0)) { CASE (sem, INSN_BLTZ) : /* bltz $src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_11_beqz.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (LTSI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -453,10 +453,10 @@ if (LTSI (* FLD (f_r2), 0)) { CASE (sem, INSN_BNEZ) : /* bnez $src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_11_beqz.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -467,12 +467,12 @@ if (NESI (* FLD (f_r2), 0)) { CASE (sem, INSN_BL8) : /* bl $disp8 */ { #define FLD(f) abuf->fields.fmt_12_bl8.f - new_pc = SEM_NEXT_PC (sem_arg); + 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -483,12 +483,12 @@ do { CASE (sem, INSN_BL24) : /* bl $disp24 */ { #define FLD(f) abuf->fields.fmt_13_bl24.f - new_pc = SEM_NEXT_PC (sem_arg); + 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -499,10 +499,10 @@ do { CASE (sem, INSN_BNC8) : /* bnc $disp8 */ { #define FLD(f) abuf->fields.fmt_8_bc8.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); if (NOTBI (CPU (h_cond))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -513,10 +513,10 @@ if (NOTBI (CPU (h_cond))) { CASE (sem, INSN_BNC24) : /* bnc $disp24 */ { #define FLD(f) abuf->fields.fmt_9_bc24.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NOTBI (CPU (h_cond))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -527,10 +527,10 @@ if (NOTBI (CPU (h_cond))) { CASE (sem, INSN_BNE) : /* bne $src1,$src2,$disp16 */ { #define FLD(f) abuf->fields.fmt_10_beq.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r1), * FLD (f_r2))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -541,9 +541,9 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_BRA8) : /* bra $disp8 */ { #define FLD(f) abuf->fields.fmt_14_bra8.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); #undef FLD @@ -553,9 +553,9 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_BRA24) : /* bra $disp24 */ { #define FLD(f) abuf->fields.fmt_15_bra24.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); #undef FLD @@ -565,7 +565,7 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_CMP) : /* cmp $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_16_cmp.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_cond) = LTSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -577,7 +577,7 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_CMPI) : /* cmpi $src2,#$simm16 */ { #define FLD(f) abuf->fields.fmt_17_cmpi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); CPU (h_cond) = LTSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -589,7 +589,7 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_CMPU) : /* cmpu $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_16_cmp.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_cond) = LTUSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -601,7 +601,7 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_CMPUI) : /* cmpui $src2,#$uimm16 */ { #define FLD(f) abuf->fields.fmt_18_cmpui.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); CPU (h_cond) = LTUSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -613,7 +613,7 @@ if (NESI (* FLD (f_r1), * FLD (f_r2))) { CASE (sem, INSN_DIV) : /* div $dr,$sr */ { #define FLD(f) abuf->fields.fmt_19_div.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = DIVSI (* FLD (f_r1), * FLD (f_r2)); @@ -627,7 +627,7 @@ if (NESI (* FLD (f_r2), 0)) { CASE (sem, INSN_DIVU) : /* divu $dr,$sr */ { #define FLD(f) abuf->fields.fmt_19_div.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = UDIVSI (* FLD (f_r1), * FLD (f_r2)); @@ -641,7 +641,7 @@ if (NESI (* FLD (f_r2), 0)) { CASE (sem, INSN_REM) : /* rem $dr,$sr */ { #define FLD(f) abuf->fields.fmt_19_div.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = MODSI (* FLD (f_r1), * FLD (f_r2)); @@ -655,7 +655,7 @@ if (NESI (* FLD (f_r2), 0)) { CASE (sem, INSN_REMU) : /* remu $dr,$sr */ { #define FLD(f) abuf->fields.fmt_19_div.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = UMODSI (* FLD (f_r1), * FLD (f_r2)); @@ -669,7 +669,7 @@ if (NESI (* FLD (f_r2), 0)) { CASE (sem, INSN_JL) : /* jl $sr */ { #define FLD(f) abuf->fields.fmt_20_jl.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { SI temp1;SI temp0; @@ -677,7 +677,7 @@ do { temp1 = * FLD (f_r2); CPU (h_gr[14]) = temp0; TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -688,9 +688,9 @@ do { CASE (sem, INSN_JMP) : /* jmp $sr */ { #define FLD(f) abuf->fields.fmt_21_jmp.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, * FLD (f_r2))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, * FLD (f_r2))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); #undef FLD @@ -700,7 +700,7 @@ do { CASE (sem, INSN_LD) : /* ld $dr,@$sr */ { #define FLD(f) abuf->fields.fmt_22_ld.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = GETMEMSI (current_cpu, * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -712,7 +712,7 @@ do { CASE (sem, INSN_LD_D) : /* ld $dr,@($slo16,$sr) */ { #define FLD(f) abuf->fields.fmt_23_ld_d.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -724,7 +724,7 @@ do { CASE (sem, INSN_LDB) : /* ldb $dr,@$sr */ { #define FLD(f) abuf->fields.fmt_24_ldb.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = EXTQISI (GETMEMQI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -736,7 +736,7 @@ do { CASE (sem, INSN_LDB_D) : /* ldb $dr,@($slo16,$sr) */ { #define FLD(f) abuf->fields.fmt_25_ldb_d.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = EXTQISI (GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -748,7 +748,7 @@ do { CASE (sem, INSN_LDH) : /* ldh $dr,@$sr */ { #define FLD(f) abuf->fields.fmt_26_ldh.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = EXTHISI (GETMEMHI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -760,7 +760,7 @@ do { CASE (sem, INSN_LDH_D) : /* ldh $dr,@($slo16,$sr) */ { #define FLD(f) abuf->fields.fmt_27_ldh_d.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = EXTHISI (GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -772,7 +772,7 @@ do { CASE (sem, INSN_LDUB) : /* ldub $dr,@$sr */ { #define FLD(f) abuf->fields.fmt_24_ldb.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ZEXTQISI (GETMEMQI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -784,7 +784,7 @@ do { CASE (sem, INSN_LDUB_D) : /* ldub $dr,@($slo16,$sr) */ { #define FLD(f) abuf->fields.fmt_25_ldb_d.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ZEXTQISI (GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -796,7 +796,7 @@ do { CASE (sem, INSN_LDUH) : /* lduh $dr,@$sr */ { #define FLD(f) abuf->fields.fmt_26_ldh.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ZEXTHISI (GETMEMHI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -808,7 +808,7 @@ do { CASE (sem, INSN_LDUH_D) : /* lduh $dr,@($slo16,$sr) */ { #define FLD(f) abuf->fields.fmt_27_ldh_d.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ZEXTHISI (GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -820,7 +820,7 @@ do { CASE (sem, INSN_LD_PLUS) : /* ld $dr,@$sr+ */ { #define FLD(f) abuf->fields.fmt_28_ld_plus.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { SI temp1;SI temp0; @@ -839,7 +839,7 @@ do { CASE (sem, INSN_LD24) : /* ld24 $dr,#$uimm24 */ { #define FLD(f) abuf->fields.fmt_29_ld24.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = FLD (f_uimm24); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -851,7 +851,7 @@ do { CASE (sem, INSN_LDI8) : /* ldi $dr,#$simm8 */ { #define FLD(f) abuf->fields.fmt_30_ldi8.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = FLD (f_simm8); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -863,7 +863,7 @@ do { CASE (sem, INSN_LDI16) : /* ldi $dr,$slo16 */ { #define FLD(f) abuf->fields.fmt_31_ldi16.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = FLD (f_simm16); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -875,7 +875,7 @@ do { CASE (sem, INSN_LOCK) : /* lock $dr,@$sr */ { #define FLD(f) abuf->fields.fmt_32_lock.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { CPU (h_lock) = 1; @@ -891,7 +891,7 @@ do { CASE (sem, INSN_MACHI) : /* machi $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_33_machi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (ANDSI (* FLD (f_r1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -903,7 +903,7 @@ do { CASE (sem, INSN_MACLO) : /* maclo $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_33_machi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (SLLSI (* FLD (f_r1), 16)), EXTHIDI (TRUNCSIHI (* FLD (f_r2))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -915,7 +915,7 @@ do { CASE (sem, INSN_MACWHI) : /* macwhi $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_33_machi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -927,7 +927,7 @@ do { CASE (sem, INSN_MACWLO) : /* macwlo $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_33_machi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (* FLD (f_r2))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -939,7 +939,7 @@ do { CASE (sem, INSN_MUL) : /* mul $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = MULSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -951,7 +951,7 @@ do { CASE (sem, INSN_MULHI) : /* mulhi $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_34_mulhi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (f_r1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16)))), 16), 16); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -963,7 +963,7 @@ do { CASE (sem, INSN_MULLO) : /* mullo $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_34_mulhi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (f_r1), 16)), EXTHIDI (TRUNCSIHI (* FLD (f_r2)))), 16), 16); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -975,7 +975,7 @@ do { CASE (sem, INSN_MULWHI) : /* mulwhi $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_34_mulhi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16)))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -987,7 +987,7 @@ do { CASE (sem, INSN_MULWLO) : /* mulwlo $src1,$src2 */ { #define FLD(f) abuf->fields.fmt_34_mulhi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (* FLD (f_r2)))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -999,7 +999,7 @@ do { CASE (sem, INSN_MV) : /* mv $dr,$sr */ { #define FLD(f) abuf->fields.fmt_35_mv.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = * FLD (f_r2); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1011,7 +1011,7 @@ do { CASE (sem, INSN_MVFACHI) : /* mvfachi $dr */ { #define FLD(f) abuf->fields.fmt_36_mvfachi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = TRUNCDISI (SRADI (CPU (h_accum), 32)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1023,7 +1023,7 @@ do { CASE (sem, INSN_MVFACLO) : /* mvfaclo $dr */ { #define FLD(f) abuf->fields.fmt_36_mvfachi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = TRUNCDISI (CPU (h_accum)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1035,7 +1035,7 @@ do { CASE (sem, INSN_MVFACMI) : /* mvfacmi $dr */ { #define FLD(f) abuf->fields.fmt_36_mvfachi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = TRUNCDISI (SRADI (CPU (h_accum), 16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1047,7 +1047,7 @@ do { CASE (sem, INSN_MVFC) : /* mvfc $dr,$scr */ { #define FLD(f) abuf->fields.fmt_37_mvfc.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = m32r_h_cr_get (current_cpu, FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1059,7 +1059,7 @@ do { CASE (sem, INSN_MVTACHI) : /* mvtachi $src1 */ { #define FLD(f) abuf->fields.fmt_38_mvtachi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = ORDI (ANDDI (CPU (h_accum), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (f_r1)), 32)); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1071,7 +1071,7 @@ do { CASE (sem, INSN_MVTACLO) : /* mvtaclo $src1 */ { #define FLD(f) abuf->fields.fmt_38_mvtachi.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = ORDI (ANDDI (CPU (h_accum), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (f_r1))); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1083,7 +1083,7 @@ do { CASE (sem, INSN_MVTC) : /* mvtc $sr,$dcr */ { #define FLD(f) abuf->fields.fmt_39_mvtc.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); 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))); @@ -1095,7 +1095,7 @@ m32r_h_cr_set (current_cpu, FLD (f_r1), * FLD (f_r2)); CASE (sem, INSN_NEG) : /* neg $dr,$sr */ { #define FLD(f) abuf->fields.fmt_35_mv.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = NEGSI (* FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1107,7 +1107,7 @@ m32r_h_cr_set (current_cpu, FLD (f_r1), * FLD (f_r2)); CASE (sem, INSN_NOP) : /* nop */ { #define FLD(f) abuf->fields.fmt_40_nop.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr); @@ -1118,7 +1118,7 @@ PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr); CASE (sem, INSN_NOT) : /* not $dr,$sr */ { #define FLD(f) abuf->fields.fmt_35_mv.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = INVSI (* FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1130,7 +1130,7 @@ PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr); CASE (sem, INSN_RAC) : /* rac */ { #define FLD(f) abuf->fields.fmt_41_rac.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { DI tmp_tmp1; @@ -1147,7 +1147,7 @@ do { CASE (sem, INSN_RACH) : /* rach */ { #define FLD(f) abuf->fields.fmt_41_rac.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { DI tmp_tmp1; @@ -1173,7 +1173,7 @@ if (ANDIFSI (GEDI (tmp_tmp1, MAKEDI (8388608, 0)), LEDI (tmp_tmp1, MAKEDI (16760 CASE (sem, INSN_RTE) : /* rte */ { #define FLD(f) abuf->fields.fmt_42_rte.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { CPU (h_sm) = CPU (h_bsm); @@ -1182,7 +1182,7 @@ do { TRACE_RESULT (current_cpu, "h-ie-0", 'x', CPU (h_ie)); CPU (h_cond) = CPU (h_bcond); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, CPU (h_bpc))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, CPU (h_bpc))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -1193,7 +1193,7 @@ do { CASE (sem, INSN_SETH) : /* seth $dr,#$hi16 */ { #define FLD(f) abuf->fields.fmt_43_seth.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SLLSI (FLD (f_hi16), 16); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1205,7 +1205,7 @@ do { CASE (sem, INSN_SLL) : /* sll $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SLLSI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1217,7 +1217,7 @@ do { CASE (sem, INSN_SLL3) : /* sll3 $dr,$sr,#$simm16 */ { #define FLD(f) abuf->fields.fmt_44_sll3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SLLSI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1229,7 +1229,7 @@ do { CASE (sem, INSN_SLLI) : /* slli $dr,#$uimm5 */ { #define FLD(f) abuf->fields.fmt_45_slli.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SLLSI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1241,7 +1241,7 @@ do { CASE (sem, INSN_SRA) : /* sra $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRASI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1253,7 +1253,7 @@ do { CASE (sem, INSN_SRA3) : /* sra3 $dr,$sr,#$simm16 */ { #define FLD(f) abuf->fields.fmt_44_sll3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SRASI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1265,7 +1265,7 @@ do { CASE (sem, INSN_SRAI) : /* srai $dr,#$uimm5 */ { #define FLD(f) abuf->fields.fmt_45_slli.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRASI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1277,7 +1277,7 @@ do { CASE (sem, INSN_SRL) : /* srl $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRLSI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1289,7 +1289,7 @@ do { CASE (sem, INSN_SRL3) : /* srl3 $dr,$sr,#$simm16 */ { #define FLD(f) abuf->fields.fmt_44_sll3.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SRLSI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1301,7 +1301,7 @@ do { CASE (sem, INSN_SRLI) : /* srli $dr,#$uimm5 */ { #define FLD(f) abuf->fields.fmt_45_slli.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRLSI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1313,7 +1313,7 @@ do { CASE (sem, INSN_ST) : /* st $src1,@$src2 */ { #define FLD(f) abuf->fields.fmt_46_st.f - new_pc = SEM_NEXT_PC (sem_arg); + 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))); @@ -1325,7 +1325,7 @@ SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); CASE (sem, INSN_ST_D) : /* st $src1,@($slo16,$src2) */ { #define FLD(f) abuf->fields.fmt_47_st_d.f - new_pc = SEM_NEXT_PC (sem_arg); + 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)))); @@ -1337,7 +1337,7 @@ SETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); CASE (sem, INSN_STB) : /* stb $src1,@$src2 */ { #define FLD(f) abuf->fields.fmt_48_stb.f - new_pc = SEM_NEXT_PC (sem_arg); + 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))); @@ -1349,7 +1349,7 @@ SETMEMQI (current_cpu, * FLD (f_r2), * FLD (f_r1)); CASE (sem, INSN_STB_D) : /* stb $src1,@($slo16,$src2) */ { #define FLD(f) abuf->fields.fmt_49_stb_d.f - new_pc = SEM_NEXT_PC (sem_arg); + 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)))); @@ -1361,7 +1361,7 @@ SETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); CASE (sem, INSN_STH) : /* sth $src1,@$src2 */ { #define FLD(f) abuf->fields.fmt_50_sth.f - new_pc = SEM_NEXT_PC (sem_arg); + 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))); @@ -1373,7 +1373,7 @@ SETMEMHI (current_cpu, * FLD (f_r2), * FLD (f_r1)); CASE (sem, INSN_STH_D) : /* sth $src1,@($slo16,$src2) */ { #define FLD(f) abuf->fields.fmt_51_sth_d.f - new_pc = SEM_NEXT_PC (sem_arg); + 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)))); @@ -1385,13 +1385,15 @@ SETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)), * FLD (f_r1)); CASE (sem, INSN_ST_PLUS) : /* st $src1,@+$src2 */ { #define FLD(f) abuf->fields.fmt_52_st_plus.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { -* FLD (f_r2) = ADDSI (* FLD (f_r2), 4); + 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)); +* FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); -SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); } while (0); #undef FLD @@ -1401,13 +1403,15 @@ SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); CASE (sem, INSN_ST_MINUS) : /* st $src1,@-$src2 */ { #define FLD(f) abuf->fields.fmt_52_st_plus.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { -* FLD (f_r2) = SUBSI (* FLD (f_r2), 4); + 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)); +* FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); -SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); } while (0); #undef FLD @@ -1417,7 +1421,7 @@ SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); CASE (sem, INSN_SUB) : /* sub $dr,$sr */ { #define FLD(f) abuf->fields.fmt_0_add.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SUBSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1429,7 +1433,7 @@ SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); CASE (sem, INSN_SUBV) : /* subv $dr,$sr */ { #define FLD(f) abuf->fields.fmt_5_addv.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -1448,7 +1452,7 @@ do { CASE (sem, INSN_SUBX) : /* subx $dr,$sr */ { #define FLD(f) abuf->fields.fmt_7_addx.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -1467,7 +1471,7 @@ do { CASE (sem, INSN_TRAP) : /* trap #$uimm4 */ { #define FLD(f) abuf->fields.fmt_53_trap.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { m32r_h_cr_set (current_cpu, 6, ADDSI (CPU (h_pc), 4)); @@ -1485,7 +1489,7 @@ do_trap (current_cpu, FLD (f_uimm4)); CASE (sem, INSN_UNLOCK) : /* unlock $src1,@$src2 */ { #define FLD(f) abuf->fields.fmt_54_unlock.f - new_pc = SEM_NEXT_PC (sem_arg); + new_pc = SEM_NEXT_PC (sem_arg, 2); do { if (CPU (h_lock)) { diff --git a/sim/m32r/sem.c b/sim/m32r/sem.c index 8c83912..f4ace2c 100644 --- a/sim/m32r/sem.c +++ b/sim/m32r/sem.c @@ -41,7 +41,7 @@ SEM_FN_NAME (m32r,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ADDSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -65,7 +65,7 @@ SEM_FN_NAME (m32r,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_1_add3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ADDSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -89,7 +89,7 @@ SEM_FN_NAME (m32r,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ANDSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -113,7 +113,7 @@ SEM_FN_NAME (m32r,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_2_and3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ANDSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -137,7 +137,7 @@ SEM_FN_NAME (m32r,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ORSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -161,7 +161,7 @@ SEM_FN_NAME (m32r,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_3_or3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ORSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -185,7 +185,7 @@ SEM_FN_NAME (m32r,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = XORSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -209,7 +209,7 @@ SEM_FN_NAME (m32r,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_2_and3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = XORSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -233,7 +233,7 @@ SEM_FN_NAME (m32r,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_4_addi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ADDSI (* FLD (f_r1), FLD (f_simm8)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -257,7 +257,7 @@ SEM_FN_NAME (m32r,addv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_5_addv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -288,7 +288,7 @@ SEM_FN_NAME (m32r,addv3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_6_addv3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); do { BI temp1;SI temp0; @@ -319,7 +319,7 @@ SEM_FN_NAME (m32r,addx) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_7_addx.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -350,11 +350,11 @@ SEM_FN_NAME (m32r,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_8_bc8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; if (CPU (h_cond)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + 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)); } @@ -376,11 +376,11 @@ SEM_FN_NAME (m32r,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_9_bc24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (CPU (h_cond)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + 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)); } @@ -402,11 +402,11 @@ SEM_FN_NAME (m32r,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_10_beq.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (EQSI (* FLD (f_r1), * FLD (f_r2))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -429,11 +429,11 @@ SEM_FN_NAME (m32r,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (EQSI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -456,11 +456,11 @@ SEM_FN_NAME (m32r,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (GESI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -483,11 +483,11 @@ SEM_FN_NAME (m32r,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (GTSI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -510,11 +510,11 @@ SEM_FN_NAME (m32r,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (LESI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -537,11 +537,11 @@ SEM_FN_NAME (m32r,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (LTSI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -564,11 +564,11 @@ SEM_FN_NAME (m32r,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (NESI (* FLD (f_r2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -591,13 +591,13 @@ SEM_FN_NAME (m32r,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_12_bl8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; do { CPU (h_gr[14]) = ADDSI (ANDSI (CPU (h_pc), -4), 4); TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + 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)); } while (0); @@ -620,13 +620,13 @@ SEM_FN_NAME (m32r,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_13_bl24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; do { CPU (h_gr[14]) = ADDSI (CPU (h_pc), 4); TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + 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)); } while (0); @@ -649,11 +649,11 @@ SEM_FN_NAME (m32r,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_8_bc8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; if (NOTBI (CPU (h_cond))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + 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)); } @@ -675,11 +675,11 @@ SEM_FN_NAME (m32r,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_9_bc24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (NOTBI (CPU (h_cond))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + 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)); } @@ -701,11 +701,11 @@ SEM_FN_NAME (m32r,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_10_beq.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; if (NESI (* FLD (f_r1), * FLD (f_r2))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp16))); + 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)); } @@ -728,10 +728,10 @@ SEM_FN_NAME (m32r,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_14_bra8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp8))); + 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)); @@ -752,10 +752,10 @@ SEM_FN_NAME (m32r,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_15_bra24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, FLD (f_disp24))); + 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)); @@ -776,7 +776,7 @@ SEM_FN_NAME (m32r,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_16_cmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_cond) = LTSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -799,7 +799,7 @@ SEM_FN_NAME (m32r,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_17_cmpi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); CPU (h_cond) = LTSI (* FLD (f_r2), FLD (f_simm16)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -822,7 +822,7 @@ SEM_FN_NAME (m32r,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_16_cmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_cond) = LTUSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -845,7 +845,7 @@ SEM_FN_NAME (m32r,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_18_cmpui.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); CPU (h_cond) = LTUSI (* FLD (f_r2), FLD (f_uimm16)); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); @@ -868,7 +868,7 @@ SEM_FN_NAME (m32r,div) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_19_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = DIVSI (* FLD (f_r1), * FLD (f_r2)); @@ -894,7 +894,7 @@ SEM_FN_NAME (m32r,divu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_19_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = UDIVSI (* FLD (f_r1), * FLD (f_r2)); @@ -920,7 +920,7 @@ SEM_FN_NAME (m32r,rem) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_19_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = MODSI (* FLD (f_r1), * FLD (f_r2)); @@ -946,7 +946,7 @@ SEM_FN_NAME (m32r,remu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_19_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); if (NESI (* FLD (f_r2), 0)) { * FLD (f_r1) = UMODSI (* FLD (f_r1), * FLD (f_r2)); @@ -972,7 +972,7 @@ SEM_FN_NAME (m32r,jl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_20_jl.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; do { @@ -981,7 +981,7 @@ do { temp1 = * FLD (f_r2); CPU (h_gr[14]) = temp0; TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); taken_p = 1; TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -1005,10 +1005,10 @@ SEM_FN_NAME (m32r,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_21_jmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, * FLD (f_r2))); + 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)); @@ -1030,7 +1030,7 @@ SEM_FN_NAME (m32r,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_22_ld.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = GETMEMSI (current_cpu, * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1054,7 +1054,7 @@ SEM_FN_NAME (m32r,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_23_ld_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = GETMEMSI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1078,7 +1078,7 @@ SEM_FN_NAME (m32r,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_24_ldb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = EXTQISI (GETMEMQI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1102,7 +1102,7 @@ SEM_FN_NAME (m32r,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_25_ldb_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = EXTQISI (GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1126,7 +1126,7 @@ SEM_FN_NAME (m32r,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_26_ldh.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = EXTHISI (GETMEMHI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1150,7 +1150,7 @@ SEM_FN_NAME (m32r,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_27_ldh_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = EXTHISI (GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1174,7 +1174,7 @@ SEM_FN_NAME (m32r,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_24_ldb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ZEXTQISI (GETMEMQI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1198,7 +1198,7 @@ SEM_FN_NAME (m32r,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_25_ldb_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ZEXTQISI (GETMEMQI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1222,7 +1222,7 @@ SEM_FN_NAME (m32r,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_26_ldh.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = ZEXTHISI (GETMEMHI (current_cpu, * FLD (f_r2))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1246,7 +1246,7 @@ SEM_FN_NAME (m32r,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_27_ldh_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = ZEXTHISI (GETMEMHI (current_cpu, ADDSI (* FLD (f_r2), FLD (f_simm16)))); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1270,7 +1270,7 @@ SEM_FN_NAME (m32r,ld_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_28_ld_plus.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { SI temp1;SI temp0; @@ -1301,7 +1301,7 @@ SEM_FN_NAME (m32r,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_29_ld24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = FLD (f_uimm24); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1324,7 +1324,7 @@ SEM_FN_NAME (m32r,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_30_ldi8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = FLD (f_simm8); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1347,7 +1347,7 @@ SEM_FN_NAME (m32r,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_31_ldi16.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = FLD (f_simm16); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1370,7 +1370,7 @@ SEM_FN_NAME (m32r,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_32_lock.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { CPU (h_lock) = 1; @@ -1398,7 +1398,7 @@ SEM_FN_NAME (m32r,machi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_33_machi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (ANDSI (* FLD (f_r1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1421,7 +1421,7 @@ SEM_FN_NAME (m32r,maclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_33_machi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (SLLSI (* FLD (f_r1), 16)), EXTHIDI (TRUNCSIHI (* FLD (f_r2))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1444,7 +1444,7 @@ SEM_FN_NAME (m32r,macwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_33_machi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1467,7 +1467,7 @@ SEM_FN_NAME (m32r,macwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_33_machi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (ADDDI (CPU (h_accum), MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (* FLD (f_r2))))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1490,7 +1490,7 @@ SEM_FN_NAME (m32r,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = MULSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1514,7 +1514,7 @@ SEM_FN_NAME (m32r,mulhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_34_mulhi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (f_r1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16)))), 16), 16); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1537,7 +1537,7 @@ SEM_FN_NAME (m32r,mullo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_34_mulhi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (f_r1), 16)), EXTHIDI (TRUNCSIHI (* FLD (f_r2)))), 16), 16); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1560,7 +1560,7 @@ SEM_FN_NAME (m32r,mulwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_34_mulhi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (f_r2), 16)))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1583,7 +1583,7 @@ SEM_FN_NAME (m32r,mulwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_34_mulhi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (f_r1)), EXTHIDI (TRUNCSIHI (* FLD (f_r2)))), 8), 8); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1606,7 +1606,7 @@ SEM_FN_NAME (m32r,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_35_mv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = * FLD (f_r2); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1630,7 +1630,7 @@ SEM_FN_NAME (m32r,mvfachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_36_mvfachi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = TRUNCDISI (SRADI (CPU (h_accum), 32)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1653,7 +1653,7 @@ SEM_FN_NAME (m32r,mvfaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_36_mvfachi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = TRUNCDISI (CPU (h_accum)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1676,7 +1676,7 @@ SEM_FN_NAME (m32r,mvfacmi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_36_mvfachi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = TRUNCDISI (SRADI (CPU (h_accum), 16)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1699,7 +1699,7 @@ SEM_FN_NAME (m32r,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_37_mvfc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = m32r_h_cr_get (current_cpu, FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1722,7 +1722,7 @@ SEM_FN_NAME (m32r,mvtachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_38_mvtachi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = ORDI (ANDDI (CPU (h_accum), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (f_r1)), 32)); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1745,7 +1745,7 @@ SEM_FN_NAME (m32r,mvtaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_38_mvtachi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); CPU (h_accum) = ORDI (ANDDI (CPU (h_accum), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (f_r1))); TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum)); @@ -1768,7 +1768,7 @@ SEM_FN_NAME (m32r,mvtc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_39_mvtc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); 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))); @@ -1791,7 +1791,7 @@ SEM_FN_NAME (m32r,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_35_mv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = NEGSI (* FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1815,7 +1815,7 @@ SEM_FN_NAME (m32r,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_40_nop.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr); @@ -1836,7 +1836,7 @@ SEM_FN_NAME (m32r,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_35_mv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = INVSI (* FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1860,7 +1860,7 @@ SEM_FN_NAME (m32r,rac) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_41_rac.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { DI tmp_tmp1; @@ -1887,7 +1887,7 @@ SEM_FN_NAME (m32r,rach) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_41_rac.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { DI tmp_tmp1; @@ -1923,7 +1923,7 @@ SEM_FN_NAME (m32r,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_42_rte.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; do { @@ -1933,7 +1933,7 @@ do { TRACE_RESULT (current_cpu, "h-ie-0", 'x', CPU (h_ie)); CPU (h_cond) = CPU (h_bcond); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, CPU (h_bpc))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, CPU (h_bpc))); taken_p = 1; TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -1955,7 +1955,7 @@ SEM_FN_NAME (m32r,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_43_seth.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SLLSI (FLD (f_hi16), 16); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -1978,7 +1978,7 @@ SEM_FN_NAME (m32r,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SLLSI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2002,7 +2002,7 @@ SEM_FN_NAME (m32r,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_44_sll3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SLLSI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2026,7 +2026,7 @@ SEM_FN_NAME (m32r,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_45_slli.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SLLSI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2050,7 +2050,7 @@ SEM_FN_NAME (m32r,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRASI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2074,7 +2074,7 @@ SEM_FN_NAME (m32r,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_44_sll3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SRASI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2098,7 +2098,7 @@ SEM_FN_NAME (m32r,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_45_slli.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRASI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2122,7 +2122,7 @@ SEM_FN_NAME (m32r,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRLSI (* FLD (f_r1), ANDSI (* FLD (f_r2), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2146,7 +2146,7 @@ SEM_FN_NAME (m32r,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_44_sll3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); * FLD (f_r1) = SRLSI (* FLD (f_r2), ANDSI (FLD (f_simm16), 31)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2170,7 +2170,7 @@ SEM_FN_NAME (m32r,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_45_slli.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SRLSI (* FLD (f_r1), FLD (f_uimm5)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2194,7 +2194,7 @@ SEM_FN_NAME (m32r,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_46_st.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (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))); @@ -2217,7 +2217,7 @@ SEM_FN_NAME (m32r,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_47_st_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (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)))); @@ -2240,7 +2240,7 @@ SEM_FN_NAME (m32r,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_48_stb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (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))); @@ -2263,7 +2263,7 @@ SEM_FN_NAME (m32r,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_49_stb_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (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)))); @@ -2286,7 +2286,7 @@ SEM_FN_NAME (m32r,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_50_sth.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (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))); @@ -2309,7 +2309,7 @@ SEM_FN_NAME (m32r,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_51_sth_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (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)))); @@ -2332,13 +2332,15 @@ SEM_FN_NAME (m32r,st_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_52_st_plus.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { -* FLD (f_r2) = ADDSI (* FLD (f_r2), 4); + 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)); +* FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); -SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); } while (0); #if WITH_PROFILE_MODEL_P @@ -2360,13 +2362,15 @@ SEM_FN_NAME (m32r,st_minus) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_52_st_plus.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { -* FLD (f_r2) = SUBSI (* FLD (f_r2), 4); + 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)); +* FLD (f_r2) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', * FLD (f_r2)); -SETMEMSI (current_cpu, * FLD (f_r2), * FLD (f_r1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, * FLD (f_r2))); } while (0); #if WITH_PROFILE_MODEL_P @@ -2388,7 +2392,7 @@ SEM_FN_NAME (m32r,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); * FLD (f_r1) = SUBSI (* FLD (f_r1), * FLD (f_r2)); TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1)); @@ -2412,7 +2416,7 @@ SEM_FN_NAME (m32r,subv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_5_addv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -2443,7 +2447,7 @@ SEM_FN_NAME (m32r,subx) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_7_addx.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { BI temp1;SI temp0; @@ -2474,7 +2478,7 @@ SEM_FN_NAME (m32r,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_53_trap.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; do { @@ -2503,7 +2507,7 @@ SEM_FN_NAME (m32r,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { #define FLD(f) abuf->fields.fmt_54_unlock.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = SEM_NEXT_PC (sem_arg); + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); do { if (CPU (h_lock)) { diff --git a/sim/m32r/semx.c b/sim/m32r/semx.c index 910f231..4642837 100644 --- a/sim/m32r/semx.c +++ b/sim/m32r/semx.c @@ -42,7 +42,7 @@ SEM_FN_NAME (m32rx,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -69,7 +69,7 @@ SEM_FN_NAME (m32rx,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_1_add3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_1_ADD3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_1_ADD3_CODE @@ -96,7 +96,7 @@ SEM_FN_NAME (m32rx,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -123,7 +123,7 @@ SEM_FN_NAME (m32rx,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_2_and3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_2_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_2_AND3_CODE @@ -150,7 +150,7 @@ SEM_FN_NAME (m32rx,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -177,7 +177,7 @@ SEM_FN_NAME (m32rx,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_3_or3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_3_OR3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_3_OR3_CODE @@ -204,7 +204,7 @@ SEM_FN_NAME (m32rx,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -231,7 +231,7 @@ SEM_FN_NAME (m32rx,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_2_and3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_2_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_2_AND3_CODE @@ -258,7 +258,7 @@ SEM_FN_NAME (m32rx,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_4_addi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_4_ADDI_VARS /* f-op1 f-r1 f-simm8 */ EXTRACT_FMT_4_ADDI_CODE @@ -285,7 +285,7 @@ SEM_FN_NAME (m32rx,addv) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_5_addv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_5_ADDV_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_5_ADDV_CODE @@ -319,7 +319,7 @@ SEM_FN_NAME (m32rx,addv3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_6_addv3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_6_ADDV3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_6_ADDV3_CODE @@ -353,7 +353,7 @@ SEM_FN_NAME (m32rx,addx) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_7_addx.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_7_ADDX_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_7_ADDX_CODE @@ -387,13 +387,13 @@ SEM_FN_NAME (m32rx,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_8_bc8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_8_BC8_VARS /* f-op1 f-r1 f-disp8 */ EXTRACT_FMT_8_BC8_CODE if (OPRND (condbit)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -415,13 +415,13 @@ SEM_FN_NAME (m32rx,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_9_bc24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_9_BC24_VARS /* f-op1 f-r1 f-disp24 */ EXTRACT_FMT_9_BC24_CODE if (OPRND (condbit)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -443,13 +443,13 @@ SEM_FN_NAME (m32rx,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_10_beq.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_10_BEQ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_10_BEQ_CODE if (EQSI (OPRND (src1), OPRND (src2))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -472,13 +472,13 @@ SEM_FN_NAME (m32rx,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_11_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_11_BEQZ_CODE if (EQSI (OPRND (src2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -501,13 +501,13 @@ SEM_FN_NAME (m32rx,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_11_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_11_BEQZ_CODE if (GESI (OPRND (src2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -530,13 +530,13 @@ SEM_FN_NAME (m32rx,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_11_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_11_BEQZ_CODE if (GTSI (OPRND (src2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -559,13 +559,13 @@ SEM_FN_NAME (m32rx,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_11_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_11_BEQZ_CODE if (LESI (OPRND (src2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -588,13 +588,13 @@ SEM_FN_NAME (m32rx,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_11_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_11_BEQZ_CODE if (LTSI (OPRND (src2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -617,13 +617,13 @@ SEM_FN_NAME (m32rx,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_11_beqz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_11_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_11_BEQZ_CODE if (NESI (OPRND (src2), 0)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -646,7 +646,7 @@ SEM_FN_NAME (m32rx,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_12_bl8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_12_BL8_VARS /* f-op1 f-r1 f-disp8 */ EXTRACT_FMT_12_BL8_CODE @@ -654,7 +654,7 @@ 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -677,7 +677,7 @@ SEM_FN_NAME (m32rx,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_13_bl24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_13_BL24_VARS /* f-op1 f-r1 f-disp24 */ EXTRACT_FMT_13_BL24_CODE @@ -685,7 +685,7 @@ 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -708,7 +708,7 @@ SEM_FN_NAME (m32rx,bcl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_14_bcl8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_14_BCL8_VARS /* f-op1 f-r1 f-disp8 */ EXTRACT_FMT_14_BCL8_CODE @@ -717,7 +717,7 @@ 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); } @@ -741,7 +741,7 @@ SEM_FN_NAME (m32rx,bcl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_15_bcl24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_15_BCL24_VARS /* f-op1 f-r1 f-disp24 */ EXTRACT_FMT_15_BCL24_CODE @@ -750,7 +750,7 @@ 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); } @@ -774,13 +774,13 @@ SEM_FN_NAME (m32rx,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_8_bc8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_8_BC8_VARS /* f-op1 f-r1 f-disp8 */ EXTRACT_FMT_8_BC8_CODE if (NOTBI (OPRND (condbit))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -802,13 +802,13 @@ SEM_FN_NAME (m32rx,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_9_bc24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_9_BC24_VARS /* f-op1 f-r1 f-disp24 */ EXTRACT_FMT_9_BC24_CODE if (NOTBI (OPRND (condbit))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -830,13 +830,13 @@ SEM_FN_NAME (m32rx,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_10_beq.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_10_BEQ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */ EXTRACT_FMT_10_BEQ_CODE if (NESI (OPRND (src1), OPRND (src2))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -859,12 +859,12 @@ SEM_FN_NAME (m32rx,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_16_bra8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_16_BRA8_VARS /* f-op1 f-r1 f-disp8 */ EXTRACT_FMT_16_BRA8_CODE - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); #if WITH_PROFILE_MODEL_P @@ -885,12 +885,12 @@ SEM_FN_NAME (m32rx,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_17_bra24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_17_BRA24_VARS /* f-op1 f-r1 f-disp24 */ EXTRACT_FMT_17_BRA24_CODE - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); #if WITH_PROFILE_MODEL_P @@ -911,7 +911,7 @@ SEM_FN_NAME (m32rx,bncl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_14_bcl8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_14_BCL8_VARS /* f-op1 f-r1 f-disp8 */ EXTRACT_FMT_14_BCL8_CODE @@ -920,7 +920,7 @@ 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); } @@ -944,7 +944,7 @@ SEM_FN_NAME (m32rx,bncl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_15_bcl24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); int taken_p = 0; EXTRACT_FMT_15_BCL24_VARS /* f-op1 f-r1 f-disp24 */ EXTRACT_FMT_15_BCL24_CODE @@ -953,7 +953,7 @@ 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])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); } @@ -977,7 +977,7 @@ SEM_FN_NAME (m32rx,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_18_cmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_18_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_18_CMP_CODE @@ -1003,7 +1003,7 @@ SEM_FN_NAME (m32rx,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_19_cmpi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_19_CMPI_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_19_CMPI_CODE @@ -1029,7 +1029,7 @@ SEM_FN_NAME (m32rx,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_18_cmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_18_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_18_CMP_CODE @@ -1055,7 +1055,7 @@ SEM_FN_NAME (m32rx,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_20_cmpui.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_20_CMPUI_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_20_CMPUI_CODE @@ -1081,7 +1081,7 @@ SEM_FN_NAME (m32rx,cmpeq) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_18_cmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_18_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_18_CMP_CODE @@ -1107,7 +1107,7 @@ SEM_FN_NAME (m32rx,cmpz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_21_cmpz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_21_CMPZ_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_21_CMPZ_CODE @@ -1133,7 +1133,7 @@ SEM_FN_NAME (m32rx,div) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_22_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_22_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_22_DIV_CODE @@ -1162,7 +1162,7 @@ SEM_FN_NAME (m32rx,divu) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_22_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_22_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_22_DIV_CODE @@ -1191,7 +1191,7 @@ SEM_FN_NAME (m32rx,rem) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_22_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_22_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_22_DIV_CODE @@ -1220,7 +1220,7 @@ SEM_FN_NAME (m32rx,remu) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_22_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_22_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_22_DIV_CODE @@ -1249,7 +1249,7 @@ SEM_FN_NAME (m32rx,divh) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_22_div.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_22_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_22_DIV_CODE @@ -1278,13 +1278,13 @@ SEM_FN_NAME (m32rx,jc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_23_jc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_23_JC_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_23_JC_CODE if (OPRND (condbit)) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -1307,13 +1307,13 @@ SEM_FN_NAME (m32rx,jnc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_23_jc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_23_JC_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_23_JC_CODE if (NOTBI (OPRND (condbit))) { - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } @@ -1336,7 +1336,7 @@ SEM_FN_NAME (m32rx,jl) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_24_jl.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_24_JL_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_24_JL_CODE @@ -1347,7 +1347,7 @@ do { temp1 = OPRND (sr); CPU (h_gr[14]) = temp0; TRACE_RESULT (current_cpu, "h-gr-14", 'x', CPU (h_gr[14])); - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1)); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -1371,12 +1371,12 @@ SEM_FN_NAME (m32rx,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_25_jmp.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_25_JMP_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_25_JMP_CODE - BRANCH_NEW_PC (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, OPRND (sr))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, OPRND (sr))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); #if WITH_PROFILE_MODEL_P @@ -1398,7 +1398,7 @@ SEM_FN_NAME (m32rx,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_26_ld.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_26_LD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_26_LD_CODE @@ -1425,7 +1425,7 @@ SEM_FN_NAME (m32rx,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_27_ld_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_27_LD_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_27_LD_D_CODE @@ -1452,7 +1452,7 @@ SEM_FN_NAME (m32rx,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_28_ldb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_28_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_28_LDB_CODE @@ -1479,7 +1479,7 @@ SEM_FN_NAME (m32rx,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_29_ldb_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_29_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_29_LDB_D_CODE @@ -1506,7 +1506,7 @@ SEM_FN_NAME (m32rx,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_30_ldh.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_30_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_30_LDH_CODE @@ -1533,7 +1533,7 @@ SEM_FN_NAME (m32rx,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_31_ldh_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_31_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_31_LDH_D_CODE @@ -1560,7 +1560,7 @@ SEM_FN_NAME (m32rx,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_28_ldb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_28_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_28_LDB_CODE @@ -1587,7 +1587,7 @@ SEM_FN_NAME (m32rx,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_29_ldb_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_29_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_29_LDB_D_CODE @@ -1614,7 +1614,7 @@ SEM_FN_NAME (m32rx,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_30_ldh.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_30_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_30_LDH_CODE @@ -1641,7 +1641,7 @@ SEM_FN_NAME (m32rx,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_31_ldh_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_31_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_31_LDH_D_CODE @@ -1668,7 +1668,7 @@ SEM_FN_NAME (m32rx,ld_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_32_ld_plus.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_32_LD_PLUS_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_32_LD_PLUS_CODE @@ -1702,7 +1702,7 @@ SEM_FN_NAME (m32rx,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_33_ld24.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_33_LD24_VARS /* f-op1 f-r1 f-uimm24 */ EXTRACT_FMT_33_LD24_CODE @@ -1728,7 +1728,7 @@ SEM_FN_NAME (m32rx,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_34_ldi8.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_34_LDI8_VARS /* f-op1 f-r1 f-simm8 */ EXTRACT_FMT_34_LDI8_CODE @@ -1754,7 +1754,7 @@ SEM_FN_NAME (m32rx,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_35_ldi16.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_35_LDI16_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_35_LDI16_CODE @@ -1780,7 +1780,7 @@ SEM_FN_NAME (m32rx,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_36_lock.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_36_LOCK_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_36_LOCK_CODE @@ -1811,7 +1811,7 @@ SEM_FN_NAME (m32rx,machi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_37_machi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_37_MACHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */ EXTRACT_FMT_37_MACHI_A_CODE @@ -1837,7 +1837,7 @@ SEM_FN_NAME (m32rx,maclo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_37_machi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_37_MACHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */ EXTRACT_FMT_37_MACHI_A_CODE @@ -1863,7 +1863,7 @@ SEM_FN_NAME (m32rx,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -1890,7 +1890,7 @@ SEM_FN_NAME (m32rx,mulhi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_38_mulhi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_38_MULHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */ EXTRACT_FMT_38_MULHI_A_CODE @@ -1916,7 +1916,7 @@ SEM_FN_NAME (m32rx,mullo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_38_mulhi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_38_MULHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */ EXTRACT_FMT_38_MULHI_A_CODE @@ -1942,7 +1942,7 @@ SEM_FN_NAME (m32rx,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_39_mv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_39_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_39_MV_CODE @@ -1969,7 +1969,7 @@ SEM_FN_NAME (m32rx,mvfachi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_40_mvfachi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_40_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */ EXTRACT_FMT_40_MVFACHI_A_CODE @@ -1995,7 +1995,7 @@ SEM_FN_NAME (m32rx,mvfaclo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_40_mvfachi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_40_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */ EXTRACT_FMT_40_MVFACHI_A_CODE @@ -2021,7 +2021,7 @@ SEM_FN_NAME (m32rx,mvfacmi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_40_mvfachi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_40_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */ EXTRACT_FMT_40_MVFACHI_A_CODE @@ -2047,7 +2047,7 @@ SEM_FN_NAME (m32rx,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_41_mvfc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_41_MVFC_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_41_MVFC_CODE @@ -2073,7 +2073,7 @@ SEM_FN_NAME (m32rx,mvtachi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_42_mvtachi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_42_MVTACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */ EXTRACT_FMT_42_MVTACHI_A_CODE @@ -2099,7 +2099,7 @@ SEM_FN_NAME (m32rx,mvtaclo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_42_mvtachi_a.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_42_MVTACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */ EXTRACT_FMT_42_MVTACHI_A_CODE @@ -2125,7 +2125,7 @@ SEM_FN_NAME (m32rx,mvtc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_43_mvtc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_43_MVTC_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_43_MVTC_CODE @@ -2151,7 +2151,7 @@ SEM_FN_NAME (m32rx,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_39_mv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_39_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_39_MV_CODE @@ -2178,7 +2178,7 @@ SEM_FN_NAME (m32rx,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_44_nop.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_44_NOP_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_44_NOP_CODE @@ -2202,7 +2202,7 @@ SEM_FN_NAME (m32rx,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_39_mv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_39_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_39_MV_CODE @@ -2229,7 +2229,7 @@ SEM_FN_NAME (m32rx,rac_dsi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_45_rac_dsi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_45_RAC_DSI_VARS /* f-op1 f-accd f-bits67 f-op2 f-accs f-bit14 f-imm1 */ EXTRACT_FMT_45_RAC_DSI_CODE @@ -2259,7 +2259,7 @@ SEM_FN_NAME (m32rx,rach_dsi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *pa insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_45_rac_dsi.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_45_RAC_DSI_VARS /* f-op1 f-accd f-bits67 f-op2 f-accs f-bit14 f-imm1 */ EXTRACT_FMT_45_RAC_DSI_CODE @@ -2289,7 +2289,7 @@ SEM_FN_NAME (m32rx,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_46_rte.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_46_RTE_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_46_RTE_CODE @@ -2301,7 +2301,7 @@ do { TRACE_RESULT (current_cpu, "h-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 (current_cpu, new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, OPRND (h_bpc_0))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, OPRND (h_bpc_0))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -2323,7 +2323,7 @@ SEM_FN_NAME (m32rx,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_47_seth.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_47_SETH_VARS /* f-op1 f-r1 f-op2 f-r2 f-hi16 */ EXTRACT_FMT_47_SETH_CODE @@ -2349,7 +2349,7 @@ SEM_FN_NAME (m32rx,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -2376,7 +2376,7 @@ SEM_FN_NAME (m32rx,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_48_sll3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_48_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_48_SLL3_CODE @@ -2403,7 +2403,7 @@ SEM_FN_NAME (m32rx,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_49_slli.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_49_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */ EXTRACT_FMT_49_SLLI_CODE @@ -2430,7 +2430,7 @@ SEM_FN_NAME (m32rx,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -2457,7 +2457,7 @@ SEM_FN_NAME (m32rx,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_48_sll3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_48_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_48_SLL3_CODE @@ -2484,7 +2484,7 @@ SEM_FN_NAME (m32rx,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_49_slli.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_49_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */ EXTRACT_FMT_49_SLLI_CODE @@ -2511,7 +2511,7 @@ SEM_FN_NAME (m32rx,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -2538,7 +2538,7 @@ SEM_FN_NAME (m32rx,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_48_sll3.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_48_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_48_SLL3_CODE @@ -2565,7 +2565,7 @@ SEM_FN_NAME (m32rx,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_49_slli.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_49_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */ EXTRACT_FMT_49_SLLI_CODE @@ -2592,7 +2592,7 @@ SEM_FN_NAME (m32rx,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_50_st.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_50_ST_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_50_ST_CODE @@ -2618,7 +2618,7 @@ SEM_FN_NAME (m32rx,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_51_st_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_51_ST_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_51_ST_D_CODE @@ -2644,7 +2644,7 @@ SEM_FN_NAME (m32rx,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_52_stb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_52_STB_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_52_STB_CODE @@ -2670,7 +2670,7 @@ SEM_FN_NAME (m32rx,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_53_stb_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_53_STB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_53_STB_D_CODE @@ -2696,7 +2696,7 @@ SEM_FN_NAME (m32rx,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_54_sth.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_54_STH_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_54_STH_CODE @@ -2722,7 +2722,7 @@ SEM_FN_NAME (m32rx,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_55_sth_d.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_55_STH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */ EXTRACT_FMT_55_STH_D_CODE @@ -2748,15 +2748,17 @@ SEM_FN_NAME (m32rx,st_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_56_st_plus.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_56_ST_PLUS_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_56_ST_PLUS_CODE do { - CPU (h_gr[f_r2]) = ADDSI (OPRND (src2), 4); + 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)); + CPU (h_gr[f_r2]) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', CPU (h_gr[f_r2])); -SETMEMSI (current_cpu, OPRND (src2), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, OPRND (src2))); } while (0); #if WITH_PROFILE_MODEL_P @@ -2779,15 +2781,17 @@ SEM_FN_NAME (m32rx,st_minus) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *pa insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_56_st_plus.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_56_ST_PLUS_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_56_ST_PLUS_CODE do { - CPU (h_gr[f_r2]) = SUBSI (OPRND (src2), 4); + 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)); + CPU (h_gr[f_r2]) = tmp_new_src2; TRACE_RESULT (current_cpu, "src2", 'x', CPU (h_gr[f_r2])); -SETMEMSI (current_cpu, OPRND (src2), OPRND (src1)); - TRACE_RESULT (current_cpu, "h-memory-src2", 'x', GETMEMSI (current_cpu, OPRND (src2))); } while (0); #if WITH_PROFILE_MODEL_P @@ -2810,7 +2814,7 @@ SEM_FN_NAME (m32rx,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_0_add.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_0_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_0_ADD_CODE @@ -2837,7 +2841,7 @@ SEM_FN_NAME (m32rx,subv) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_5_addv.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_5_ADDV_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_5_ADDV_CODE @@ -2871,7 +2875,7 @@ SEM_FN_NAME (m32rx,subx) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_7_addx.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_7_ADDX_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_7_ADDX_CODE @@ -2905,7 +2909,7 @@ SEM_FN_NAME (m32rx,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_57_trap.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); int taken_p = 0; EXTRACT_FMT_57_TRAP_VARS /* f-op1 f-r1 f-op2 f-uimm4 */ EXTRACT_FMT_57_TRAP_CODE @@ -2937,7 +2941,7 @@ SEM_FN_NAME (m32rx,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_58_unlock.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_58_UNLOCK_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_58_UNLOCK_CODE @@ -2969,7 +2973,7 @@ SEM_FN_NAME (m32rx,satb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_59_satb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_59_SATB_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_59_SATB_CODE @@ -2996,7 +3000,7 @@ SEM_FN_NAME (m32rx,sath) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_59_satb.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_59_SATB_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_59_SATB_CODE @@ -3023,7 +3027,7 @@ SEM_FN_NAME (m32rx,sat) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_60_sat.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 4; + CIA new_pc = SEM_NEXT_PC (sem_arg, 4); EXTRACT_FMT_60_SAT_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */ EXTRACT_FMT_60_SAT_CODE @@ -3050,7 +3054,7 @@ SEM_FN_NAME (m32rx,pcmpbz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_21_cmpz.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_21_CMPZ_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_21_CMPZ_CODE @@ -3076,7 +3080,7 @@ SEM_FN_NAME (m32rx,sadd) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_61_sadd.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_61_SADD_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_61_SADD_CODE @@ -3101,7 +3105,7 @@ SEM_FN_NAME (m32rx,macwu1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_62_macwu1.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_62_MACWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_62_MACWU1_CODE @@ -3127,7 +3131,7 @@ SEM_FN_NAME (m32rx,msblo) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_63_msblo.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_63_MSBLO_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_63_MSBLO_CODE @@ -3153,7 +3157,7 @@ SEM_FN_NAME (m32rx,mulwu1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_64_mulwu1.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_64_MULWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_64_MULWU1_CODE @@ -3179,7 +3183,7 @@ SEM_FN_NAME (m32rx,maclh1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_62_macwu1.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_62_MACWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_62_MACWU1_CODE @@ -3205,13 +3209,12 @@ SEM_FN_NAME (m32rx,sc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_65_sc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_65_SC_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_65_SC_CODE if (OPRND (condbit)) { - CPU (h_abort) = 1; - TRACE_RESULT (current_cpu, "abort-parallel-execution", 'x', CPU (h_abort)); +BRANCH_NEW_PC (new_pc, NEW_PC_SKIP); } #if WITH_PROFILE_MODEL_P @@ -3232,13 +3235,12 @@ SEM_FN_NAME (m32rx,snc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe insn_t insn = SEM_INSN (sem_arg); #define OPRND(f) par_exec->operands.fmt_65_sc.f ARGBUF *abuf = SEM_ARGBUF (sem_arg); - CIA new_pc = CPU (h_pc) + 2; + CIA new_pc = SEM_NEXT_PC (sem_arg, 2); EXTRACT_FMT_65_SC_VARS /* f-op1 f-r1 f-op2 f-r2 */ EXTRACT_FMT_65_SC_CODE if (NOTBI (OPRND (condbit))) { - CPU (h_abort) = 1; - TRACE_RESULT (current_cpu, "abort-parallel-execution", 'x', CPU (h_abort)); +BRANCH_NEW_PC (new_pc, NEW_PC_SKIP); } #if WITH_PROFILE_MODEL_P