OSDN Git Service

Back out sim*.scm changes of 2001-04-02 Ben Elliston <bje@redhat.com>
authordevans <devans>
Fri, 20 Dec 2002 02:22:21 +0000 (02:22 +0000)
committerdevans <devans>
Fri, 20 Dec 2002 02:22:21 +0000 (02:22 +0000)
Instead do:
* sim-decode.scm (-gen-decode-insn-globals): Use @PREFIX@_INSN__MAX
as size of IDESC-TABLE-VAR.
(@prefix@_init_idesc_table): Ditto.
* sim-model.scm (-gen-mach-defns): Ditto.
* sim.scm (gen-cpu-insn-enum-decl): Rename last elm from max to -max.

* utils-scm.scm (-gen-decode-insn-entry): Fix some spacing in output.

* insn.scm (-parse-insn-format-symbol): Improve error message.
(-parse-insn-format): Ditto.

cgen/ChangeLog
cgen/insn.scm
cgen/sim-decode.scm
cgen/sim-model.scm
cgen/sim.scm
cgen/utils-sim.scm

index 10622cf..9fb3d92 100644 (file)
@@ -1,5 +1,18 @@
 2002-12-19  Doug Evans  <dje@sebabeach.org>
 
+       Back out sim*.scm changes of 2001-04-02  Ben Elliston  <bje@redhat.com>
+       Instead do:
+       * sim-decode.scm (-gen-decode-insn-globals): Use @PREFIX@_INSN__MAX
+       as size of IDESC-TABLE-VAR.
+       (@prefix@_init_idesc_table): Ditto.
+       * sim-model.scm (-gen-mach-defns): Ditto.
+       * sim.scm (gen-cpu-insn-enum-decl): Rename last elm from max to -max.
+
+       * utils-scm.scm (-gen-decode-insn-entry): Fix some spacing in output.
+
+       * insn.scm (-parse-insn-format-symbol): Improve error message.
+       (-parse-insn-format): Ditto.
+
        * gen-all-sim: New script.
 
 2002-12-16  DJ Delorie  <dj@delorie.com>
index f438878..34d7521 100644 (file)
        (let ((e (ienum-lookup-val sym)))
          (if e
              (ifld-new-value (ienum:fld (cdr e)) (car e))
-             (parse-error errtxt "bad format element" sym)))))
+             (parse-error errtxt "bad format element, expecting symbol to be operand or insn enum" sym)))))
 )
 
 ; Subroutine of -parse-insn-format to parse an (ifield-name value) ifield spec.
                             (if (and (list? f)
                                      (ifield? (car f)))
                                 (parse-error errtxt "FIXME: <ifield> object in format spec"))
-                            (parse-error errtxt "bad format element" f)))))
+                            (parse-error errtxt "bad format element, neither symbol nor ifield spec" f)))))
                  (cdr fld-list)))
        ((=) (begin
               (if (or (!= (length fld-list) 2)
                   (set! syntax (string-drop1 syntax))))
            (loop))))
     (reverse result))
-  )
+)
 
 ; Given a list of syntax elements (e.g. the result of syntax-break-out),
 ; create a syntax string.
index 5b1aa67..b108b69 100644 (file)
@@ -32,9 +32,7 @@
    teensy bit of cpu in the decoder.  Moving it to malloc space is trivial
    but won't be done until necessary (we don't currently support the runtime
    addition of instructions nor an SMP machine with different cpus).  */
-static IDESC " IDESC-TABLE-VAR "[@PREFIX@_INSN_"
-   (string-upcase (gen-c-symbol (caar (list-take -1
-       (gen-obj-list-enums (non-multi-insns (current-insn-list))))))) " + 1];
+static IDESC " IDESC-TABLE-VAR "[@PREFIX@_INSN__MAX];
 
 /* Commas between elements are contained in the macros.
    Some of these are conditionally compiled out.  */
@@ -147,7 +145,7 @@ void
 {
   IDESC *id,*tabend;
   const struct insn_sem *t,*tend;
-  int tabsize = sizeof (" IDESC-TABLE-VAR ") / sizeof (IDESC);
+  int tabsize = @PREFIX@_INSN__MAX;
   IDESC *table = " IDESC-TABLE-VAR ";
 
   memset (table, 0, tabsize * sizeof (IDESC));
index 8627889..e70fd72 100644 (file)
@@ -313,13 +313,11 @@ static const CGEN_INSN *
 ; Return C code to define the machine data.
 
 (define (-gen-mach-defns)
-  (let* ((insns (gen-obj-list-enums (non-multi-insns (current-insn-list))))
-        (last-insn (string-upcase (gen-c-symbol (caar (list-take -1 insns))))))
-    (string-list-map
-     (lambda (mach)
-       (gen-obj-sanitize
-       mach
-       (string-list "\
+  (string-list-map
+   (lambda (mach)
+     (gen-obj-sanitize
+      mach
+      (string-list "\
 static void\n"
 (gen-sym mach) "_init_cpu (SIM_CPU *cpu)
 {
@@ -328,7 +326,7 @@ static void\n"
   CPU_PC_FETCH (cpu) = " (gen-sym (mach-cpu mach)) "_h_pc_get;
   CPU_PC_STORE (cpu) = " (gen-sym (mach-cpu mach)) "_h_pc_set;
   CPU_GET_IDATA (cpu) = @cpu@_get_idata;
-  CPU_MAX_INSNS (cpu) = @CPU@_INSN_" last-insn " + 1;
+  CPU_MAX_INSNS (cpu) = @CPU@_INSN__MAX;
   CPU_INSN_NAME (cpu) = cgen_insn_name;
   CPU_FULL_ENGINE_FN (cpu) = @cpu@_engine_run_full;
 #if WITH_FAST
@@ -354,7 +352,7 @@ const MACH " (gen-sym mach) "_mach =
 
 ")))
 
-   (current-mach-list)))
+   (current-mach-list))
 )
 \f
 ; Top level file generators.
index cffd558..65dd0b9 100644 (file)
                                                         (atlist-attrs (obj-atlist i))))))
                                          (parallel-insns insn-list)))
                              nil)
-                         (list '(max))))
+                         (list '(-max))))
 )
 
 ; Return the enum of INSN in cpu family CPU.
index fed86de..2481c5e 100644 (file)
                     (if (with-scache?)
                         (if fn?
                             (string-append " @prefix@_extract_" fmt-name " (this, current_cpu, pc, base_insn, entire_insn); goto done;\n")
-                            (string-append "goto extract_" fmt-name ";\n"))
-                        "goto done;\n")))))
+                            (string-append " goto extract_" fmt-name ";\n"))
+                        " goto done;\n")))))
 )
 
 ; Subroutine of -decode-expr-ifield-tracking.