* Makefile.in: cgen_maint -> CGEN_MAINT.
authorDoug Evans <dje@google.com>
Thu, 2 Jul 1998 01:42:38 +0000 (01:42 +0000)
committerDoug Evans <dje@google.com>
Thu, 2 Jul 1998 01:42:38 +0000 (01:42 +0000)
* configure.in: AC_SUBST cgen,cgendir.  No longer look for guile.
* configure: Regenerate.
* arch.c,arch.h,cpuall.h: Regenerate.
* cpu.c,cpu.h,decode.c,decode.h,extract.c,model.c: Regenerate.
* sem-switch.c,sem.c: Regenerate.
* cpux.c,cpux.h,decodex.c,decodex.h,modelx.c,readx.c: Regenerate.
* semx.c: Regenerate.
* mloopx.in (icount): Moved here from genmloop.sh.

sim/m32r/configure.in
sim/m32r/extract.c
sim/m32r/readx.c
sim/m32r/semx.c

index 0ed1268..9513239 100644 (file)
@@ -15,18 +15,36 @@ SIM_AC_OPTION_SCACHE(1024)
 SIM_AC_OPTION_DEFAULT_MODEL(m32r/d)
 SIM_AC_OPTION_ENVIRONMENT
 
-cgen_maint="#"
+cgen_maint=no
+# Default is to use one in build tree.
+cgen=../../cgen/cgen
+cgendir='$(srcdir)/../../cgen'
 # Having --enable-maintainer-mode take arguments is another way to go.
+# ??? One can argue --with is more appropriate if one wants to specify
+# a directory name, but what we're doing here is an enable/disable kind
+# of thing and specifying both --enable and --with is klunky.
+# If you reeely want this to be --with, go ahead and change it.
 AC_ARG_ENABLE(cgen-maint,
-[  --enable-cgen-maint     build cgen generated files],
+[  --enable-cgen-maint[=dir]    build cgen generated files],
 [case "${enableval}" in
-  yes) cgen_maint="" ;;
-  no)  ;;
-  *)   AC_MSG_ERROR([bad value ${enableval} for simulator cgen-maint option]) ;;
+  yes) cgen_maint=yes ;;
+  no)  cgen_maint=no ;;
+  *)
+       # argument is cgen install directory (not implemented yet).
+       # Having a `share' directory might be more appropriate for the .scm,
+       # .cpu, etc. files.
+       cgendir=${cgen_maint}/lib/cgen
+       cgen=${cgendir}/bin/cgen
+       ;;
 esac])dnl
-AC_SUBST(cgen_maint)
-if test "x${cgen_maint}" = x ; then
-    AC_CHECK_PROG(SCHEME, guile, guile, guile)
+dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
+if test x${cgen_maint} != xno ; then
+  CGEN_MAINT=''
+else
+  CGEN_MAINT='#'
 fi
+AC_SUBST(CGEN_MAINT)
+AC_SUBST(cgendir)
+AC_SUBST(cgen)
 
 SIM_AC_OUTPUT
index 6259093..110c675 100644 (file)
@@ -1,6 +1,6 @@
 /* Simulator instruction extractor for m32r.
 
-This file is machine generated with CGEN.
+THIS FILE IS MACHINE GENERATED WITH CGEN.
 
 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
 
@@ -257,7 +257,7 @@ EX_FN_NAME (m32r,fmt_bc8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
   EXTRACT_FMT_BC8_CODE
 
   /* Record the fields for the semantic handler.  */
-  RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8);
+  FLD (f_disp8) = (pc & -4L) + f_disp8;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_bc8", "disp8 0x%x", 'x', f_disp8, (char *) 0));
 
   abuf->length = length;
@@ -274,7 +274,7 @@ EX_FN_NAME (m32r,fmt_bc24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
   EXTRACT_FMT_BC24_CODE
 
   /* Record the fields for the semantic handler.  */
-  RECORD_IADDR (FLD (f_disp24), pc + f_disp24);
+  FLD (f_disp24) = pc + f_disp24;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_bc24", "disp24 0x%x", 'x', f_disp24, (char *) 0));
 
   abuf->length = length;
@@ -293,7 +293,7 @@ EX_FN_NAME (m32r,fmt_beq) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
   /* Record the fields for the semantic handler.  */
   FLD (f_r1) = & CPU (h_gr)[f_r1];
   FLD (f_r2) = & CPU (h_gr)[f_r2];
-  RECORD_IADDR (FLD (f_disp16), pc + f_disp16);
+  FLD (f_disp16) = pc + f_disp16;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_beq", "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0));
 
   abuf->length = length;
@@ -319,7 +319,7 @@ EX_FN_NAME (m32r,fmt_beqz) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
 
   /* Record the fields for the semantic handler.  */
   FLD (f_r2) = & CPU (h_gr)[f_r2];
-  RECORD_IADDR (FLD (f_disp16), pc + f_disp16);
+  FLD (f_disp16) = pc + f_disp16;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_beqz", "src2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, (char *) 0));
 
   abuf->length = length;
@@ -344,7 +344,7 @@ EX_FN_NAME (m32r,fmt_bl8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
   EXTRACT_FMT_BL8_CODE
 
   /* Record the fields for the semantic handler.  */
-  RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8);
+  FLD (f_disp8) = (pc & -4L) + f_disp8;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_bl8", "disp8 0x%x", 'x', f_disp8, (char *) 0));
 
   abuf->length = length;
@@ -369,7 +369,7 @@ EX_FN_NAME (m32r,fmt_bl24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
   EXTRACT_FMT_BL24_CODE
 
   /* Record the fields for the semantic handler.  */
-  RECORD_IADDR (FLD (f_disp24), pc + f_disp24);
+  FLD (f_disp24) = pc + f_disp24;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_bl24", "disp24 0x%x", 'x', f_disp24, (char *) 0));
 
   abuf->length = length;
@@ -394,7 +394,7 @@ EX_FN_NAME (m32r,fmt_bra8) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBUF
   EXTRACT_FMT_BRA8_CODE
 
   /* Record the fields for the semantic handler.  */
-  RECORD_IADDR (FLD (f_disp8), (pc & -4L) + f_disp8);
+  FLD (f_disp8) = (pc & -4L) + f_disp8;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_bra8", "disp8 0x%x", 'x', f_disp8, (char *) 0));
 
   abuf->length = length;
@@ -411,7 +411,7 @@ EX_FN_NAME (m32r,fmt_bra24) (SIM_CPU *current_cpu, PCADDR pc, insn_t insn, ARGBU
   EXTRACT_FMT_BRA24_CODE
 
   /* Record the fields for the semantic handler.  */
-  RECORD_IADDR (FLD (f_disp24), pc + f_disp24);
+  FLD (f_disp24) = pc + f_disp24;
   TRACE_EXTRACT (current_cpu, (current_cpu, pc, "fmt_bra24", "disp24 0x%x", 'x', f_disp24, (char *) 0));
 
   abuf->length = length;
index b5935ff..fb33ba8 100644 (file)
@@ -1,6 +1,6 @@
 /* Simulator instruction operand reader for m32r.
 
-This file is machine generated with CGEN.
+THIS FILE IS MACHINE GENERATED WITH CGEN.
 
 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
 
@@ -180,7 +180,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_add.f
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (dr) = CPU (h_gr[f_r1]);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -193,7 +192,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_add3.f
   EXTRACT_FMT_ADD3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_ADD3_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
       OPRND (slo16) = f_simm16;
@@ -206,7 +204,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_and3.f
   EXTRACT_FMT_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_AND3_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
       OPRND (uimm16) = f_uimm16;
@@ -219,7 +216,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_or3.f
   EXTRACT_FMT_OR3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_OR3_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
       OPRND (ulo16) = f_uimm16;
@@ -232,7 +228,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_addi.f
   EXTRACT_FMT_ADDI_VARS /* f-op1 f-r1 f-simm8 */
   EXTRACT_FMT_ADDI_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (dr) = CPU (h_gr[f_r1]);
       OPRND (simm8) = f_simm8;
@@ -245,7 +240,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_addv.f
   EXTRACT_FMT_ADDV_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADDV_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (dr) = CPU (h_gr[f_r1]);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -258,7 +252,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_addv3.f
   EXTRACT_FMT_ADDV3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_ADDV3_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
       OPRND (simm16) = f_simm16;
@@ -271,7 +264,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_addx.f
   EXTRACT_FMT_ADDX_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADDX_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (dr) = CPU (h_gr[f_r1]);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -285,10 +277,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bc8.f
   EXTRACT_FMT_BC8_VARS /* f-op1 f-r1 f-disp8 */
   EXTRACT_FMT_BC8_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
-      RECORD_IADDR (OPRND (disp8), (pc & -4L) + f_disp8);
+      OPRND (disp8) = (pc & -4L) + f_disp8;
 #undef OPRND
     }
     BREAK (read);
@@ -298,7 +289,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bc24.f
   EXTRACT_FMT_BC24_VARS /* f-op1 f-r1 f-disp24 */
   EXTRACT_FMT_BC24_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
       OPRND (disp24) = pc + f_disp24;
@@ -311,7 +301,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_beq.f
   EXTRACT_FMT_BEQ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */
   EXTRACT_FMT_BEQ_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src1) = CPU (h_gr[f_r1]);
       OPRND (src2) = CPU (h_gr[f_r2]);
