import gdb-1999-09-28 snapshot
[deliverable/binutils-gdb.git] / sim / common / genmloop.sh
index 8a1b8d67dba1a36a937d76915338f160503bcb3d..d3e17b085dfcd2eca6e1d3f314c46ccba3f16c3f 100644 (file)
@@ -85,6 +85,8 @@
 #
 # -parallel-read: support parallel execution with read-before-exec support.
 # -parallel-write: support parallel execution with write-after-exec support.
+# -parallel-generic-write: support parallel execution with generic queued
+#       writes.
 #
 #      One of these options is specified in addition to -simple, -scache,
 #      -pbb.  Note that while the code can determine if the cpu supports
 #      technically unnecessary], having this option cuts down on the clutter
 #      in the result.
 #
+# -parallel-only: semantic code only supports parallel version of insn
+#
+#      Semantic code only supports parallel versions of each insn.
+#      Things can be sped up by generating both serial and parallel versions
+#      and is better suited to mixed parallel architectures like the m32r.
+#
 # -switch file: specify file containing semantics implemented as a switch()
 #
 # -cpu <cpu-family>
@@ -116,6 +124,7 @@ type=mono
 #full_switch=
 #pbb=
 parallel=no
+parallel_only=no
 switch=
 cpu="unknown"
 infile=""
@@ -134,6 +143,8 @@ do
        -no-parallel) ;;
        -parallel-read) parallel=read ;;
        -parallel-write) parallel=write ;;
+       -parallel-generic-write) parallel=genwrite ;;
+       -parallel-only) parallel_only=yes ;;
        -switch) shift ; switch=$1 ;;
        -cpu) shift ; cpu=$1 ;;
        -infile) shift ; infile=$1 ;;
@@ -189,22 +200,36 @@ fi
 
 echo ""
 echo "/* HAVE_PARALLEL_INSNS: non-zero if cpu can parallelly execute > 1 insn.  */"
-if [ x$parallel != xno ] ; then
-       echo "#define HAVE_PARALLEL_INSNS 1"
-       if [ x$parallel = xread ] ; then
-           echo "/* Parallel execution is supported by read-before-exec.  */"
-           echo "#define WITH_PARALLEL_READ 1"
-           echo "#define WITH_PARALLEL_WRITE 0"
-       else
-           echo "/* Parallel execution is supported by write-after-exec.  */"
-           echo "#define WITH_PARALLEL_READ 0"
-           echo "#define WITH_PARALLEL_WRITE 1"
-       fi
-else
-       echo "#define HAVE_PARALLEL_INSNS 0"
-       echo "#define WITH_PARALLEL_READ 0"
-       echo "#define WITH_PARALLEL_WRITE 0"
-fi
+# blah blah blah, other ways to do this, blah blah blah
+case x$parallel in
+xno)
+    echo "#define HAVE_PARALLEL_INSNS 0"
+    echo "#define WITH_PARALLEL_READ 0"
+    echo "#define WITH_PARALLEL_WRITE 0"
+    echo "#define WITH_PARALLEL_GENWRITE 0"
+    ;;
+xread)
+    echo "#define HAVE_PARALLEL_INSNS 1"
+    echo "/* Parallel execution is supported by read-before-exec.  */"
+    echo "#define WITH_PARALLEL_READ 1"
+    echo "#define WITH_PARALLEL_WRITE 0"
+    echo "#define WITH_PARALLEL_GENWRITE 0"
+    ;;
+xwrite)
+    echo "#define HAVE_PARALLEL_INSNS 1"
+    echo "/* Parallel execution is supported by write-after-exec.  */"
+    echo "#define WITH_PARALLEL_READ 0"
+    echo "#define WITH_PARALLEL_WRITE 1"
+    echo "#define WITH_PARALLEL_GENWRITE 0"
+    ;;
+xgenwrite)
+    echo "#define HAVE_PARALLEL_INSNS 1"
+    echo "/* Parallel execution is supported by generic write-after-exec.  */"
+    echo "#define WITH_PARALLEL_READ 0"
+    echo "#define WITH_PARALLEL_WRITE 0"
+    echo "#define WITH_PARALLEL_GENWRITE 1"
+    ;;
+esac
 
 if [ "x$switch" != x ] ; then
        echo ""
@@ -360,13 +385,15 @@ void
 
 EOF
 
-if [ x$parallel != xno ] ; then
-  cat << EOF
+case x$parallel in
+xread | xwrite)
+    cat << EOF
   PAREXEC pbufs[MAX_PARALLEL_INSNS];
   PAREXEC *par_exec;
 
 EOF
-fi
+    ;;
+esac
 
 # Any initialization code before looping starts.
 # Note that this code may declare some locals.
@@ -624,7 +651,7 @@ if [ x$scache = xyes -a x$parallel != xno ] ; then
 
 static INLINE SCACHE *
 @cpu@_scache_lookup (SIM_CPU *current_cpu, PCADDR vpc, SCACHE *scache,
-                     unsigned int hash_mask, int *last_insn_p, int FAST_P)
+                     unsigned int hash_mask, int FAST_P)
 {
   /* First step: look up current insn in hash table.  */
   SCACHE *sc = scache + SCACHE_HASH_PC (vpc, hash_mask);
@@ -636,7 +663,7 @@ static INLINE SCACHE *
       if (! FAST_P)
        PROFILE_COUNT_SCACHE_MISS (current_cpu);
 
-#define SET_LAST_INSN_P(last_p) do { *last_insn_p = (last_p); } while (0)
+#define SET_LAST_INSN_P(last_p) do { sc->last_insn_p = (last_p); } while (0)
 /* begin extract-scache */
 EOF
 
@@ -1118,13 +1145,15 @@ void
 
 EOF
 
-if [ x$parallel != xno ] ; then
-  cat << EOF
+case x$parallel in
+xread | xwrite)
+    cat << EOF
   PAREXEC pbufs[MAX_PARALLEL_INSNS];
   PAREXEC *par_exec = &pbufs[0];
 
 EOF
-fi
+    ;;
+esac
 
 # Any initialization code before looping starts.
 # Note that this code may declare some locals.
@@ -1208,13 +1237,15 @@ void
 
 EOF
 
-if [ x$parallel != xno ] ; then
-  cat << EOF
+case x$parallel in
+xread | xwrite)
+    cat << EOF
   PAREXEC pbufs[MAX_PARALLEL_INSNS];
   PAREXEC *par_exec = &pbufs[0];
 
 EOF
-fi
+    ;;
+esac
 
 # Any initialization code before looping starts.
 # Note that this code may declare some locals.
This page took 0.026073 seconds and 4 git commands to generate.