* gencode.c, interp.c: Snapshot current simulator code.
authorJeff Law <law@redhat.com>
Tue, 26 Nov 1996 20:40:19 +0000 (20:40 +0000)
committerJeff Law <law@redhat.com>
Tue, 26 Nov 1996 20:40:19 +0000 (20:40 +0000)
(crude) hashing works, along with dispatch to the OP_* functions.

sim/mn10300/ChangeLog
sim/mn10300/gencode.c
sim/mn10300/mn10300_sim.h

index 7f668298913bec4627605f813a85012d1a20cbbd..ca03f32d3735efa6ed84f6be22d35ecd91dd514b 100644 (file)
@@ -1,3 +1,7 @@
+Tue Nov 26 13:36:01 1996  Jeffrey A Law  (law@cygnus.com)
+
+       * gencode.c, interp.c: Snapshot current simulator code.
+
 Mon Nov 25 12:46:38 1996  Jeffrey A Law  (law@cygnus.com)
 
        * Makefile.in, config.in, configure, configure.in: New files.
index d2f5e3b372cc1a2c1a9c90aacd6ca8a22f9fc3e8..543bce61961563639a1d42ca1bef2290f28f3cfb 100644 (file)
@@ -95,8 +95,27 @@ write_opcodes ()
   
   for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
     {
-      printf ("  { 0x%x,0x%x,OP_%X,",
-             opcode->opcode, opcode->mask, opcode->opcode);
+      int size;
+
+      if (opcode->format == FMT_S0)
+       size = 1;
+      else if (opcode->format == FMT_S1
+               || opcode->format == FMT_D0)
+       size = 2;
+      else if (opcode->format == FMT_S2
+               || opcode->format == FMT_D1)
+       size = 3;
+      else if (opcode->format == FMT_S4)
+       size = 5;
+      else if (opcode->format == FMT_D2)
+       size = 4;
+      else if (opcode->format == FMT_D4)
+       size = 6;
+      else
+       size = 7;
+
+      printf ("  { 0x%x,0x%x,OP_%X,%d,",
+             opcode->opcode, opcode->mask, opcode->opcode, size);
       
       Opcodes[curop++] = opcode->opcode;
 
@@ -139,5 +158,5 @@ write_opcodes ()
 
       printf ("}},\n");
     }
-  printf ("{ 0,0,NULL,0,{0,0,0,0,0,0}},\n};\n");
+  printf ("{ 0,0,NULL,0,0,{0,0,0,0,0,0}},\n};\n");
 }
index b18dee8c5d1f801c14d219f57f104c8418c04f81..4170c26d278e8ce0f1e7a859cca7b8bbf6987fed 100644 (file)
@@ -50,6 +50,7 @@ struct simops
   long opcode;
   long mask;
   void (*func)();
+  int length;
   int numops;
   int operands[16];
 };