@@ -325,7 +314,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_beqz.f
   EXTRACT_FMT_BEQZ_VARS /* f-op1 f-r1 f-op2 f-r2 f-disp16 */
   EXTRACT_FMT_BEQZ_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (disp16) = pc + f_disp16;
@@ -338,10 +326,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bl8.f
   EXTRACT_FMT_BL8_VARS /* f-op1 f-r1 f-disp8 */
   EXTRACT_FMT_BL8_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (pc) = CPU (h_pc);
-      RECORD_IADDR (OPRND (disp8), (pc & -4L) + f_disp8);
+      OPRND (disp8) = (pc & -4L) + f_disp8;
 #undef OPRND
     }
     BREAK (read);
@@ -351,7 +338,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bl24.f
   EXTRACT_FMT_BL24_VARS /* f-op1 f-r1 f-disp24 */
   EXTRACT_FMT_BL24_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (pc) = CPU (h_pc);
       OPRND (disp24) = pc + f_disp24;
@@ -364,11 +350,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bcl8.f
   EXTRACT_FMT_BCL8_VARS /* f-op1 f-r1 f-disp8 */
   EXTRACT_FMT_BCL8_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
       OPRND (pc) = CPU (h_pc);
-      RECORD_IADDR (OPRND (disp8), (pc & -4L) + f_disp8);
+      OPRND (disp8) = (pc & -4L) + f_disp8;
 #undef OPRND
     }
     BREAK (read);
@@ -378,7 +363,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bcl24.f
   EXTRACT_FMT_BCL24_VARS /* f-op1 f-r1 f-disp24 */
   EXTRACT_FMT_BCL24_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
       OPRND (pc) = CPU (h_pc);
@@ -392,9 +376,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bra8.f
   EXTRACT_FMT_BRA8_VARS /* f-op1 f-r1 f-disp8 */
   EXTRACT_FMT_BRA8_CODE
-
       /* Fetch the input operands for the semantic handler.  */
-      RECORD_IADDR (OPRND (disp8), (pc & -4L) + f_disp8);
+      OPRND (disp8) = (pc & -4L) + f_disp8;
 #undef OPRND
     }
     BREAK (read);
@@ -404,7 +387,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_bra24.f
   EXTRACT_FMT_BRA24_VARS /* f-op1 f-r1 f-disp24 */
   EXTRACT_FMT_BRA24_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (disp24) = pc + f_disp24;
 #undef OPRND
@@ -416,7 +398,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_cmp.f
   EXTRACT_FMT_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMP_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src1) = CPU (h_gr[f_r1]);
       OPRND (src2) = CPU (h_gr[f_r2]);
@@ -429,7 +410,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_cmpi.f
   EXTRACT_FMT_CMPI_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_CMPI_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (simm16) = f_simm16;
@@ -442,7 +422,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_cmpz.f
   EXTRACT_FMT_CMPZ_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMPZ_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
 #undef OPRND
@@ -454,7 +433,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_div.f
   EXTRACT_FMT_DIV_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_DIV_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (dr) = CPU (h_gr[f_r1]);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -467,7 +445,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_jc.f
   EXTRACT_FMT_JC_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_JC_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -480,7 +457,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_jl.f
   EXTRACT_FMT_JL_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_JL_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (pc) = CPU (h_pc);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -493,7 +469,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_jmp.f
   EXTRACT_FMT_JMP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_JMP_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
 #undef OPRND
@@ -505,7 +480,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ld.f
   EXTRACT_FMT_LD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LD_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_sr) = GETMEMSI (current_cpu, CPU (h_gr[f_r2]));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -518,7 +492,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ld_d.f
   EXTRACT_FMT_LD_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LD_D_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_add__VM_sr_slo16) = GETMEMSI (current_cpu, ADDSI (CPU (h_gr[f_r2]), f_simm16));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -532,7 +505,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ldb.f
   EXTRACT_FMT_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LDB_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_sr) = GETMEMQI (current_cpu, CPU (h_gr[f_r2]));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -545,7 +517,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ldb_d.f
   EXTRACT_FMT_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDB_D_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_add__VM_sr_slo16) = GETMEMQI (current_cpu, ADDSI (CPU (h_gr[f_r2]), f_simm16));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -559,7 +530,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ldh.f
   EXTRACT_FMT_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LDH_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_sr) = GETMEMHI (current_cpu, CPU (h_gr[f_r2]));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -572,7 +542,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ldh_d.f
   EXTRACT_FMT_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDH_D_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_add__VM_sr_slo16) = GETMEMHI (current_cpu, ADDSI (CPU (h_gr[f_r2]), f_simm16));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -586,7 +555,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ld_plus.f
   EXTRACT_FMT_LD_PLUS_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LD_PLUS_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_sr) = GETMEMSI (current_cpu, CPU (h_gr[f_r2]));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -599,7 +567,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ld24.f
   EXTRACT_FMT_LD24_VARS /* f-op1 f-r1 f-uimm24 */
   EXTRACT_FMT_LD24_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (uimm24) = f_uimm24;
 #undef OPRND
@@ -611,7 +578,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ldi8.f
   EXTRACT_FMT_LDI8_VARS /* f-op1 f-r1 f-simm8 */
   EXTRACT_FMT_LDI8_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (simm8) = f_simm8;
 #undef OPRND
@@ -623,7 +589,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_ldi16.f
   EXTRACT_FMT_LDI16_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDI16_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (slo16) = f_simm16;
 #undef OPRND
@@ -635,7 +600,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_lock.f
   EXTRACT_FMT_LOCK_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LOCK_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_memory_sr) = GETMEMSI (current_cpu, CPU (h_gr[f_r2]));
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -648,7 +612,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_machi_a.f
   EXTRACT_FMT_MACHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */
   EXTRACT_FMT_MACHI_A_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (acc) = m32rx_h_accums_get (current_cpu, f_acc);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -662,7 +625,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_macwhi.f
   EXTRACT_FMT_MACWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWHI_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (accum) = m32rx_h_accum_get (current_cpu);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -676,7 +638,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mulhi_a.f
   EXTRACT_FMT_MULHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */
   EXTRACT_FMT_MULHI_A_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src1) = CPU (h_gr[f_r1]);
       OPRND (src2) = CPU (h_gr[f_r2]);
@@ -689,7 +650,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mulwhi.f
   EXTRACT_FMT_MULWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MULWHI_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src1) = CPU (h_gr[f_r1]);
       OPRND (src2) = CPU (h_gr[f_r2]);
@@ -702,7 +662,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mv.f
   EXTRACT_FMT_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MV_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
 #undef OPRND
@@ -714,7 +673,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mvfachi_a.f
   EXTRACT_FMT_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVFACHI_A_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (accs) = m32rx_h_accums_get (current_cpu, f_accs);
 #undef OPRND
@@ -726,7 +684,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mvfc.f
   EXTRACT_FMT_MVFC_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MVFC_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (scr) = m32rx_h_cr_get (current_cpu, f_r2);
 #undef OPRND
@@ -738,7 +695,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mvtachi_a.f
   EXTRACT_FMT_MVTACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVTACHI_A_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (accs) = m32rx_h_accums_get (current_cpu, f_accs);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -751,7 +707,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mvtc.f
   EXTRACT_FMT_MVTC_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MVTC_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
 #undef OPRND
@@ -763,7 +718,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_nop.f
   EXTRACT_FMT_NOP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_NOP_CODE
