* compile.c (init_pointers): Abort if wreg never gets initialized.
authorKazu Hirata <kazu@codesourcery.com>
Wed, 5 Feb 2003 23:10:27 +0000 (23:10 +0000)
committerKazu Hirata <kazu@codesourcery.com>
Wed, 5 Feb 2003 23:10:27 +0000 (23:10 +0000)
(sim_resume): Fix the handling of exts.w and extu.w.

sim/h8300/ChangeLog
sim/h8300/compile.c

index 62fd0735cc0a00f132dca87922d707f2b1a145b4..2753416a7681d853008f25ca486272c45efa2e2f 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-05  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * compile.c (init_pointers): Abort if wreg never gets initialized.
+       (sim_resume): Fix the handling of exts.w and extu.w.
+
 2003-01-31  Kazu Hirata  <kazu@cs.umass.edu>
 
        * compile.c (sim_resume): Fix the handling of bxor.
index e84589904a6b304f85f82778e4d81ba84aeaf27a..2a066a3fc1d3d8ec5795c102cbc033cfa2c6d208 100644 (file)
@@ -753,6 +753,7 @@ init_pointers (void)
                }
              p++;
            }
+         wreg[i] = wreg[i + 8] = 0;
          while (q < u)
            {
              if (*q == 0x2233)
@@ -765,6 +766,8 @@ init_pointers (void)
                }
              q++;
            }
+         if (wreg[i] == 0 || wreg[i + 8] == 0)
+           abort ();
          cpu.regs[i] = 0;
          lreg[i] = &cpu.regs[i];
        }
@@ -1606,7 +1609,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
            goto next;
          }
        case O (O_EXTS, SW):
-         rd = GET_B_REG (code->src.reg + 8) & 0xff; /* Yes, src, not dst.  */
+         rd = GET_W_REG (code->src.reg) & 0xff; /* Yes, src, not dst.  */
          ea = rd & 0x80 ? -256 : 0;
          res = rd + ea;
          goto log16;
@@ -1616,7 +1619,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
          res = rd + ea;
          goto log32;
        case O (O_EXTU, SW):
-         rd = GET_B_REG (code->src.reg + 8) & 0xff;
+         rd = GET_W_REG (code->src.reg) & 0xff;
          ea = 0;
          res = rd + ea;
          goto log16;
This page took 0.037883 seconds and 4 git commands to generate.