* 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.
This commit is contained in:
Doug Evans 1998-02-23 21:36:15 +00:00
parent 93f34464a3
commit 02310b01ca
8 changed files with 524 additions and 452 deletions

View File

@ -1,3 +1,16 @@
Mon Feb 23 13:30:46 1998 Doug Evans <devans@seba.cygnus.com>
* 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 <nickc@cygnus.com>
* 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 <devans@canuck.cygnus.com>
* m32r.c (do_lock,do_unlock): Delete.

View File

@ -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 */

View File

@ -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

View File

@ -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);

View File

@ -36,12 +36,9 @@ EOF
xinit)
cat <<EOF
USI insn,insn1,insn2;
DECODE *decode,*d1,*d2;
int icount,icount2;
DECODE *d1,*d2;
ARGBUF abufs[MAX_PARALLEL_INSNS];
SEM_ARG sem_arg;
PAREXEC pbufs[MAX_PARALLEL_INSNS];
EOF
;;
@ -52,52 +49,61 @@ cat <<EOF
{
PCADDR pc = CPU (h_pc);
/* ??? This code isn't very fast. Let's get it working first. */
if ((pc & 3) != 0)
{
insn1 = GETIMEMUHI (current_cpu, pc);
insn1 &= 0x7fff;
d1 = m32rx_decode (current_cpu, pc, insn1);
USI insn = GETIMEMUHI (current_cpu, pc);
insn &= 0x7fff;
d1 = m32rx_decode (current_cpu, pc, insn);
abufs[0].insn = insn;
icount = 1;
}
else
{
insn1 = GETIMEMUSI (current_cpu, pc);
if ((SI) insn1 < 0)
USI insn = GETIMEMUSI (current_cpu, pc);
if ((SI) insn < 0)
{
d1 = m32rx_decode (current_cpu, pc, insn1 >> 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 <<EOF
{
decode = d1;
do
SEM_ARG sem_arg = &abufs[0];
PAREXEC *par_exec = &pbufs[0];
PCADDR new_pc;
/* If doing parallel execution, verify insns are in the right pipeline. */
if (icount == 2)
{
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;
; /*wip*/
}
TRACE_INSN_INIT (current_cpu);
TRACE_INSN (current_cpu, d1->opcode, sem_arg, CPU (h_pc));
new_pc = (*d1->semantic) (current_cpu, sem_arg, par_exec);
TRACE_INSN_FINI (current_cpu);
PROFILE_COUNT_INSN (current_cpu, CPU (h_pc), CGEN_INSN_INDEX (d1->opcode));
/* 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 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

View File

@ -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)) {

View File

@ -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)) {

File diff suppressed because it is too large Load Diff