-
       /* Fetch the input operands for the semantic handler.  */
 #undef OPRND
     }
@@ -774,7 +728,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_rac_dsi.f
   EXTRACT_FMT_RAC_DSI_VARS /* f-op1 f-accd f-bits67 f-op2 f-accs f-bit14 f-imm1 */
   EXTRACT_FMT_RAC_DSI_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (accs) = m32rx_h_accums_get (current_cpu, f_accs);
       OPRND (imm1) = f_imm1;
@@ -787,7 +740,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_rte.f
   EXTRACT_FMT_RTE_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_RTE_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_bsm_0) = CPU (h_bsm);
       OPRND (h_bie_0) = CPU (h_bie);
@@ -802,7 +754,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_seth.f
   EXTRACT_FMT_SETH_VARS /* f-op1 f-r1 f-op2 f-r2 f-hi16 */
   EXTRACT_FMT_SETH_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (hi16) = f_hi16;
 #undef OPRND
@@ -814,7 +765,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_sll3.f
   EXTRACT_FMT_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_SLL3_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
       OPRND (simm16) = f_simm16;
@@ -827,7 +777,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_slli.f
   EXTRACT_FMT_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */
   EXTRACT_FMT_SLLI_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (dr) = CPU (h_gr[f_r1]);
       OPRND (uimm5) = f_uimm5;
@@ -840,7 +789,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_st.f
   EXTRACT_FMT_ST_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ST_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -853,7 +801,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_st_d.f
   EXTRACT_FMT_ST_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_ST_D_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (slo16) = f_simm16;
@@ -867,7 +814,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_stb.f
   EXTRACT_FMT_STB_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_STB_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -880,7 +826,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_stb_d.f
   EXTRACT_FMT_STB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_STB_D_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (slo16) = f_simm16;
@@ -894,7 +839,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_sth.f
   EXTRACT_FMT_STH_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_STH_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -907,7 +851,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_sth_d.f
   EXTRACT_FMT_STH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_STH_D_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (slo16) = f_simm16;
@@ -921,7 +864,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_st_plus.f
   EXTRACT_FMT_ST_PLUS_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ST_PLUS_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src2) = CPU (h_gr[f_r2]);
       OPRND (src1) = CPU (h_gr[f_r1]);
@@ -934,10 +876,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_trap.f
   EXTRACT_FMT_TRAP_VARS /* f-op1 f-r1 f-op2 f-uimm4 */
   EXTRACT_FMT_TRAP_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (pc) = CPU (h_pc);
-      OPRND (h_cr_0) = m32rx_h_cr_get (current_cpu, 0);
+      OPRND (h_cr_0) = m32rx_h_cr_get (current_cpu, ((HOSTUINT) 0));
       OPRND (uimm4) = f_uimm4;
 #undef OPRND
     }
@@ -948,7 +889,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_unlock.f
   EXTRACT_FMT_UNLOCK_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_UNLOCK_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (h_lock_0) = CPU (h_lock);
       OPRND (src2) = CPU (h_gr[f_r2]);
@@ -962,7 +902,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_satb.f
   EXTRACT_FMT_SATB_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_SATB_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (sr) = CPU (h_gr[f_r2]);
 #undef OPRND
@@ -974,7 +913,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_sat.f
   EXTRACT_FMT_SAT_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_SAT_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
       OPRND (sr) = CPU (h_gr[f_r2]);
@@ -987,10 +925,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_sadd.f
   EXTRACT_FMT_SADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_SADD_CODE
-
       /* Fetch the input operands for the semantic handler.  */
-      OPRND (h_accums_1) = m32rx_h_accums_get (current_cpu, 1);
-      OPRND (h_accums_0) = m32rx_h_accums_get (current_cpu, 0);
+      OPRND (h_accums_1) = m32rx_h_accums_get (current_cpu, ((HOSTUINT) 1));
+      OPRND (h_accums_0) = m32rx_h_accums_get (current_cpu, ((HOSTUINT) 0));
 #undef OPRND
     }
     BREAK (read);
@@ -1000,9 +937,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_macwu1.f
   EXTRACT_FMT_MACWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWU1_CODE
-
       /* Fetch the input operands for the semantic handler.  */
-      OPRND (h_accums_1) = m32rx_h_accums_get (current_cpu, 1);
+      OPRND (h_accums_1) = m32rx_h_accums_get (current_cpu, ((HOSTUINT) 1));
       OPRND (src1) = CPU (h_gr[f_r1]);
       OPRND (src2) = CPU (h_gr[f_r2]);
 #undef OPRND
@@ -1014,7 +950,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_mulwu1.f
   EXTRACT_FMT_MULWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MULWU1_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (src1) = CPU (h_gr[f_r1]);
       OPRND (src2) = CPU (h_gr[f_r2]);
@@ -1027,7 +962,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define OPRND(f) par_exec->operands.fmt_sc.f
   EXTRACT_FMT_SC_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_SC_CODE
-
       /* Fetch the input operands for the semantic handler.  */
       OPRND (condbit) = CPU (h_cond);
 #undef OPRND
index 9579a32..e1e621b 100644 (file)
@@ -1,6 +1,6 @@
 /* Simulator instruction semantics for m32rx.
 
-This file is machine generated with CGEN.
+THIS FILE IS MACHINE GENERATED WITH CGEN.
 
 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
 
@@ -47,8 +47,11 @@ SEM_FN_NAME (m32rx,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = ADDSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ADDSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -77,8 +80,11 @@ SEM_FN_NAME (m32rx,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_ADD3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_ADD3_CODE
 
-  CPU (h_gr[f_r1]) = ADDSI (OPRND (sr), OPRND (slo16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ADDSI (OPRND (sr), OPRND (slo16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -107,8 +113,11 @@ SEM_FN_NAME (m32rx,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = ANDSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ANDSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -137,8 +146,11 @@ SEM_FN_NAME (m32rx,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_AND3_CODE
 
-  CPU (h_gr[f_r1]) = ANDSI (OPRND (sr), OPRND (uimm16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ANDSI (OPRND (sr), OPRND (uimm16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -167,8 +179,11 @@ SEM_FN_NAME (m32rx,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = ORSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ORSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -197,8 +212,11 @@ SEM_FN_NAME (m32rx,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_OR3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_OR3_CODE
 
-  CPU (h_gr[f_r1]) = ORSI (OPRND (sr), OPRND (ulo16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ORSI (OPRND (sr), OPRND (ulo16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -227,8 +245,11 @@ SEM_FN_NAME (m32rx,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = XORSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = XORSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -257,8 +278,11 @@ SEM_FN_NAME (m32rx,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_AND3_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_AND3_CODE
 
-  CPU (h_gr[f_r1]) = XORSI (OPRND (sr), OPRND (uimm16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = XORSI (OPRND (sr), OPRND (uimm16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -287,8 +311,11 @@ SEM_FN_NAME (m32rx,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_ADDI_VARS /* f-op1 f-r1 f-simm8 */
   EXTRACT_FMT_ADDI_CODE
 
