]> sourceware.org Git - cgen.git/commitdiff
* simple sim fix
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 4 Dec 2000 18:34:45 +0000 (18:34 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 4 Dec 2000 18:34:45 +0000 (18:34 +0000)
2000-12-04  Frank Ch. Eigler  <fche@redhat.com>

* utils-sim.scm (gen-define-argbuf-macro): Handle sfmt=#f case, to be
used by simple/non-scache simulators.
* sim-cpu.scm (-gen-read-case): Call gen-define/undef-field-macro
regardless of with-scache?.
(-gen-write-case, -gen-no-scache-semantic-fn, -gen-sem-case): Ditto.

ChangeLog
sim-cpu.scm
utils-sim.scm

index 4c6984dc6d4eb244f7d8be6a661ff223e076afc4..6964456f791f2502a0dd63873cc2ef2d2357dd10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-12-04  Frank Ch. Eigler  <fche@redhat.com>
+
+       * utils-sim.scm (gen-define-argbuf-macro): Handle sfmt=#f case, to be
+       used by simple/non-scache simulators.
+       * sim-cpu.scm (-gen-read-case): Call gen-define/undef-field-macro
+       regardless of with-scache?.
+       (-gen-write-case, -gen-no-scache-semantic-fn, -gen-sem-case): Ditto.
+
 2000-12-03  Ben Elliston  <bje@redhat.com>
 
        * desc-cpu.scm (cgen-desc.h): Clarify generated filenames.
index d63c9e0fbae1a86ff09a1c4b23c5dbeb18bb6293..27c5f0aafcfac3deea12a6552b8878c9a1ede0e7 100644 (file)
@@ -339,17 +339,13 @@ void
    "    CASE (read, READ_" (string-upcase (gen-sym sfmt)) ") : "
    "/* " (obj:comment sfmt) " */\n"
    "    {\n"
-   (if (with-scache?)
-       (gen-define-field-macro sfmt)
-       "")
+   (gen-define-field-macro (if (with-scache?) sfmt #f))
    (gen-define-parallel-operand-macro sfmt)
    (gen-define-ifields (sfmt-iflds sfmt) (sfmt-length sfmt) "      " #f)
    (gen-extract-ifields (sfmt-iflds sfmt) (sfmt-length sfmt) "      " #f)
    (-gen-read-args sfmt)
    (gen-undef-parallel-operand-macro sfmt)
-   (if (with-scache?)
-       (gen-undef-field-macro sfmt)
-       "")
+   (gen-undef-field-macro sfmt)
    "    }\n"
    "    BREAK (read);\n\n"
    )
@@ -412,9 +408,7 @@ void
        /indent
        "    const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;\n")
        "")
-   (if (with-scache?)
-       (gen-define-field-macro sfmt)
-       "")
+   (gen-define-field-macro (if (with-scache?) sfmt #f))
    (gen-define-parallel-operand-macro sfmt)
    /indent
    "    int UNUSED written = abuf->written;\n"
@@ -439,9 +433,7 @@ void
        (string-list /indent "  SEM_BRANCH_FINI (vpc);\n")
        "")
    (gen-undef-parallel-operand-macro sfmt)
-   (if (with-scache?)
-       (gen-undef-field-macro sfmt)
-       "")
+   (gen-undef-field-macro sfmt)
    /indent "  }\n"
    (if insn
        (string-list /indent "  NEXT (vpc);\n")
@@ -629,6 +621,7 @@ SEM_FN_NAME (@cpu@,init_idesc_table) (SIM_CPU *current_cpu)
         "")
      "  SEM_STATUS status = 0;\n" ; ??? wip
      "  ARGBUF *abuf = SEM_ARGBUF (sem_arg);\n"
+     (gen-define-field-macro (if (with-scache?) (insn-sfmt insn) #f))
      ; Unconditionally written operands are not recorded here.
      "  int UNUSED written = 0;\n"
      "  IADDR UNUSED pc = GET_H_PC ();\n"
@@ -659,6 +652,7 @@ SEM_FN_NAME (@cpu@,init_idesc_table) (SIM_CPU *current_cpu)
          (gen-bool-attrs (obj-atlist insn) gen-attr-mask)
          ");\n")
         "")
+     (gen-undef-field-macro (insn-sfmt insn))
      "  return status;\n"
      (if (and parallel? (not (with-generic-write?)))
         (gen-undef-parallel-operand-macro (insn-sfmt insn))
@@ -714,9 +708,7 @@ SEM_FN_NAME (@cpu@,init_idesc_table) (SIM_CPU *current_cpu)
      "{\n"
      "  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);\n"
      "  ARGBUF *abuf = SEM_ARGBUF (sem_arg);\n"
-     (if (with-scache?)
-        (gen-define-field-macro (insn-sfmt insn))
-        "")
+     (gen-define-field-macro (if (with-scache?) (insn-sfmt insn) #f))
      (if (and parallel? (not (with-generic-write?)))
         (gen-define-parallel-operand-macro (insn-sfmt insn))
         "")
@@ -750,9 +742,7 @@ SEM_FN_NAME (@cpu@,init_idesc_table) (SIM_CPU *current_cpu)
      (if (and parallel? (not (with-generic-write?)))
         (gen-undef-parallel-operand-macro (insn-sfmt insn))
         "")
-     (if (with-scache?)
-        (gen-undef-field-macro (insn-sfmt insn))
-        "")
+     (gen-undef-field-macro (insn-sfmt insn))
      "}\n"
      "  NEXT (vpc);\n\n"
      ))
index 83522488b25fd1abfef5e97646d0fbc34719eace..3ef62cc43854a0d7698c09ed02e8d2daeb618081 100644 (file)
 ; Name of macro to access fields in ARGBUF.
 (define c-argbuf-macro "FLD")
 
+; NB: If sfmt is #f, then define the macro to pass through the argument
+; symbol.  This is appropriate for "simple" (non-scache) simulators
+; that have no abuf/scache in the sem.c routines, but rather plain
+; local variables.
 (define (gen-define-argbuf-macro sfmt)
   (string-append "#define " c-argbuf-macro "(f) "
-                "abuf->fields."
-                (gen-sym (sfmt-sbuf sfmt))
-                ".f\n")
+                (if sfmt
+                    (string-append
+                     "abuf->fields."
+                     (gen-sym (sfmt-sbuf sfmt))
+                     ".f\n")
+                    "f\n"))
 )
 
 (define (gen-undef-argbuf-macro sfmt)
This page took 0.037417 seconds and 5 git commands to generate.