]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/fr30/sem.c
import gdb-1999-10-04 snapshot
[thirdparty/binutils-gdb.git] / sim / fr30 / sem.c
index 58896987b92d252e3e4cd106d7345129d5981285..0d83f36aa5d0cc32e17c5f49084e3de583eee07e 100644 (file)
@@ -55,13 +55,15 @@ SEM_FN_NAME (fr30bf,x_invalid) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
 
   {
-#if WITH_SCACHE
-    /* Update the recorded pc in the cpu state struct.  */
+    /* Update the recorded pc in the cpu state struct.
+       Only necessary for WITH_SCACHE case, but to avoid the
+       conditional compilation ....  */
     SET_H_PC (pc);
-#endif
-    sim_engine_invalid_insn (current_cpu, pc);
-    sim_io_error (CPU_STATE (current_cpu), "invalid insn not handled\n");
-    /* NOTREACHED */
+    /* Virtual insns have zero size.  Overwrite vpc with address of next insn
+       using the default-insn-bitsize spec.  When executing insns in parallel
+       we may want to queue the fault and continue execution.  */
+    vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
+    vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
   }
 
   return vpc;
@@ -3385,7 +3387,7 @@ SEM_FN_NAME (fr30bf,bnod) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
 
 {
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 }
 
   return vpc;
@@ -3403,7 +3405,7 @@ SEM_FN_NAME (fr30bf,bno) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   IADDR UNUSED pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
 
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 
   return vpc;
 #undef FLD
@@ -4596,7 +4598,7 @@ SEM_FN_NAME (fr30bf,copop) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   IADDR UNUSED pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
 
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 
   return vpc;
 #undef FLD
@@ -4613,7 +4615,7 @@ SEM_FN_NAME (fr30bf,copld) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   IADDR UNUSED pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
 
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 
   return vpc;
 #undef FLD
@@ -4630,7 +4632,7 @@ SEM_FN_NAME (fr30bf,copst) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   IADDR UNUSED pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
 
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 
   return vpc;
 #undef FLD
@@ -4647,7 +4649,7 @@ SEM_FN_NAME (fr30bf,copsv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   IADDR UNUSED pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
 
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 
   return vpc;
 #undef FLD
@@ -4664,7 +4666,7 @@ SEM_FN_NAME (fr30bf,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
   IADDR UNUSED pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
 
-do { } while (0); /*nop*/
+((void) 0); /*nop*/
 
   return vpc;
 #undef FLD
@@ -5701,7 +5703,9 @@ SEM_FN_NAME (fr30bf,init_idesc_table) (SIM_CPU *current_cpu)
 
   for (sf = &sem_fns[0]; sf->fn != 0; ++sf)
     {
-      int valid_p = CGEN_INSN_MACH_HAS_P (idesc_table[sf->index].idata, mach_num);
+      const CGEN_INSN *insn = idesc_table[sf->index].idata;
+      int valid_p = (CGEN_INSN_VIRTUAL_P (insn)
+                    || CGEN_INSN_MACH_HAS_P (insn, mach_num));
 #if FAST_P
       if (valid_p)
        idesc_table[sf->index].sem_fast = sf->fn;