-  CPU (h_gr[f_r1]) = ADDSI (OPRND (dr), OPRND (simm8));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ADDSI (OPRND (dr), OPRND (simm8));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -321,10 +348,16 @@ do {
   UBI temp1;SI temp0;
   temp0 = ADDSI (OPRND (dr), OPRND (sr));
   temp1 = ADDOFSI (OPRND (dr), OPRND (sr), 0);
-  CPU (h_gr[f_r1]) = temp0;
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
-  CPU (h_cond) = temp1;
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    SI opval = temp0;
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
+  {
+    UBI opval = temp1;
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -358,10 +391,16 @@ do {
   UBI temp1;SI temp0;
   temp0 = ADDSI (OPRND (sr), OPRND (simm16));
   temp1 = ADDOFSI (OPRND (sr), OPRND (simm16), 0);
-  CPU (h_gr[f_r1]) = temp0;
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
-  CPU (h_cond) = temp1;
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    SI opval = temp0;
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
+  {
+    UBI opval = temp1;
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -395,10 +434,16 @@ do {
   UBI temp1;SI temp0;
   temp0 = ADDCSI (OPRND (dr), OPRND (sr), OPRND (condbit));
   temp1 = ADDCFSI (OPRND (dr), OPRND (sr), OPRND (condbit));
-  CPU (h_gr[f_r1]) = temp0;
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
-  CPU (h_cond) = temp1;
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    SI opval = temp0;
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
+  {
+    UBI opval = temp1;
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -430,9 +475,12 @@ SEM_FN_NAME (m32rx,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_BC8_CODE
 
 if (OPRND (condbit)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp8);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -462,9 +510,12 @@ SEM_FN_NAME (m32rx,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BC24_CODE
 
 if (OPRND (condbit)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp24);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -494,9 +545,12 @@ SEM_FN_NAME (m32rx,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_BEQ_CODE
 
 if (EQSI (OPRND (src1), OPRND (src2))) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -527,9 +581,12 @@ SEM_FN_NAME (m32rx,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BEQZ_CODE
 
 if (EQSI (OPRND (src2), 0)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -560,9 +617,12 @@ SEM_FN_NAME (m32rx,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BEQZ_CODE
 
 if (GESI (OPRND (src2), 0)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -593,9 +653,12 @@ SEM_FN_NAME (m32rx,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BEQZ_CODE
 
 if (GTSI (OPRND (src2), 0)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -626,9 +689,12 @@ SEM_FN_NAME (m32rx,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BEQZ_CODE
 
 if (LESI (OPRND (src2), 0)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -659,9 +725,12 @@ SEM_FN_NAME (m32rx,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BEQZ_CODE
 
 if (LTSI (OPRND (src2), 0)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -692,9 +761,12 @@ SEM_FN_NAME (m32rx,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BEQZ_CODE
 
 if (NESI (OPRND (src2), 0)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -725,11 +797,17 @@ SEM_FN_NAME (m32rx,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_BL8_CODE
 
 do {
-  CPU (h_gr[14]) = ADDSI (ANDSI (OPRND (pc), -4), 4);
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = ADDSI (ANDSI (OPRND (pc), -4), 4);
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = OPRND (disp8);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -760,11 +838,17 @@ SEM_FN_NAME (m32rx,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BL24_CODE
 
 do {
-  CPU (h_gr[14]) = ADDSI (OPRND (pc), 4);
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = ADDSI (OPRND (pc), 4);
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = OPRND (disp24);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -796,11 +880,17 @@ SEM_FN_NAME (m32rx,bcl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
 
 if (OPRND (condbit)) {
 do {
-  CPU (h_gr[14]) = ADDSI (ANDSI (OPRND (pc), -4), 4);
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = ADDSI (ANDSI (OPRND (pc), -4), 4);
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = OPRND (disp8);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 }
 
@@ -833,11 +923,17 @@ SEM_FN_NAME (m32rx,bcl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
 
 if (OPRND (condbit)) {
 do {
-  CPU (h_gr[14]) = ADDSI (OPRND (pc), 4);
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = ADDSI (OPRND (pc), 4);
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = OPRND (disp24);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 }
 
@@ -869,9 +965,12 @@ SEM_FN_NAME (m32rx,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BC8_CODE
 
 if (NOTBI (OPRND (condbit))) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp8);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -901,9 +1000,12 @@ SEM_FN_NAME (m32rx,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_BC24_CODE
 
 if (NOTBI (OPRND (condbit))) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp24);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -933,9 +1035,12 @@ SEM_FN_NAME (m32rx,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_BEQ_CODE
 
 if (NESI (OPRND (src1), OPRND (src2))) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp16)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp16);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -965,9 +1070,12 @@ SEM_FN_NAME (m32rx,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_BRA8_VARS /* f-op1 f-r1 f-disp8 */
   EXTRACT_FMT_BRA8_CODE
 
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp8);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -995,9 +1103,12 @@ SEM_FN_NAME (m32rx,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_BRA24_VARS /* f-op1 f-r1 f-disp24 */
   EXTRACT_FMT_BRA24_CODE
 
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = OPRND (disp24);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1027,11 +1138,17 @@ SEM_FN_NAME (m32rx,bncl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
 
 if (NOTBI (OPRND (condbit))) {
 do {
-  CPU (h_gr[14]) = ADDSI (ANDSI (OPRND (pc), -4), 4);
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp8)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = ADDSI (ANDSI (OPRND (pc), -4), 4);
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = OPRND (disp8);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 }
 
@@ -1064,11 +1181,17 @@ SEM_FN_NAME (m32rx,bncl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
 
 if (NOTBI (OPRND (condbit))) {
 do {
-  CPU (h_gr[14]) = ADDSI (OPRND (pc), 4);
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_CACHE (sem_arg, OPRND (disp24)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = ADDSI (OPRND (pc), 4);
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = OPRND (disp24);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 }
 
@@ -1098,8 +1221,11 @@ SEM_FN_NAME (m32rx,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMP_CODE
 
-  CPU (h_cond) = LTSI (OPRND (src1), OPRND (src2));
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = LTSI (OPRND (src1), OPRND (src2));
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1127,8 +1253,11 @@ SEM_FN_NAME (m32rx,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_CMPI_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_CMPI_CODE
 
-  CPU (h_cond) = LTSI (OPRND (src2), OPRND (simm16));
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = LTSI (OPRND (src2), OPRND (simm16));
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1156,8 +1285,11 @@ SEM_FN_NAME (m32rx,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMP_CODE
 
-  CPU (h_cond) = LTUSI (OPRND (src1), OPRND (src2));
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = LTUSI (OPRND (src1), OPRND (src2));
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1185,8 +1317,11 @@ SEM_FN_NAME (m32rx,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_CMPI_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_CMPI_CODE
 
-  CPU (h_cond) = LTUSI (OPRND (src2), OPRND (simm16));
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = LTUSI (OPRND (src2), OPRND (simm16));
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1214,8 +1349,11 @@ SEM_FN_NAME (m32rx,cmpeq) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_CMP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMP_CODE
 
-  CPU (h_cond) = EQSI (OPRND (src1), OPRND (src2));
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = EQSI (OPRND (src1), OPRND (src2));
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1243,8 +1381,11 @@ SEM_FN_NAME (m32rx,cmpz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_CMPZ_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMPZ_CODE
 
-  CPU (h_cond) = EQSI (OPRND (src2), 0);
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = EQSI (OPRND (src2), 0);
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1273,8 +1414,11 @@ SEM_FN_NAME (m32rx,div) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_DIV_CODE
 
 if (NESI (OPRND (sr), 0)) {
-  CPU (h_gr[f_r1]) = DIVSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = DIVSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1305,8 +1449,11 @@ SEM_FN_NAME (m32rx,divu) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_DIV_CODE
 
 if (NESI (OPRND (sr), 0)) {
-  CPU (h_gr[f_r1]) = UDIVSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = UDIVSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1337,8 +1484,11 @@ SEM_FN_NAME (m32rx,rem) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_DIV_CODE
 
 if (NESI (OPRND (sr), 0)) {
-  CPU (h_gr[f_r1]) = MODSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = MODSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1369,8 +1519,11 @@ SEM_FN_NAME (m32rx,remu) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_DIV_CODE
 
 if (NESI (OPRND (sr), 0)) {
-  CPU (h_gr[f_r1]) = UMODSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = UMODSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1401,8 +1554,11 @@ SEM_FN_NAME (m32rx,divh) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_DIV_CODE
 
 if (NESI (OPRND (sr), 0)) {
-  CPU (h_gr[f_r1]) = DIVSI (EXTHISI (TRUNCSIHI (OPRND (dr))), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = DIVSI (EXTHISI (TRUNCSIHI (OPRND (dr))), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1434,9 +1590,12 @@ SEM_FN_NAME (m32rx,jc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec
   EXTRACT_FMT_JC_CODE
 
 if (OPRND (condbit)) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = ANDSI (OPRND (sr), -4);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1467,9 +1626,12 @@ SEM_FN_NAME (m32rx,jnc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_JC_CODE
 
 if (NOTBI (OPRND (condbit))) {
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = ANDSI (OPRND (sr), -4);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1503,11 +1665,17 @@ do {
   USI temp1;SI temp0;
   temp0 = ADDSI (ANDSI (OPRND (pc), -4), 4);
   temp1 = ANDSI (OPRND (sr), -4);
-  CPU (h_gr[14]) = temp0;
-  TRACE_RESULT (current_cpu, "gr-14", 'x', CPU (h_gr[14]));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, temp1));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    SI opval = temp0;
+    CPU (h_gr[((HOSTUINT) 14)]) = opval;
+    TRACE_RESULT (current_cpu, "gr-14", 'x', opval);
+  }
+  {
+    USI opval = temp1;
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1538,9 +1706,12 @@ SEM_FN_NAME (m32rx,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_JMP_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_JMP_CODE
 
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (sr), -4)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = ANDSI (OPRND (sr), -4);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1568,8 +1739,11 @@ SEM_FN_NAME (m32rx,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec
   EXTRACT_FMT_LD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LD_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (h_memory_sr);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (h_memory_sr);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1598,8 +1772,11 @@ SEM_FN_NAME (m32rx,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_LD_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LD_D_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (h_memory_add__VM_sr_slo16);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (h_memory_add__VM_sr_slo16);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1628,8 +1805,11 @@ SEM_FN_NAME (m32rx,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LDB_CODE
 
-  CPU (h_gr[f_r1]) = EXTQISI (OPRND (h_memory_sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = EXTQISI (OPRND (h_memory_sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1658,8 +1838,11 @@ SEM_FN_NAME (m32rx,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDB_D_CODE
 
-  CPU (h_gr[f_r1]) = EXTQISI (OPRND (h_memory_add__VM_sr_slo16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = EXTQISI (OPRND (h_memory_add__VM_sr_slo16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1688,8 +1871,11 @@ SEM_FN_NAME (m32rx,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LDH_CODE
 
-  CPU (h_gr[f_r1]) = EXTHISI (OPRND (h_memory_sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = EXTHISI (OPRND (h_memory_sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1718,8 +1904,11 @@ SEM_FN_NAME (m32rx,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDH_D_CODE
 
-  CPU (h_gr[f_r1]) = EXTHISI (OPRND (h_memory_add__VM_sr_slo16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = EXTHISI (OPRND (h_memory_add__VM_sr_slo16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1748,8 +1937,11 @@ SEM_FN_NAME (m32rx,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_LDB_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LDB_CODE
 
-  CPU (h_gr[f_r1]) = ZEXTQISI (OPRND (h_memory_sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ZEXTQISI (OPRND (h_memory_sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1778,8 +1970,11 @@ SEM_FN_NAME (m32rx,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_LDB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDB_D_CODE
 
-  CPU (h_gr[f_r1]) = ZEXTQISI (OPRND (h_memory_add__VM_sr_slo16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ZEXTQISI (OPRND (h_memory_add__VM_sr_slo16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1808,8 +2003,11 @@ SEM_FN_NAME (m32rx,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_LDH_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_LDH_CODE
 
-  CPU (h_gr[f_r1]) = ZEXTHISI (OPRND (h_memory_sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ZEXTHISI (OPRND (h_memory_sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1838,8 +2036,11 @@ SEM_FN_NAME (m32rx,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_LDH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDH_D_CODE
 
-  CPU (h_gr[f_r1]) = ZEXTHISI (OPRND (h_memory_add__VM_sr_slo16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ZEXTHISI (OPRND (h_memory_add__VM_sr_slo16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1872,10 +2073,16 @@ do {
   SI temp1;SI temp0;
   temp0 = OPRND (h_memory_sr);
   temp1 = ADDSI (OPRND (sr), 4);
-  CPU (h_gr[f_r1]) = temp0;
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
-  CPU (h_gr[f_r2]) = temp1;
-  TRACE_RESULT (current_cpu, "sr", 'x', CPU (h_gr[f_r2]));
+  {
+    SI opval = temp0;
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
+  {
+    SI opval = temp1;
+    CPU (h_gr[f_r2]) = opval;
+    TRACE_RESULT (current_cpu, "sr", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -1905,8 +2112,11 @@ SEM_FN_NAME (m32rx,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_LD24_VARS /* f-op1 f-r1 f-uimm24 */
   EXTRACT_FMT_LD24_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (uimm24);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (uimm24);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1934,8 +2144,11 @@ SEM_FN_NAME (m32rx,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_LDI8_VARS /* f-op1 f-r1 f-simm8 */
   EXTRACT_FMT_LDI8_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (simm8);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (simm8);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1963,8 +2176,11 @@ SEM_FN_NAME (m32rx,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_LDI16_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_LDI16_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (slo16);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (slo16);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -1993,10 +2209,16 @@ SEM_FN_NAME (m32rx,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_LOCK_CODE
 
 do {
-  CPU (h_lock) = 1;
-  TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock));
-  CPU (h_gr[f_r1]) = OPRND (h_memory_sr);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    UBI opval = 1;
+    CPU (h_lock) = opval;
+    TRACE_RESULT (current_cpu, "lock-0", 'x', opval);
+  }
+  {
+    SI opval = OPRND (h_memory_sr);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -2026,8 +2248,11 @@ SEM_FN_NAME (m32rx,machi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par
   EXTRACT_FMT_MACHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */
   EXTRACT_FMT_MACHI_A_CODE
 
-m32rx_h_accums_set (current_cpu, f_acc, SRADI (SLLDI (ADDDI (OPRND (acc), MULDI (EXTSIDI (ANDSI (OPRND (src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16))))), 8), 8));
-  TRACE_RESULT (current_cpu, "acc", 'D', m32rx_h_accums_get (current_cpu, f_acc));
+  {
+    DI opval = SRADI (SLLDI (ADDDI (OPRND (acc), MULDI (EXTSIDI (ANDSI (OPRND (src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16))))), 8), 8);
+    m32rx_h_accums_set (current_cpu, f_acc, opval);
+    TRACE_RESULT (current_cpu, "acc", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2055,8 +2280,11 @@ SEM_FN_NAME (m32rx,maclo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par
   EXTRACT_FMT_MACHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */
   EXTRACT_FMT_MACHI_A_CODE
 
-m32rx_h_accums_set (current_cpu, f_acc, SRADI (SLLDI (ADDDI (OPRND (acc), MULDI (EXTSIDI (SLLSI (OPRND (src1), 16)), EXTHIDI (TRUNCSIHI (OPRND (src2))))), 8), 8));
-  TRACE_RESULT (current_cpu, "acc", 'D', m32rx_h_accums_get (current_cpu, f_acc));
+  {
+    DI opval = SRADI (SLLDI (ADDDI (OPRND (acc), MULDI (EXTSIDI (SLLSI (OPRND (src1), 16)), EXTHIDI (TRUNCSIHI (OPRND (src2))))), 8), 8);
+    m32rx_h_accums_set (current_cpu, f_acc, opval);
+    TRACE_RESULT (current_cpu, "acc", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2084,8 +2312,11 @@ SEM_FN_NAME (m32rx,macwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MACWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWHI_CODE
 
-m32rx_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (OPRND (accum), MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16))))), 8), 8));
-  TRACE_RESULT (current_cpu, "accum", 'D', m32rx_h_accum_get (current_cpu));
+  {
+    DI opval = SRADI (SLLDI (ADDDI (OPRND (accum), MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16))))), 8), 8);
+    m32rx_h_accum_set (current_cpu, opval);
+    TRACE_RESULT (current_cpu, "accum", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2113,8 +2344,11 @@ SEM_FN_NAME (m32rx,macwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MACWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWHI_CODE
 
-m32rx_h_accum_set (current_cpu, SRADI (SLLDI (ADDDI (OPRND (accum), MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (OPRND (src2))))), 8), 8));
-  TRACE_RESULT (current_cpu, "accum", 'D', m32rx_h_accum_get (current_cpu));
+  {
+    DI opval = SRADI (SLLDI (ADDDI (OPRND (accum), MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (OPRND (src2))))), 8), 8);
+    m32rx_h_accum_set (current_cpu, opval);
+    TRACE_RESULT (current_cpu, "accum", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2142,8 +2376,11 @@ SEM_FN_NAME (m32rx,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = MULSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = MULSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2172,8 +2409,11 @@ SEM_FN_NAME (m32rx,mulhi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par
   EXTRACT_FMT_MULHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */
   EXTRACT_FMT_MULHI_A_CODE
 
-m32rx_h_accums_set (current_cpu, f_acc, SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (OPRND (src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16)))), 16), 16));
-  TRACE_RESULT (current_cpu, "acc", 'D', m32rx_h_accums_get (current_cpu, f_acc));
+  {
+    DI opval = SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (OPRND (src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16)))), 16), 16);
+    m32rx_h_accums_set (current_cpu, f_acc, opval);
+    TRACE_RESULT (current_cpu, "acc", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2201,8 +2441,11 @@ SEM_FN_NAME (m32rx,mullo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par
   EXTRACT_FMT_MULHI_A_VARS /* f-op1 f-r1 f-acc f-op23 f-r2 */
   EXTRACT_FMT_MULHI_A_CODE
 
-m32rx_h_accums_set (current_cpu, f_acc, SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (OPRND (src1), 16)), EXTHIDI (TRUNCSIHI (OPRND (src2)))), 16), 16));
-  TRACE_RESULT (current_cpu, "acc", 'D', m32rx_h_accums_get (current_cpu, f_acc));
+  {
+    DI opval = SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (OPRND (src1), 16)), EXTHIDI (TRUNCSIHI (OPRND (src2)))), 16), 16);
+    m32rx_h_accums_set (current_cpu, f_acc, opval);
+    TRACE_RESULT (current_cpu, "acc", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2230,8 +2473,11 @@ SEM_FN_NAME (m32rx,mulwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MULWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MULWHI_CODE
 
-m32rx_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16)))), 8), 8));
-  TRACE_RESULT (current_cpu, "accum", 'D', m32rx_h_accum_get (current_cpu));
+  {
+    DI opval = SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (SRASI (OPRND (src2), 16)))), 8), 8);
+    m32rx_h_accum_set (current_cpu, opval);
+    TRACE_RESULT (current_cpu, "accum", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2259,8 +2505,11 @@ SEM_FN_NAME (m32rx,mulwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MULWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MULWHI_CODE
 
-m32rx_h_accum_set (current_cpu, SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (OPRND (src2)))), 8), 8));
-  TRACE_RESULT (current_cpu, "accum", 'D', m32rx_h_accum_get (current_cpu));
+  {
+    DI opval = SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTHIDI (TRUNCSIHI (OPRND (src2)))), 8), 8);
+    m32rx_h_accum_set (current_cpu, opval);
+    TRACE_RESULT (current_cpu, "accum", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2288,8 +2537,11 @@ SEM_FN_NAME (m32rx,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec
   EXTRACT_FMT_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MV_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (sr);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (sr);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2318,8 +2570,11 @@ SEM_FN_NAME (m32rx,mvfachi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p
   EXTRACT_FMT_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVFACHI_A_CODE
 
-  CPU (h_gr[f_r1]) = TRUNCDISI (SRADI (OPRND (accs), 32));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = TRUNCDISI (SRADI (OPRND (accs), 32));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2347,8 +2602,11 @@ SEM_FN_NAME (m32rx,mvfaclo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p
   EXTRACT_FMT_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVFACHI_A_CODE
 
-  CPU (h_gr[f_r1]) = TRUNCDISI (OPRND (accs));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = TRUNCDISI (OPRND (accs));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2376,8 +2634,11 @@ SEM_FN_NAME (m32rx,mvfacmi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p
   EXTRACT_FMT_MVFACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVFACHI_A_CODE
 
-  CPU (h_gr[f_r1]) = TRUNCDISI (SRADI (OPRND (accs), 16));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = TRUNCDISI (SRADI (OPRND (accs), 16));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2405,8 +2666,11 @@ SEM_FN_NAME (m32rx,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_MVFC_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MVFC_CODE
 
-  CPU (h_gr[f_r1]) = OPRND (scr);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = OPRND (scr);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2434,8 +2698,11 @@ SEM_FN_NAME (m32rx,mvtachi_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p
   EXTRACT_FMT_MVTACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVTACHI_A_CODE
 
-m32rx_h_accums_set (current_cpu, f_accs, ORDI (ANDDI (OPRND (accs), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (OPRND (src1)), 32)));
-  TRACE_RESULT (current_cpu, "accs", 'D', m32rx_h_accums_get (current_cpu, f_accs));
+  {
+    DI opval = ORDI (ANDDI (OPRND (accs), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (OPRND (src1)), 32));
+    m32rx_h_accums_set (current_cpu, f_accs, opval);
+    TRACE_RESULT (current_cpu, "accs", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2463,8 +2730,11 @@ SEM_FN_NAME (m32rx,mvtaclo_a) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *p
   EXTRACT_FMT_MVTACHI_A_VARS /* f-op1 f-r1 f-op2 f-accs f-op3 */
   EXTRACT_FMT_MVTACHI_A_CODE
 
-m32rx_h_accums_set (current_cpu, f_accs, ORDI (ANDDI (OPRND (accs), MAKEDI (0xffffffff, 0)), ZEXTSIDI (OPRND (src1))));
-  TRACE_RESULT (current_cpu, "accs", 'D', m32rx_h_accums_get (current_cpu, f_accs));
+  {
+    DI opval = ORDI (ANDDI (OPRND (accs), MAKEDI (0xffffffff, 0)), ZEXTSIDI (OPRND (src1)));
+    m32rx_h_accums_set (current_cpu, f_accs, opval);
+    TRACE_RESULT (current_cpu, "accs", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2492,8 +2762,11 @@ SEM_FN_NAME (m32rx,mvtc) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_MVTC_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MVTC_CODE
 
-m32rx_h_cr_set (current_cpu, f_r1, OPRND (sr));
-  TRACE_RESULT (current_cpu, "dcr", 'x', m32rx_h_cr_get (current_cpu, f_r1));
+  {
+    USI opval = OPRND (sr);
+    m32rx_h_cr_set (current_cpu, f_r1, opval);
+    TRACE_RESULT (current_cpu, "dcr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2521,8 +2794,11 @@ SEM_FN_NAME (m32rx,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MV_CODE
 
-  CPU (h_gr[f_r1]) = NEGSI (OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = NEGSI (OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2578,8 +2854,11 @@ SEM_FN_NAME (m32rx,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_MV_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MV_CODE
 
-  CPU (h_gr[f_r1]) = INVSI (OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = INVSI (OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2612,8 +2891,11 @@ do {
   DI tmp_tmp1;
   tmp_tmp1 = SLLDI (OPRND (accs), OPRND (imm1));
   tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 32768));
-m32rx_h_accums_set (current_cpu, f_accd, (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0xffff0000))));
-  TRACE_RESULT (current_cpu, "accd", 'D', m32rx_h_accums_get (current_cpu, f_accd));
+  {
+    DI opval = (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0xffff0000)));
+    m32rx_h_accums_set (current_cpu, f_accd, opval);
+    TRACE_RESULT (current_cpu, "accd", 'D', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -2645,8 +2927,11 @@ do {
   DI tmp_tmp1;
   tmp_tmp1 = SLLDI (OPRND (accs), OPRND (imm1));
   tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 0x80000000));
-m32rx_h_accums_set (current_cpu, f_accd, (GTDI (tmp_tmp1, MAKEDI (32767, 0))) ? (MAKEDI (32767, 0)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0))));
-  TRACE_RESULT (current_cpu, "accd", 'D', m32rx_h_accums_get (current_cpu, f_accd));
+  {
+    DI opval = (GTDI (tmp_tmp1, MAKEDI (32767, 0))) ? (MAKEDI (32767, 0)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0)));
+    m32rx_h_accums_set (current_cpu, f_accd, opval);
+    TRACE_RESULT (current_cpu, "accd", 'D', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -2676,15 +2961,27 @@ SEM_FN_NAME (m32rx,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_RTE_CODE
 
 do {
-  CPU (h_sm) = OPRND (h_bsm_0);
-  TRACE_RESULT (current_cpu, "sm-0", 'x', CPU (h_sm));
-  CPU (h_ie) = OPRND (h_bie_0);
-  TRACE_RESULT (current_cpu, "ie-0", 'x', CPU (h_ie));
-  CPU (h_cond) = OPRND (h_bcond_0);
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (h_bpc_0), -4)));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    UBI opval = OPRND (h_bsm_0);
+    CPU (h_sm) = opval;
+    TRACE_RESULT (current_cpu, "sm-0", 'x', opval);
+  }
+  {
+    UBI opval = OPRND (h_bie_0);
+    CPU (h_ie) = opval;
+    TRACE_RESULT (current_cpu, "ie-0", 'x', opval);
+  }
+  {
+    UBI opval = OPRND (h_bcond_0);
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
+  {
+    USI opval = ANDSI (OPRND (h_bpc_0), -4);
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -2712,8 +3009,11 @@ SEM_FN_NAME (m32rx,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SETH_VARS /* f-op1 f-r1 f-op2 f-r2 f-hi16 */
   EXTRACT_FMT_SETH_CODE
 
-  CPU (h_gr[f_r1]) = SLLSI (OPRND (hi16), 16);
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SLLSI (OPRND (hi16), 16);
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2741,8 +3041,11 @@ SEM_FN_NAME (m32rx,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = SLLSI (OPRND (dr), ANDSI (OPRND (sr), 31));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SLLSI (OPRND (dr), ANDSI (OPRND (sr), 31));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2771,8 +3074,11 @@ SEM_FN_NAME (m32rx,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_SLL3_CODE
 
-  CPU (h_gr[f_r1]) = SLLSI (OPRND (sr), ANDSI (OPRND (simm16), 31));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SLLSI (OPRND (sr), ANDSI (OPRND (simm16), 31));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2801,8 +3107,11 @@ SEM_FN_NAME (m32rx,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */
   EXTRACT_FMT_SLLI_CODE
 
-  CPU (h_gr[f_r1]) = SLLSI (OPRND (dr), OPRND (uimm5));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SLLSI (OPRND (dr), OPRND (uimm5));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2831,8 +3140,11 @@ SEM_FN_NAME (m32rx,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = SRASI (OPRND (dr), ANDSI (OPRND (sr), 31));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SRASI (OPRND (dr), ANDSI (OPRND (sr), 31));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2861,8 +3173,11 @@ SEM_FN_NAME (m32rx,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_SLL3_CODE
 
-  CPU (h_gr[f_r1]) = SRASI (OPRND (sr), ANDSI (OPRND (simm16), 31));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SRASI (OPRND (sr), ANDSI (OPRND (simm16), 31));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2891,8 +3206,11 @@ SEM_FN_NAME (m32rx,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */
   EXTRACT_FMT_SLLI_CODE
 
-  CPU (h_gr[f_r1]) = SRASI (OPRND (dr), OPRND (uimm5));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SRASI (OPRND (dr), OPRND (uimm5));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2921,8 +3239,11 @@ SEM_FN_NAME (m32rx,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = SRLSI (OPRND (dr), ANDSI (OPRND (sr), 31));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SRLSI (OPRND (dr), ANDSI (OPRND (sr), 31));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2951,8 +3272,11 @@ SEM_FN_NAME (m32rx,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SLL3_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_SLL3_CODE
 
-  CPU (h_gr[f_r1]) = SRLSI (OPRND (sr), ANDSI (OPRND (simm16), 31));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SRLSI (OPRND (sr), ANDSI (OPRND (simm16), 31));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -2981,8 +3305,11 @@ SEM_FN_NAME (m32rx,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SLLI_VARS /* f-op1 f-r1 f-shift-op2 f-uimm5 */
   EXTRACT_FMT_SLLI_CODE
 
-  CPU (h_gr[f_r1]) = SRLSI (OPRND (dr), OPRND (uimm5));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SRLSI (OPRND (dr), OPRND (uimm5));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3011,8 +3338,11 @@ SEM_FN_NAME (m32rx,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exec
   EXTRACT_FMT_ST_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ST_CODE
 
-SETMEMSI (current_cpu, OPRND (src2), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, OPRND (src2)));
+  {
+    SI opval = OPRND (src1);
+    SETMEMSI (current_cpu, OPRND (src2), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3040,8 +3370,11 @@ SEM_FN_NAME (m32rx,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_ST_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_ST_D_CODE
 
-SETMEMSI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16))));
+  {
+    SI opval = OPRND (src1);
+    SETMEMSI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3069,8 +3402,11 @@ SEM_FN_NAME (m32rx,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_STB_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_STB_CODE
 
-SETMEMQI (current_cpu, OPRND (src2), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, OPRND (src2)));
+  {
+    QI opval = OPRND (src1);
+    SETMEMQI (current_cpu, OPRND (src2), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3098,8 +3434,11 @@ SEM_FN_NAME (m32rx,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_STB_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_STB_D_CODE
 
-SETMEMQI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMQI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16))));
+  {
+    QI opval = OPRND (src1);
+    SETMEMQI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3127,8 +3466,11 @@ SEM_FN_NAME (m32rx,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_STH_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_STH_CODE
 
-SETMEMHI (current_cpu, OPRND (src2), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, OPRND (src2)));
+  {
+    HI opval = OPRND (src1);
+    SETMEMHI (current_cpu, OPRND (src2), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3156,8 +3498,11 @@ SEM_FN_NAME (m32rx,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_STH_D_VARS /* f-op1 f-r1 f-op2 f-r2 f-simm16 */
   EXTRACT_FMT_STH_D_CODE
 
-SETMEMHI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMHI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16))));
+  {
+    HI opval = OPRND (src1);
+    SETMEMHI (current_cpu, ADDSI (OPRND (src2), OPRND (slo16)), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3188,10 +3533,16 @@ SEM_FN_NAME (m32rx,st_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par
 do {
   SI tmp_new_src2;
   tmp_new_src2 = ADDSI (OPRND (src2), 4);
-SETMEMSI (current_cpu, tmp_new_src2, OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2));
-  CPU (h_gr[f_r2]) = tmp_new_src2;
-  TRACE_RESULT (current_cpu, "src2", 'x', CPU (h_gr[f_r2]));
+  {
+    SI opval = OPRND (src1);
+    SETMEMSI (current_cpu, tmp_new_src2, opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
+  {
+    SI opval = tmp_new_src2;
+    CPU (h_gr[f_r2]) = opval;
+    TRACE_RESULT (current_cpu, "src2", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -3224,10 +3575,16 @@ SEM_FN_NAME (m32rx,st_minus) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *pa
 do {
   SI tmp_new_src2;
   tmp_new_src2 = SUBSI (OPRND (src2), 4);
-SETMEMSI (current_cpu, tmp_new_src2, OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, tmp_new_src2));
-  CPU (h_gr[f_r2]) = tmp_new_src2;
-  TRACE_RESULT (current_cpu, "src2", 'x', CPU (h_gr[f_r2]));
+  {
+    SI opval = OPRND (src1);
+    SETMEMSI (current_cpu, tmp_new_src2, opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
+  {
+    SI opval = tmp_new_src2;
+    CPU (h_gr[f_r2]) = opval;
+    TRACE_RESULT (current_cpu, "src2", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -3257,8 +3614,11 @@ SEM_FN_NAME (m32rx,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_ADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_ADD_CODE
 
-  CPU (h_gr[f_r1]) = SUBSI (OPRND (dr), OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = SUBSI (OPRND (dr), OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3291,10 +3651,16 @@ do {
   UBI temp1;SI temp0;
   temp0 = SUBSI (OPRND (dr), OPRND (sr));
   temp1 = SUBOFSI (OPRND (dr), OPRND (sr), 0);
-  CPU (h_gr[f_r1]) = temp0;
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
-  CPU (h_cond) = temp1;
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    SI opval = temp0;
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
+  {
+    UBI opval = temp1;
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -3328,10 +3694,16 @@ do {
   UBI temp1;SI temp0;
   temp0 = SUBCSI (OPRND (dr), OPRND (sr), OPRND (condbit));
   temp1 = SUBCFSI (OPRND (dr), OPRND (sr), OPRND (condbit));
-  CPU (h_gr[f_r1]) = temp0;
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
-  CPU (h_cond) = temp1;
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    SI opval = temp0;
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
+  {
+    UBI opval = temp1;
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -3363,13 +3735,22 @@ SEM_FN_NAME (m32rx,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_TRAP_CODE
 
 do {
-m32rx_h_cr_set (current_cpu, 6, ADDSI (OPRND (pc), 4));
-  TRACE_RESULT (current_cpu, "cr-6", 'x', m32rx_h_cr_get (current_cpu, 6));
-m32rx_h_cr_set (current_cpu, 0, ANDSI (SLLSI (OPRND (h_cr_0), 8), 65408));
-  TRACE_RESULT (current_cpu, "cr-0", 'x', m32rx_h_cr_get (current_cpu, 0));
-  BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, m32r_trap (current_cpu, OPRND (uimm4))));
-  taken_p = 1;
-  TRACE_RESULT (current_cpu, "pc", 'x', new_pc);
+  {
+    USI opval = ADDSI (OPRND (pc), 4);
+    m32rx_h_cr_set (current_cpu, ((HOSTUINT) 6), opval);
+    TRACE_RESULT (current_cpu, "cr-6", 'x', opval);
+  }
+  {
+    USI opval = ANDSI (SLLSI (OPRND (h_cr_0), 8), 65408);
+    m32rx_h_cr_set (current_cpu, ((HOSTUINT) 0), opval);
+    TRACE_RESULT (current_cpu, "cr-0", 'x', opval);
+  }
+  {
+    SI opval = m32r_trap (current_cpu, OPRND (uimm4));
+    BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, opval));
+    taken_p = 1;
+    TRACE_RESULT (current_cpu, "pc", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -3399,11 +3780,17 @@ SEM_FN_NAME (m32rx,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
 
 do {
 if (OPRND (h_lock_0)) {
-SETMEMSI (current_cpu, OPRND (src2), OPRND (src1));
-  TRACE_RESULT (current_cpu, "memory", 'x', GETMEMSI (current_cpu, OPRND (src2)));
-}
-  CPU (h_lock) = 0;
-  TRACE_RESULT (current_cpu, "lock-0", 'x', CPU (h_lock));
+  {
+    SI opval = OPRND (src1);
+    SETMEMSI (current_cpu, OPRND (src2), opval);
+    TRACE_RESULT (current_cpu, "memory", 'x', opval);
+  }
+}
+  {
+    UBI opval = 0;
+    CPU (h_lock) = opval;
+    TRACE_RESULT (current_cpu, "lock-0", 'x', opval);
+  }
 } while (0);
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
@@ -3432,8 +3819,11 @@ SEM_FN_NAME (m32rx,satb) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SATB_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_SATB_CODE
 
-  CPU (h_gr[f_r1]) = (GESI (OPRND (sr), 127)) ? (127) : (LESI (OPRND (sr), -128)) ? (-128) : (OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = (GESI (OPRND (sr), 127)) ? (127) : (LESI (OPRND (sr), -128)) ? (-128) : (OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3462,8 +3852,11 @@ SEM_FN_NAME (m32rx,sath) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SATB_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_SATB_CODE
 
-  CPU (h_gr[f_r1]) = (GESI (OPRND (sr), 32767)) ? (32767) : (LESI (OPRND (sr), -32768)) ? (-32768) : (OPRND (sr));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = (GESI (OPRND (sr), 32767)) ? (32767) : (LESI (OPRND (sr), -32768)) ? (-32768) : (OPRND (sr));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3492,8 +3885,11 @@ SEM_FN_NAME (m32rx,sat) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_exe
   EXTRACT_FMT_SAT_VARS /* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
   EXTRACT_FMT_SAT_CODE
 
-  CPU (h_gr[f_r1]) = ((OPRND (condbit)) ? (((LTSI (OPRND (sr), 0)) ? (2147483647) : (0x80000000))) : (OPRND (sr)));
-  TRACE_RESULT (current_cpu, "dr", 'x', CPU (h_gr[f_r1]));
+  {
+    SI opval = ((OPRND (condbit)) ? (((LTSI (OPRND (sr), 0)) ? (2147483647) : (0x80000000))) : (OPRND (sr)));
+    CPU (h_gr[f_r1]) = opval;
+    TRACE_RESULT (current_cpu, "dr", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3522,8 +3918,11 @@ SEM_FN_NAME (m32rx,pcmpbz) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_CMPZ_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_CMPZ_CODE
 
-  CPU (h_cond) = (EQSI (ANDSI (OPRND (src2), 255), 0)) ? (1) : (EQSI (ANDSI (OPRND (src2), 65280), 0)) ? (1) : (EQSI (ANDSI (OPRND (src2), 16711680), 0)) ? (1) : (EQSI (ANDSI (OPRND (src2), 0xff000000), 0)) ? (1) : (0);
-  TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond));
+  {
+    UBI opval = (EQSI (ANDSI (OPRND (src2), 255), 0)) ? (1) : (EQSI (ANDSI (OPRND (src2), 65280), 0)) ? (1) : (EQSI (ANDSI (OPRND (src2), 16711680), 0)) ? (1) : (EQSI (ANDSI (OPRND (src2), 0xff000000), 0)) ? (1) : (0);
+    CPU (h_cond) = opval;
+    TRACE_RESULT (current_cpu, "condbit", 'x', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3551,8 +3950,11 @@ SEM_FN_NAME (m32rx,sadd) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex
   EXTRACT_FMT_SADD_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_SADD_CODE
 
-m32rx_h_accums_set (current_cpu, 0, ADDDI (SRADI (OPRND (h_accums_1), 16), OPRND (h_accums_0)));
-  TRACE_RESULT (current_cpu, "accums-0", 'D', m32rx_h_accums_get (current_cpu, 0));
+  {
+    DI opval = ADDDI (SRADI (OPRND (h_accums_1), 16), OPRND (h_accums_0));
+    m32rx_h_accums_set (current_cpu, ((HOSTUINT) 0), opval);
+    TRACE_RESULT (current_cpu, "accums-0", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3579,8 +3981,11 @@ SEM_FN_NAME (m32rx,macwu1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MACWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWU1_CODE
 
-m32rx_h_accums_set (current_cpu, 1, SRADI (SLLDI (ADDDI (OPRND (h_accums_1), MULDI (EXTSIDI (OPRND (src1)), EXTSIDI (ANDSI (OPRND (src2), 65535)))), 8), 8));
-  TRACE_RESULT (current_cpu, "accums-1", 'D', m32rx_h_accums_get (current_cpu, 1));
+  {
+    DI opval = SRADI (SLLDI (ADDDI (OPRND (h_accums_1), MULDI (EXTSIDI (OPRND (src1)), EXTSIDI (ANDSI (OPRND (src2), 65535)))), 8), 8);
+    m32rx_h_accums_set (current_cpu, ((HOSTUINT) 1), opval);
+    TRACE_RESULT (current_cpu, "accums-1", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3608,8 +4013,11 @@ SEM_FN_NAME (m32rx,msblo) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_e
   EXTRACT_FMT_MACWHI_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWHI_CODE
 
-m32rx_h_accum_set (current_cpu, SRADI (SLLDI (SUBDI (OPRND (accum), SRADI (SLLDI (MULDI (EXTHIDI (TRUNCSIHI (OPRND (src1))), EXTHIDI (TRUNCSIHI (OPRND (src2)))), 32), 16)), 8), 8));
-  TRACE_RESULT (current_cpu, "accum", 'D', m32rx_h_accum_get (current_cpu));
+  {
+    DI opval = SRADI (SLLDI (SUBDI (OPRND (accum), SRADI (SLLDI (MULDI (EXTHIDI (TRUNCSIHI (OPRND (src1))), EXTHIDI (TRUNCSIHI (OPRND (src2)))), 32), 16)), 8), 8);
+    m32rx_h_accum_set (current_cpu, opval);
+    TRACE_RESULT (current_cpu, "accum", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3637,8 +4045,11 @@ SEM_FN_NAME (m32rx,mulwu1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MULWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MULWU1_CODE
 
-m32rx_h_accums_set (current_cpu, 1, SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTSIDI (ANDSI (OPRND (src2), 65535))), 16), 16));
-  TRACE_RESULT (current_cpu, "accums-1", 'D', m32rx_h_accums_get (current_cpu, 1));
+  {
+    DI opval = SRADI (SLLDI (MULDI (EXTSIDI (OPRND (src1)), EXTSIDI (ANDSI (OPRND (src2), 65535))), 16), 16);
+    m32rx_h_accums_set (current_cpu, ((HOSTUINT) 1), opval);
+    TRACE_RESULT (current_cpu, "accums-1", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);
 
@@ -3666,8 +4077,11 @@ SEM_FN_NAME (m32rx,maclh1) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_
   EXTRACT_FMT_MACWU1_VARS /* f-op1 f-r1 f-op2 f-r2 */
   EXTRACT_FMT_MACWU1_CODE
 
-m32rx_h_accums_set (current_cpu, 1, SRADI (SLLDI (ADDDI (OPRND (h_accums_1), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (OPRND (src1))), SRASI (OPRND (src2), 16))), 16)), 8), 8));
-  TRACE_RESULT (current_cpu, "accums-1", 'D', m32rx_h_accums_get (current_cpu, 1));
+  {
+    DI opval = SRADI (SLLDI (ADDDI (OPRND (h_accums_1), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (OPRND (src1))), SRASI (OPRND (src2), 16))), 16)), 8), 8);
+    m32rx_h_accums_set (current_cpu, ((HOSTUINT) 1), opval);
+    TRACE_RESULT (current_cpu, "accums-1", 'D', opval);
+  }
 
   PROFILE_COUNT_INSN (current_cpu, 0, abuf->idesc->num);